Bug 960871 part.2 Rename WidgetCompositionEvent::data to WidgetCompositionEvent::mData r=smaug
authorMasayuki Nakano <masayuki@d-toybox.com>
Tue, 07 Oct 2014 19:01:46 +0900
changeset 209137 3b622a7464cc84dbb5ad860fc01aff62311cd92d
parent 209136 aad7264777993babeac9991c80cd29ea9a421f38
child 209138 d2eebbc42474e590edc824c975ae5a6f3ec99111
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewerssmaug
bugs960871
milestone35.0a1
Bug 960871 part.2 Rename WidgetCompositionEvent::data to WidgetCompositionEvent::mData r=smaug
dom/base/nsDOMWindowUtils.cpp
dom/events/CompositionEvent.cpp
dom/events/EventStateManager.cpp
dom/events/TextComposition.cpp
widget/TextEvents.h
widget/android/nsWindow.cpp
widget/cocoa/TextInputHandler.mm
widget/gtk/nsGtkIMModule.cpp
widget/nsGUIEventIPC.h
widget/windows/nsIMM32Handler.cpp
widget/windows/nsTextStore.cpp
--- a/dom/base/nsDOMWindowUtils.cpp
+++ b/dom/base/nsDOMWindowUtils.cpp
@@ -2127,17 +2127,17 @@ nsDOMWindowUtils::SendCompositionEvent(c
     return NS_OK;
   } else {
     return NS_ERROR_FAILURE;
   }
 
   WidgetCompositionEvent compositionEvent(true, msg, widget);
   InitEvent(compositionEvent);
   if (msg != NS_COMPOSITION_START) {
-    compositionEvent.data = aData;
+    compositionEvent.mData = aData;
   }
 
   compositionEvent.mFlags.mIsSynthesizedForTests = true;
 
   nsEventStatus status;
   nsresult rv = widget->DispatchEvent(&compositionEvent, status);
   NS_ENSURE_SUCCESS(rv, rv);
 
--- a/dom/events/CompositionEvent.cpp
+++ b/dom/events/CompositionEvent.cpp
@@ -27,17 +27,18 @@ CompositionEvent::CompositionEvent(Event
     mEvent->time = PR_Now();
 
     // XXX compositionstart is cancelable in draft of DOM3 Events.
     //     However, it doesn't make sence for us, we cannot cancel composition
     //     when we sends compositionstart event.
     mEvent->mFlags.mCancelable = false;
   }
 
-  mData = mEvent->AsCompositionEvent()->data;
+  // XXX Do we really need to duplicate the data value?
+  mData = mEvent->AsCompositionEvent()->mData;
   // TODO: Native event should have locale information.
 }
 
 NS_IMPL_ADDREF_INHERITED(CompositionEvent, UIEvent)
 NS_IMPL_RELEASE_INHERITED(CompositionEvent, UIEvent)
 
 NS_INTERFACE_MAP_BEGIN(CompositionEvent)
   NS_INTERFACE_MAP_ENTRY(nsIDOMCompositionEvent)
