Bug 1203381 part.7 Rename IMEContentObserver::mIs*ChangeEventPending to IMEContentObserver::mNeedsToNotifyIMEOf*Change r=smaug
authorMasayuki Nakano <masayuki@d-toybox.com>
Wed, 16 Sep 2015 17:48:24 +0900
changeset 297081 34606afcc726979bbbc8d5e1b8841fa7865d5f67
parent 297080 46046fcbf40ff4b11330f0dd6150b740f4cd39dc
child 297082 b3f291fbd9f8dbfbd76c5523e28aa0470a3fe181
push id962
push userjlund@mozilla.com
push dateFri, 04 Dec 2015 23:28:54 +0000
treeherdermozilla-release@23a2d286e80f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1203381
milestone43.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 1203381 part.7 Rename IMEContentObserver::mIs*ChangeEventPending to IMEContentObserver::mNeedsToNotifyIMEOf*Change r=smaug
dom/events/IMEContentObserver.cpp
dom/events/IMEContentObserver.h
--- a/dom/events/IMEContentObserver.cpp
+++ b/dom/events/IMEContentObserver.cpp
@@ -219,20 +219,20 @@ NS_IMPL_CYCLE_COLLECTING_RELEASE(IMECont
 
 IMEContentObserver::IMEContentObserver()
   : mESM(nullptr)
   , mSuppressNotifications(0)
   , mPreCharacterDataChangeLength(-1)
   , mSendingNotification(NOTIFY_IME_OF_NOTHING)
   , mIsObserving(false)
   , mIMEHasFocus(false)
-  , mIsFocusEventPending(false)
-  , mIsTextChangeEventPending(false)
-  , mIsSelectionChangeEventPending(false)
-  , mIsPositionChangeEventPending(false)
+  , mNeedsToNotifyIMEOfFocusSet(false)
+  , mNeedsToNotifyIMEOfTextChange(false)
+  , mNeedsToNotifyIMEOfSelectionChange(false)
+  , mNeedsToNotifyIMEOfPositionChange(false)
   , mIsFlushingPendingNotifications(false)
   , mIsHandlingQueryContentEvent(false)
 {
 #ifdef DEBUG
   mTextChangeData.Test();
 #endif
   if (!sIMECOLog) {
     sIMECOLog = PR_NewLogModule("IMEContentObserver");
@@ -1028,42 +1028,42 @@ IMEContentObserver::CancelEditAction()
 }
 
 void
 IMEContentObserver::PostFocusSetNotification()
 {
   MOZ_LOG(sIMECOLog, LogLevel::Debug,
     ("IMECO: 0x%p IMEContentObserver::PostFocusSetNotification()", this));
 
-  mIsFocusEventPending = true;
+  mNeedsToNotifyIMEOfFocusSet = true;
 }
 
 void
 IMEContentObserver::PostTextChangeNotification()
 {
   MOZ_LOG(sIMECOLog, LogLevel::Debug,
     ("IMECO: 0x%p IMEContentObserver::PostTextChangeNotification("
      "mTextChangeData=%s)",
      this, TextChangeDataToString(mTextChangeData).get()));
 
   MOZ_ASSERT(mTextChangeData.IsValid(),
              "mTextChangeData must have text change data");
-  mIsTextChangeEventPending = true;
+  mNeedsToNotifyIMEOfTextChange = true;
 }
 
 void
 IMEContentObserver::PostSelectionChangeNotification()
 {
   MOZ_LOG(sIMECOLog, LogLevel::Debug,
     ("IMECO: 0x%p IMEContentObserver::PostSelectionChangeNotification(), "
      "mSelectionData={ mCausedByComposition=%s, mCausedBySelectionEvent=%s }",
      this, ToChar(mSelectionData.mCausedByComposition),
      ToChar(mSelectionData.mCausedBySelectionEvent)));
 
-  mIsSelectionChangeEventPending = true;
+  mNeedsToNotifyIMEOfSelectionChange = true;
 }
 
 void
 IMEContentObserver::MaybeNotifyIMEOfFocusSet()
 {
   MOZ_LOG(sIMECOLog, LogLevel::Debug,
     ("IMECO: 0x%p IMEContentObserver::MaybeNotifyIMEOfFocusSet()", this));
 
@@ -1159,17 +1159,17 @@ IMEContentObserver::UpdateSelectionCache
 }
 
 void
 IMEContentObserver::PostPositionChangeNotification()
 {
   MOZ_LOG(sIMECOLog, LogLevel::Debug,
     ("IMECO: 0x%p IMEContentObserver::PostPositionChangeNotification()", this));
 
-  mIsPositionChangeEventPending = true;
+  mNeedsToNotifyIMEOfPositionChange = true;
 }
 
 bool
 IMEContentObserver::IsReflowLocked() const
 {
   nsPresContext* presContext = GetPresContext();
   if (NS_WARN_IF(!presContext)) {
     return false;
@@ -1330,51 +1330,51 @@ IMEContentObserver::AChangeEvent::IsSafe
 NS_IMETHODIMP
 IMEContentObserver::IMENotificationSender::Run()
 {
   MOZ_ASSERT(mIMEContentObserver->mIsFlushingPendingNotifications);
 
   // NOTE: Reset each pending flag because sending notification may cause
   //       another change.
 
-  if (mIMEContentObserver->mIsFocusEventPending) {
-    mIMEContentObserver->mIsFocusEventPending = false;
+  if (mIMEContentObserver->mNeedsToNotifyIMEOfFocusSet) {
+    mIMEContentObserver->mNeedsToNotifyIMEOfFocusSet = false;
     SendFocusSet();
     // This is the first notification to IME. So, we don't need to notify
     // anymore since IME starts to query content after it gets focus.
     mIMEContentObserver->ClearPendingNotifications();
     mIMEContentObserver->mIsFlushingPendingNotifications = false;
     return NS_OK;
   }
 
-  if (mIMEContentObserver->mIsTextChangeEventPending) {
-    mIMEContentObserver->mIsTextChangeEventPending = false;
+  if (mIMEContentObserver->mNeedsToNotifyIMEOfTextChange) {
+    mIMEContentObserver->mNeedsToNotifyIMEOfTextChange = false;
     SendTextChange();
   }
 
   // If a text change notification causes another text change again, we should
   // notify IME of that before sending a selection change notification.
-  if (!mIMEContentObserver->mIsTextChangeEventPending) {
+  if (!mIMEContentObserver->mNeedsToNotifyIMEOfTextChange) {
     // Be aware, PuppetWidget depends on the order of this. A selection change
     // notification should not be sent before a text change notification because
     // PuppetWidget shouldn't query new text content every selection change.
-    if (mIMEContentObserver->mIsSelectionChangeEventPending) {
-      mIMEContentObserver->mIsSelectionChangeEventPending = false;
+    if (mIMEContentObserver->mNeedsToNotifyIMEOfSelectionChange) {
+      mIMEContentObserver->mNeedsToNotifyIMEOfSelectionChange = false;
       SendSelectionChange();
     }
   }
 
   // If a text change notification causes another text change again or a
   // selection change notification causes either a text change or another
   // selection change, we should notify IME of those before sending a position
   // change notification.
-  if (!mIMEContentObserver->mIsTextChangeEventPending &&
-      !mIMEContentObserver->mIsSelectionChangeEventPending) {
-    if (mIMEContentObserver->mIsPositionChangeEventPending) {
-      mIMEContentObserver->mIsPositionChangeEventPending = false;
+  if (!mIMEContentObserver->mNeedsToNotifyIMEOfTextChange &&
+      !mIMEContentObserver->mNeedsToNotifyIMEOfSelectionChange) {
+    if (mIMEContentObserver->mNeedsToNotifyIMEOfPositionChange) {
+      mIMEContentObserver->mNeedsToNotifyIMEOfPositionChange = false;
       SendPositionChange();
     }
   }
 
   // If notifications caused some new change, we should notify them now.
   mIMEContentObserver->mIsFlushingPendingNotifications =
     mIMEContentObserver->NeedsToNotifyIMEOfSomething();
   if (mIMEContentObserver->mIsFlushingPendingNotifications) {
--- a/dom/events/IMEContentObserver.h
+++ b/dom/events/IMEContentObserver.h
@@ -136,28 +136,28 @@ private:
   void NotifyIMEOfBlur();
   /**
    *  UnregisterObservers() unregisters all listeners and observers.
    */
   void UnregisterObservers();
   void FlushMergeableNotifications();
   void ClearPendingNotifications()
   {
-    mIsFocusEventPending = false;
-    mIsTextChangeEventPending = false;
-    mIsSelectionChangeEventPending = false;
-    mIsPositionChangeEventPending = false;
+    mNeedsToNotifyIMEOfFocusSet = false;
+    mNeedsToNotifyIMEOfTextChange = false;
+    mNeedsToNotifyIMEOfSelectionChange = false;
+    mNeedsToNotifyIMEOfPositionChange = false;
     mTextChangeData.Clear();
   }
   bool NeedsToNotifyIMEOfSomething() const
   {
-    return mIsFocusEventPending ||
-           mIsTextChangeEventPending ||
-           mIsSelectionChangeEventPending ||
-           mIsPositionChangeEventPending;
+    return mNeedsToNotifyIMEOfFocusSet ||
+           mNeedsToNotifyIMEOfTextChange ||
+           mNeedsToNotifyIMEOfSelectionChange ||
+           mNeedsToNotifyIMEOfPositionChange;
   }
 
   /**
    * UpdateSelectionCache() updates mSelectionData with the latest selection.
    * This should be called only when IsSafeToNotifyIME() returns true.
    *
    * Note that this does nothing if mUpdatePreference.WantSelectionChange()
    * returns false.
@@ -245,20 +245,20 @@ private:
 
   // mSendingNotification is a notification which is now sending from
   // IMENotificationSender.  When the value is NOTIFY_IME_OF_NOTHING, it's
   // not sending any notification.
   IMEMessage mSendingNotification;
 
   bool mIsObserving;
   bool mIMEHasFocus;
-  bool mIsFocusEventPending;
-  bool mIsTextChangeEventPending;
-  bool mIsSelectionChangeEventPending;
-  bool mIsPositionChangeEventPending;
+  bool mNeedsToNotifyIMEOfFocusSet;
+  bool mNeedsToNotifyIMEOfTextChange;
+  bool mNeedsToNotifyIMEOfSelectionChange;
+  bool mNeedsToNotifyIMEOfPositionChange;
   // mIsFlushingPendingNotifications is true between
   // FlushMergeableNotifications() creates IMENotificationSender and
   // IMENotificationSender sent all pending notifications.
   bool mIsFlushingPendingNotifications;
   // mIsHandlingQueryContentEvent is true when IMEContentObserver is handling
   // WidgetQueryContentEvent with ContentEventHandler.
   bool mIsHandlingQueryContentEvent;