Bug 1224994 part.4 Rename the variable name which is for storing the result of TSFTextStore::ContentForTSFRef() to contentForTSF r=m_kato
authorMasayuki Nakano <masayuki@d-toybox.com>
Wed, 29 Jun 2016 17:26:35 +0900
changeset 303674 08af14bb5e38c5723398431cf2c061ea3edd5add
parent 303673 1927603da3c0dea401c1158771cc7b59960fbc32
child 303675 e29577344d51c00c59d24c6e7066d359160b1e14
push id79141
push usercbook@mozilla.com
push dateTue, 05 Jul 2016 14:07:42 +0000
treeherdermozilla-inbound@f08c54971dd1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersm_kato
bugs1224994
milestone50.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1224994 part.4 Rename the variable name which is for storing the result of TSFTextStore::ContentForTSFRef() to contentForTSF r=m_kato MozReview-Commit-ID: 3wWMrpSWW6b
widget/windows/TSFTextStore.cpp
--- a/widget/windows/TSFTextStore.cpp
+++ b/widget/windows/TSFTextStore.cpp
@@ -2319,24 +2319,24 @@ TSFTextStore::RestartComposition(ITfComp
   MOZ_ASSERT(keepComposingStartOffset <= keepComposingEndOffset,
     "Why keepComposingEndOffset is smaller than keepComposingStartOffset?");
   LONG keepComposingLength = keepComposingEndOffset - keepComposingStartOffset;
   // Remove the overlapped part from the commit string.
   nsAutoString commitString(mComposition.mString);
   commitString.Cut(keepComposingStartOffset - mComposition.mStart,
                    keepComposingLength);
   // Update the composition string.
-  Content& lockedContent = ContentForTSFRef();
-  if (!lockedContent.IsInitialized()) {
+  Content& contentForTSF = ContentForTSFRef();
+  if (!contentForTSF.IsInitialized()) {
     MOZ_LOG(sTextStoreLog, LogLevel::Error,
            ("TSF: 0x%p   TSFTextStore::RestartComposition() FAILED "
             "due to ContentForTSFRef() failure", this));
     return E_FAIL;
   }
-  lockedContent.ReplaceTextWith(mComposition.mStart,
+  contentForTSF.ReplaceTextWith(mComposition.mStart,
                                 mComposition.mString.Length(),
                                 commitString);
   // Record a compositionupdate action for commit the part of composing string.
   PendingAction* action = LastOrNewPendingCompositionUpdate();
   action->mData = mComposition.mString;
   action->mRanges->Clear();
   TextRange caretRange;
   caretRange.mStartOffset = caretRange.mEndOffset =
@@ -2348,17 +2348,17 @@ TSFTextStore::RestartComposition(ITfComp
   // Record compositionend action.
   RecordCompositionEndAction();
 
   // Record compositionstart action only with the new start since this method
   // hasn't restored composing string yet.
   RecordCompositionStartAction(aCompositionView, newStart, 0, false);
 
   // Restore the latest text content and selection.
-  lockedContent.ReplaceSelectedTextWith(
+  contentForTSF.ReplaceSelectedTextWith(
     nsDependentSubstring(oldComposition.mString,
                          keepComposingStartOffset - oldComposition.mStart,
                          keepComposingLength));
   currentSelection = oldSelection;
 
   MOZ_LOG(sTextStoreLog, LogLevel::Debug,
          ("TSF: 0x%p   TSFTextStore::RestartComposition() succeeded, "
           "mComposition={ mStart=%d, mCompositionString.Length()=%d }, "
@@ -2777,46 +2777,46 @@ TSFTextStore::GetText(LONG acpStart,
   if (pchPlain && cchPlainReq) *pchPlain = 0;
   if (pulRunInfoOut) *pulRunInfoOut = 0;
   if (pacpNext) *pacpNext = acpStart;
   if (prgRunInfo && ulRunInfoReq) {
     prgRunInfo->uCount = 0;
     prgRunInfo->type = TS_RT_PLAIN;
   }
 
-  Content& lockedContent = ContentForTSFRef();
-  if (!lockedContent.IsInitialized()) {
+  Content& contentForTSF = ContentForTSFRef();
+  if (!contentForTSF.IsInitialized()) {
     MOZ_LOG(sTextStoreLog, LogLevel::Error,
            ("TSF: 0x%p   TSFTextStore::GetText() FAILED due to "
             "ContentForTSFRef() failure", this));
     return E_FAIL;
   }
-  if (lockedContent.Text().Length() < static_cast<uint32_t>(acpStart)) {
+  if (contentForTSF.Text().Length() < static_cast<uint32_t>(acpStart)) {
     MOZ_LOG(sTextStoreLog, LogLevel::Error,
            ("TSF: 0x%p   TSFTextStore::GetText() FAILED due to "
             "acpStart is larger offset than the actual text length", this));
     return TS_E_INVALIDPOS;
   }
   if (acpEnd != -1 &&
-      lockedContent.Text().Length() < static_cast<uint32_t>(acpEnd)) {
+      contentForTSF.Text().Length() < static_cast<uint32_t>(acpEnd)) {
     MOZ_LOG(sTextStoreLog, LogLevel::Error,
            ("TSF: 0x%p   TSFTextStore::GetText() FAILED due to "
             "acpEnd is larger offset than the actual text length", this));
     return TS_E_INVALIDPOS;
   }
   uint32_t length = (acpEnd == -1) ?
-    lockedContent.Text().Length() - static_cast<uint32_t>(acpStart) :
+    contentForTSF.Text().Length() - static_cast<uint32_t>(acpStart) :
     static_cast<uint32_t>(acpEnd - acpStart);
   if (cchPlainReq && cchPlainReq - 1 < length) {
     length = cchPlainReq - 1;
   }
   if (length) {
     if (pchPlain && cchPlainReq) {
       const char16_t* startChar =
-        lockedContent.Text().BeginReading() + acpStart;
+        contentForTSF.Text().BeginReading() + acpStart;
       memcpy(pchPlain, startChar, length * sizeof(*pchPlain));
       pchPlain[length] = 0;
       *pcchPlainOut = length;
     }
     if (prgRunInfo && ulRunInfoReq) {
       prgRunInfo->uCount = length;
       prgRunInfo->type = TS_RT_PLAIN;
       if (pulRunInfoOut) *pulRunInfoOut = 1;
@@ -3243,24 +3243,24 @@ TSFTextStore::GetEndACP(LONG* pacp)
 
   if (!pacp) {
     MOZ_LOG(sTextStoreLog, LogLevel::Error,
            ("TSF: 0x%p   TSFTextStore::GetEndACP() FAILED due to "
             "null argument", this));
     return E_INVALIDARG;
   }
 
-  Content& lockedContent = ContentForTSFRef();
-  if (!lockedContent.IsInitialized()) {
+  Content& contentForTSF = ContentForTSFRef();
+  if (!contentForTSF.IsInitialized()) {
     MOZ_LOG(sTextStoreLog, LogLevel::Error,
            ("TSF: 0x%p   TSFTextStore::GetEndACP() FAILED due to "
             "ContentForTSFRef() failure", this));
     return E_FAIL;
   }
-  *pacp = static_cast<LONG>(lockedContent.Text().Length());
+  *pacp = static_cast<LONG>(contentForTSF.Text().Length());
   return S_OK;
 }
 
 STDMETHODIMP
 TSFTextStore::GetActiveView(TsViewCookie* pvcView)
 {
   MOZ_LOG(sTextStoreLog, LogLevel::Info,
          ("TSF: 0x%p TSFTextStore::GetActiveView(pvcView=0x%p)",
@@ -3402,27 +3402,27 @@ TSFTextStore::GetACPFromPoint(TsViewCook
     //     the other is after the offset, we could resolve the offset.
     //     However, dispatching 2 eQueryTextRect may be expensive.
 
     // So, use tentative offset for now.
     offset = charAtPt.mReply.mTentativeCaretOffset;
 
     // However, if it's after the last character, we need to decrement the
     // offset.
-    Content& lockedContent = ContentForTSFRef();
-    if (!lockedContent.IsInitialized()) {
+    Content& contentForTSF = ContentForTSFRef();
+    if (!contentForTSF.IsInitialized()) {
       MOZ_LOG(sTextStoreLog, LogLevel::Error,
              ("TSF: 0x%p   TSFTextStore::GetACPFromPoint() FAILED due to "
               "ContentForTSFRef() failure", this));
       return E_FAIL;
     }
-    if (lockedContent.Text().Length() <= offset) {
+    if (contentForTSF.Text().Length() <= offset) {
       // If the tentative caret is after the last character, let's return
       // the last character's offset.
-      offset = lockedContent.Text().Length() - 1;
+      offset = contentForTSF.Text().Length() - 1;
     }
   }
 
   if (NS_WARN_IF(offset > LONG_MAX)) {
     MOZ_LOG(sTextStoreLog, LogLevel::Error,
            ("TSF: 0x%p   TSFTextStore::GetACPFromPoint() FAILED due to out of "
             "range of the result", this));
     return TS_E_INVALIDPOINT;
@@ -3905,25 +3905,25 @@ TSFTextStore::InsertTextAtSelectionInter
                                             TS_TEXTCHANGE* aTextChange)
 {
   MOZ_LOG(sTextStoreLog, LogLevel::Debug,
          ("TSF: 0x%p   TSFTextStore::InsertTextAtSelectionInternal("
           "aInsertStr=\"%s\", aTextChange=0x%p), IsComposing=%s",
           this, NS_ConvertUTF16toUTF8(aInsertStr).get(), aTextChange,
           GetBoolName(mComposition.IsComposing())));
 
-  Content& lockedContent = ContentForTSFRef();
-  if (!lockedContent.IsInitialized()) {
+  Content& contentForTSF = ContentForTSFRef();
+  if (!contentForTSF.IsInitialized()) {
     MOZ_LOG(sTextStoreLog, LogLevel::Error,
            ("TSF: 0x%p   TSFTextStore::InsertTextAtSelectionInternal() failed "
             "due to ContentForTSFRef() failure()", this));
     return false;
   }
 
-  TS_SELECTION_ACP oldSelection = lockedContent.Selection().ACP();
+  TS_SELECTION_ACP oldSelection = contentForTSF.Selection().ACP();
   if (!mComposition.IsComposing()) {
     // Use a temporary composition to contain the text
     PendingAction* compositionStart = mPendingActions.AppendElement();
     compositionStart->mType = PendingAction::COMPOSITION_START;
     compositionStart->mSelectionStart = oldSelection.acpStart;
     compositionStart->mSelectionLength =
       oldSelection.acpEnd - oldSelection.acpStart;
     compositionStart->mAdjustSelection = false;
@@ -3939,22 +3939,22 @@ TSFTextStore::InsertTextAtSelectionInter
              "mSelectionLength=%d }, PendingCompositionEnd={ mData=\"%s\" "
              "(Length()=%u) }",
              this, compositionStart->mSelectionStart,
              compositionStart->mSelectionLength,
              NS_ConvertUTF16toUTF8(compositionEnd->mData).get(),
              compositionEnd->mData.Length()));
   }
 
-  lockedContent.ReplaceSelectedTextWith(aInsertStr);
+  contentForTSF.ReplaceSelectedTextWith(aInsertStr);
 
   if (aTextChange) {
     aTextChange->acpStart = oldSelection.acpStart;
     aTextChange->acpOldEnd = oldSelection.acpEnd;
-    aTextChange->acpNewEnd = lockedContent.Selection().EndOffset();
+    aTextChange->acpNewEnd = contentForTSF.Selection().EndOffset();
   }
 
   MOZ_LOG(sTextStoreLog, LogLevel::Debug,
          ("TSF: 0x%p   TSFTextStore::InsertTextAtSelectionInternal() "
           "succeeded: mWidget=0x%p, mWidget->Destroyed()=%s, aTextChange={ "
           "acpStart=%ld, acpOldEnd=%ld, acpNewEnd=%ld }",
           this, mWidget.get(),
           GetBoolName(mWidget ? mWidget->Destroyed() : true),
@@ -4012,18 +4012,18 @@ TSFTextStore::RecordCompositionStartActi
 {
   MOZ_LOG(sTextStoreLog, LogLevel::Debug,
          ("TSF: 0x%p   TSFTextStore::RecordCompositionStartAction("
           "aComposition=0x%p, aStart=%d, aLength=%d, aPreserveSelection=%s), "
           "mComposition.mView=0x%p",
           this, aComposition, aStart, aLength, GetBoolName(aPreserveSelection),
           mComposition.mView.get()));
 
-  Content& lockedContent = ContentForTSFRef();
-  if (!lockedContent.IsInitialized()) {
+  Content& contentForTSF = ContentForTSFRef();
+  if (!contentForTSF.IsInitialized()) {
     MOZ_LOG(sTextStoreLog, LogLevel::Error,
            ("TSF: 0x%p   TSFTextStore::RecordCompositionStartAction() FAILED "
             "due to ContentForTSFRef() failure", this));
     return E_FAIL;
   }
 
   CompleteLastActionIfStillIncomplete();
 
@@ -4033,17 +4033,17 @@ TSFTextStore::RecordCompositionStartActi
   // compositionstart occurred same range as this composition, it was the
   // start of this composition.  In such case, we should cancel the pending
   // compositionend and start composition normally.
   if (!aPreserveSelection &&
       WasTextInsertedWithoutCompositionAt(aStart, aLength)) {
     const PendingAction& pendingCompositionEnd = mPendingActions.LastElement();
     const PendingAction& pendingCompositionStart =
       mPendingActions[mPendingActions.Length() - 2];
-    lockedContent.RestoreCommittedComposition(
+    contentForTSF.RestoreCommittedComposition(
       aComposition, pendingCompositionStart, pendingCompositionEnd);
     mPendingActions.RemoveElementAt(mPendingActions.Length() - 1);
     MOZ_LOG(sTextStoreLog, LogLevel::Info,
            ("TSF: 0x%p   TSFTextStore::RecordCompositionStartAction() "
             "succeeded: restoring the committed string as composing string, "
             "mComposition={ mStart=%ld, mString.Length()=%ld, "
             "mSelection={ acpStart=%ld, acpEnd=%ld, style.ase=%s, "
             "style.fInterimChar=%s } }",
@@ -4073,17 +4073,17 @@ TSFTextStore::RecordCompositionStartActi
   } else {
     // We shouldn't dispatch selection set event before dispatching
     // compositionstart event because it may cause put caret different
     // position in HTML editor since generated flat text content and offset in
     // it are lossy data of HTML contents.
     action->mAdjustSelection = false;
   }
 
-  lockedContent.StartComposition(aComposition, *action, aPreserveSelection);
+  contentForTSF.StartComposition(aComposition, *action, aPreserveSelection);
   action->mData = mComposition.mString;
 
   MOZ_LOG(sTextStoreLog, LogLevel::Info,
          ("TSF: 0x%p   TSFTextStore::RecordCompositionStartAction() succeeded: "
           "mComposition={ mStart=%ld, mString.Length()=%ld, "
           "mSelection={ acpStart=%ld, acpEnd=%ld, style.ase=%s, "
           "style.fInterimChar=%s } }",
           this, mComposition.mStart, mComposition.mString.Length(),
@@ -4104,24 +4104,24 @@ TSFTextStore::RecordCompositionEndAction
 
   MOZ_ASSERT(mComposition.IsComposing());
 
   CompleteLastActionIfStillIncomplete();
   PendingAction* action = mPendingActions.AppendElement();
   action->mType = PendingAction::COMPOSITION_END;
   action->mData = mComposition.mString;
 
-  Content& lockedContent = ContentForTSFRef();
-  if (!lockedContent.IsInitialized()) {
+  Content& contentForTSF = ContentForTSFRef();
+  if (!contentForTSF.IsInitialized()) {
     MOZ_LOG(sTextStoreLog, LogLevel::Error,
            ("TSF: 0x%p   TSFTextStore::RecordCompositionEndAction() FAILED due "
             "to ContentForTSFRef() failure", this));
     return E_FAIL;
   }
-  lockedContent.EndComposition(*action);
+  contentForTSF.EndComposition(*action);
 
   // If this composition was restart but the composition doesn't modify
   // anything, we should remove the pending composition for preventing to
   // dispatch redundant composition events.
   for (size_t i = mPendingActions.Length(), j = 1; i > 0; --i, ++j) {
     PendingAction& pendingAction = mPendingActions[i - 1];
     if (pendingAction.mType == PendingAction::COMPOSITION_START) {
       if (pendingAction.mData != action->mData) {