--- a/dom/events/EventStateManager.cpp
+++ b/dom/events/EventStateManager.cpp
@@ -812,17 +812,17 @@ EventStateManager::PreHandleEvent(nsPres
     if (aEvent->mFlags.mIsTrusted) {
       // If the event is trusted event, set the selected text to data of
       // composition event.
       WidgetCompositionEvent* compositionEvent = aEvent->AsCompositionEvent();
       WidgetQueryContentEvent selectedText(true, NS_QUERY_SELECTED_TEXT,
                                            compositionEvent->widget);
       DoQuerySelectedText(&selectedText);
       NS_ASSERTION(selectedText.mSucceeded, "Failed to get selected text");
-      compositionEvent->data = selectedText.mReply.mString;
+      compositionEvent->mData = selectedText.mReply.mString;
     }
     // through to compositionend handling
   case NS_COMPOSITION_END:
     {
       WidgetCompositionEvent* compositionEvent = aEvent->AsCompositionEvent();
       if (IsTargetCrossProcess(compositionEvent)) {
         // Will not be handled locally, remote the event
         if (GetCrossProcessTarget()->SendCompositionEvent(*compositionEvent)) {
--- a/dom/events/TextComposition.cpp
+++ b/dom/events/TextComposition.cpp
@@ -71,22 +71,22 @@ TextComposition::MaybeDispatchCompositio
     return true;
   }
 
   WidgetCompositionEvent compositionUpdate(aEvent->mFlags.mIsTrusted,
                                            NS_COMPOSITION_UPDATE,
                                            aEvent->widget);
   compositionUpdate.time = aEvent->time;
   compositionUpdate.timeStamp = aEvent->timeStamp;
-  compositionUpdate.data = aEvent->mData;
+  compositionUpdate.mData = aEvent->mData;
   compositionUpdate.mFlags.mIsSynthesizedForTests =
     aEvent->mFlags.mIsSynthesizedForTests;
 
   nsEventStatus status = nsEventStatus_eConsumeNoDefault;
-  mLastData = compositionUpdate.data;
+  mLastData = compositionUpdate.mData;
   EventDispatcher::Dispatch(mNode, mPresContext,
                             &compositionUpdate, nullptr, &status, nullptr);
   return !Destroyed();
 }
 
 void
 TextComposition::OnCompositionEventDiscarded(const WidgetGUIEvent* aEvent)
 {
@@ -141,17 +141,17 @@ TextComposition::DispatchEvent(WidgetGUI
   // string.  Therefore, we should hack it only when:
   // 1. committing string is empty string at requesting commit but the last
   //    data isn't IDEOGRAPHIC SPACE.
   // 2. non-empty string is committed at requesting cancel.
   if (!aIsSynthesized && (mIsRequestingCommit || mIsRequestingCancel)) {
     nsString* committingData = nullptr;
     switch (aEvent->message) {
       case NS_COMPOSITION_END:
-        committingData = &aEvent->AsCompositionEvent()->data;
+        committingData = &aEvent->AsCompositionEvent()->mData;
         break;
       case NS_TEXT_TEXT:
         committingData = &aEvent->AsTextEvent()->mData;
         break;
       default:
         NS_WARNING("Unexpected event comes during committing or "
                    "canceling composition");
         break;
@@ -299,17 +299,17 @@ TextComposition::RequestToCommit(nsIWidg
           (changingData || !commitData.IsEmpty())) {
         nsEventStatus status = nsEventStatus_eIgnore;
         widget->DispatchEvent(&textEvent, status);
       }
 
       if (!Destroyed() && !widget->Destroyed()) {
         nsEventStatus status = nsEventStatus_eIgnore;
         WidgetCompositionEvent endEvent(true, NS_COMPOSITION_END, widget);
-        endEvent.data = commitData;
+        endEvent.mData = commitData;
         endEvent.mFlags.mIsSynthesizedForTests = true;
         widget->DispatchEvent(&endEvent, status);
       }
     }
   }
 
   mRequestedToCommitOrCancel = true;
 
@@ -430,27 +430,27 @@ TextComposition::CompositionEventDispatc
   switch (mEventMessage) {
     case NS_COMPOSITION_START: {
       WidgetCompositionEvent compStart(true, NS_COMPOSITION_START, widget);
       WidgetQueryContentEvent selectedText(true, NS_QUERY_SELECTED_TEXT,
                                            widget);
       ContentEventHandler handler(presContext);
       handler.OnQuerySelectedText(&selectedText);
       NS_ASSERTION(selectedText.mSucceeded, "Failed to get selected text");
-      compStart.data = selectedText.mReply.mString;
+      compStart.mData = selectedText.mReply.mString;
       compStart.mFlags.mIsSynthesizedForTests =
         mTextComposition->IsSynthesizedForTests();
       IMEStateManager::DispatchCompositionEvent(mEventTarget, presContext,
                                                 &compStart, &status, nullptr,
                                                 mIsSynthesizedEvent);
       break;
     }
     case NS_COMPOSITION_END: {
       WidgetCompositionEvent compEvent(true, mEventMessage, widget);
-      compEvent.data = mData;
+      compEvent.mData = mData;
       compEvent.mFlags.mIsSynthesizedForTests =
         mTextComposition->IsSynthesizedForTests();
       IMEStateManager::DispatchCompositionEvent(mEventTarget, presContext,
                                                 &compEvent, &status, nullptr,
                                                 mIsSynthesizedEvent);
       break;
     }
     case NS_TEXT_TEXT: {
--- a/widget/TextEvents.h
+++ b/widget/TextEvents.h
@@ -321,24 +321,24 @@ public:
     result->AssignCompositionEventData(*this, true);
     result->mFlags = mFlags;
     return result;
   }
 
   // The composition string or the commit string.  If the instance is a
   // compositionstart event, this is initialized with selected text by
   // TextComposition automatically.
-  nsString data;
+  nsString mData;
 
   void AssignCompositionEventData(const WidgetCompositionEvent& aEvent,
                                   bool aCopyTargets)
   {
     AssignGUIEventData(aEvent, aCopyTargets);
 
-    data = aEvent.data;
+    mData = aEvent.mData;
   }
 };
 
 /******************************************************************************
  * mozilla::WidgetQueryContentEvent
  ******************************************************************************/
 
 class WidgetQueryContentEvent : public WidgetGUIEvent
--- a/widget/android/nsWindow.cpp
+++ b/widget/android/nsWindow.cpp
@@ -1863,17 +1863,17 @@ nsWindow::OnIMEEvent(AndroidGeckoEvent *
                 DispatchEvent(&event);
             }
 
             // Don't end composition when composing text.
             if (ae->Action() != AndroidGeckoEvent::IME_COMPOSE_TEXT)
             {
                 WidgetCompositionEvent event(true, NS_COMPOSITION_END, this);
                 InitEvent(event, nullptr);
-                event.data = ae->Characters();
+                event.mData = ae->Characters();
                 DispatchEvent(&event);
             }
 
             FlushIMEChanges();
             mozilla::widget::android::GeckoAppShell::NotifyIME(
                 AndroidBridge::NOTIFY_IME_REPLY_EVENT);
         }
         break;
--- a/widget/cocoa/TextInputHandler.mm
+++ b/widget/cocoa/TextInputHandler.mm
@@ -2815,17 +2815,17 @@ IMEInputHandler::InsertTextAsCommittingC
        "destroyed by text event", this));
     return;
   }
 
   OnUpdateIMEComposition([aAttrString string]);
 
   WidgetCompositionEvent compEnd(true, NS_COMPOSITION_END, mWidget);
   InitCompositionEvent(compEnd);
-  compEnd.data = mLastDispatchedCompositionString;
+  compEnd.mData = mLastDispatchedCompositionString;
   DispatchEvent(compEnd);
   if (Destroyed()) {
     PR_LOG(gLog, PR_LOG_ALWAYS,
       ("%p IMEInputHandler::InsertTextAsCommittingComposition, "
        "destroyed by compositionend event", this));
     return;
   }
 
@@ -2924,17 +2924,17 @@ IMEInputHandler::SetMarkedText(NSAttribu
         ("%p IMEInputHandler::SetMarkedText, "
          "destroyed by text event", this));
       return;
     }
 
     if (doCommit) {
       WidgetCompositionEvent compEnd(true, NS_COMPOSITION_END, mWidget);
       InitCompositionEvent(compEnd);
-      compEnd.data = mLastDispatchedCompositionString;
+      compEnd.mData = mLastDispatchedCompositionString;
       DispatchEvent(compEnd);
       if (Destroyed()) {
         PR_LOG(gLog, PR_LOG_ALWAYS,
           ("%p IMEInputHandler::SetMarkedText, "
            "destroyed by compositionend event", this));
         return;
       }
       OnEndIMEComposition();
--- a/widget/gtk/nsGtkIMModule.cpp
+++ b/widget/gtk/nsGtkIMModule.cpp
@@ -1043,17 +1043,17 @@ nsGtkIMModule::DispatchCompositionEnd()
         PR_LOG(gGtkIMLog, PR_LOG_ALWAYS,
             ("    FAILED, there are no focused window in this module"));
         return false;
     }
 
     WidgetCompositionEvent compEvent(true, NS_COMPOSITION_END,
                                      mLastFocusedWindow);
     InitEvent(compEvent);
-    compEvent.data = mDispatchedCompositionString;
+    compEvent.mData = mDispatchedCompositionString;
     nsEventStatus status;
     nsCOMPtr<nsIWidget> kungFuDeathGrip = mLastFocusedWindow;
     mLastFocusedWindow->DispatchEvent(&compEvent, status);
     mCompositionState = eCompositionState_NotComposing;
     mCompositionStart = UINT32_MAX;
     mCompositionTargetOffset = UINT32_MAX;
     mDispatchedCompositionString.Truncate();
     if (static_cast<nsWindow*>(kungFuDeathGrip.get())->IsDestroyed() ||
--- a/widget/nsGUIEventIPC.h
+++ b/widget/nsGUIEventIPC.h
@@ -490,25 +490,25 @@ template<>
 struct ParamTraits<mozilla::WidgetCompositionEvent>
 {
   typedef mozilla::WidgetCompositionEvent paramType;
 
   static void Write(Message* aMsg, const paramType& aParam)
   {
     WriteParam(aMsg, static_cast<mozilla::WidgetGUIEvent>(aParam));
     WriteParam(aMsg, aParam.mSeqno);
-    WriteParam(aMsg, aParam.data);
+    WriteParam(aMsg, aParam.mData);
   }
 
   static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
   {
     return ReadParam(aMsg, aIter,
                      static_cast<mozilla::WidgetGUIEvent*>(aResult)) &&
            ReadParam(aMsg, aIter, &aResult->mSeqno) &&
-           ReadParam(aMsg, aIter, &aResult->data);
+           ReadParam(aMsg, aIter, &aResult->mData);
   }
 };
 
 template<>
 struct ParamTraits<mozilla::WidgetQueryContentEvent>
 {
   typedef mozilla::WidgetQueryContentEvent paramType;
 
--- a/widget/windows/nsIMM32Handler.cpp
+++ b/widget/windows/nsIMM32Handler.cpp
@@ -1222,17 +1222,17 @@ nsIMM32Handler::HandleEndComposition(nsW
 
   if (mNativeCaretIsCreated) {
     ::DestroyCaret();
     mNativeCaretIsCreated = false;
   }
 
   aWindow->InitEvent(event, &point);
   // The last dispatched composition string must be the committed string.
-  event.data = mLastDispatchedCompositionString;
+  event.mData = mLastDispatchedCompositionString;
   aWindow->DispatchWindowEvent(&event);
   mIsComposing = false;
   mComposingWindow = nullptr;
   mLastDispatchedCompositionString.Truncate();
 }
 
 static void
 DumpReconvertString(RECONVERTSTRING* aReconv)
--- a/widget/windows/nsTextStore.cpp
+++ b/widget/windows/nsTextStore.cpp
@@ -1685,17 +1685,17 @@ nsTextStore::FlushPendingActions()
           break;
         }
 
         PR_LOG(sTextStoreLog, PR_LOG_DEBUG,
                ("TSF: 0x%p   nsTextStore::FlushPendingActions(), "
                 "dispatching compositionend event...", this));
         WidgetCompositionEvent compositionEnd(true, NS_COMPOSITION_END,
                                               mWidget);
-        compositionEnd.data = textEvent.mData;
+        compositionEnd.mData = textEvent.mData;
         mWidget->InitEvent(compositionEnd);
         mWidget->DispatchWindowEvent(&compositionEnd);
         if (!mWidget || mWidget->Destroyed()) {
           break;
         }
         break;
       }
       case PendingAction::SELECTION_SET: {