Bug 983049 part.4 Rename nsDispatchingCallback to mozilla::EventDispatchingCallback r=smaug
authorMasayuki Nakano <masayuki@d-toybox.com>
Tue, 18 Mar 2014 13:48:20 +0900
changeset 174007 b17a1bc1437d10e9ef353f6d39ccbf5fe9539fd3
parent 174006 d3964cfadc3c6b169d821eec7be2bdf2347431b3
child 174008 29757c0fa5915c235efffe343efe37f4edaba923
push id41165
push usermasayuki@d-toybox.com
push dateTue, 18 Mar 2014 04:48:26 +0000
treeherdermozilla-inbound@735beb5ce026 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs983049
milestone31.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 983049 part.4 Rename nsDispatchingCallback to mozilla::EventDispatchingCallback r=smaug
dom/events/IMEStateManager.cpp
dom/events/IMEStateManager.h
dom/events/TextComposition.cpp
dom/events/TextComposition.h
dom/events/nsEventDispatcher.cpp
dom/events/nsEventDispatcher.h
dom/events/nsEventStateManager.cpp
layout/base/nsPresShell.cpp
--- a/dom/events/IMEStateManager.cpp
+++ b/dom/events/IMEStateManager.cpp
@@ -24,16 +24,17 @@
 #include "nsIForm.h"
 #include "nsIFormControl.h"
 #include "nsINode.h"
 #include "nsIObserverService.h"
 #include "nsIPresShell.h"
 #include "nsISelection.h"
 #include "nsISupports.h"
 #include "nsPresContext.h"
+#include "nsEventDispatcher.h"
 
 namespace mozilla {
 
 using namespace dom;
 using namespace widget;
 
 nsIContent* IMEStateManager::sContent = nullptr;
 nsPresContext* IMEStateManager::sPresContext = nullptr;
@@ -495,17 +496,17 @@ IMEStateManager::EnsureTextCompositionAr
   sTextCompositions = new TextCompositionArray();
 }
 
 void
 IMEStateManager::DispatchCompositionEvent(nsINode* aEventTargetNode,
                                           nsPresContext* aPresContext,
                                           WidgetEvent* aEvent,
                                           nsEventStatus* aStatus,
-                                          nsDispatchingCallback* aCallBack)
+                                          EventDispatchingCallback* aCallBack)
 {
   MOZ_ASSERT(aEvent->eventStructType == NS_COMPOSITION_EVENT ||
              aEvent->eventStructType == NS_TEXT_EVENT);
   if (!aEvent->mFlags.mIsTrusted || aEvent->mFlags.mPropagationStopped) {
     return;
   }
 
   EnsureTextCompositionArray();
--- a/dom/events/IMEStateManager.h
+++ b/dom/events/IMEStateManager.h
@@ -4,26 +4,26 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_IMEStateManager_h_
 #define mozilla_IMEStateManager_h_
 
 #include "mozilla/EventForwards.h"
 #include "nsIWidget.h"
 
-class nsDispatchingCallback;
 class nsIContent;
 class nsIDOMMouseEvent;
 class nsINode;
 class nsPIDOMWindow;
 class nsPresContext;
 class nsISelection;
 
 namespace mozilla {
 
+class EventDispatchingCallback;
 class IMEContentObserver;
 class TextCompositionArray;
 class TextComposition;
 
 /**
  * IMEStateManager manages InputContext (e.g., active editor type, IME enabled
  * state and IME open state) of nsIWidget instances, manages IMEContentObserver
  * and provides useful API for IME.
@@ -89,17 +89,17 @@ public:
    * and ensuring a set of composition events must be fired the stored target.
    * If the stored composition event target is destroying, this removes the
    * stored composition automatically.
    */
   static void DispatchCompositionEvent(nsINode* aEventTargetNode,
                                        nsPresContext* aPresContext,
                                        WidgetEvent* aEvent,
                                        nsEventStatus* aStatus,
-                                       nsDispatchingCallback* aCallBack);
+                                       EventDispatchingCallback* aCallBack);
 
   /**
    * Get TextComposition from widget.
    */
   static already_AddRefed<TextComposition>
     GetTextCompositionFor(nsIWidget* aWidget);
 
   /**
--- a/dom/events/TextComposition.cpp
+++ b/dom/events/TextComposition.cpp
@@ -51,17 +51,17 @@ bool
 TextComposition::MatchesNativeContext(nsIWidget* aWidget) const
 {
   return mNativeContext == aWidget->GetInputContext().mNativeIMEContext;
 }
 
 void
 TextComposition::DispatchEvent(WidgetGUIEvent* aEvent,
                                nsEventStatus* aStatus,
-                               nsDispatchingCallback* aCallBack)
+                               EventDispatchingCallback* aCallBack)
 {
   if (aEvent->message == NS_COMPOSITION_UPDATE) {
     mLastData = aEvent->AsCompositionEvent()->data;
   }
 
   nsEventDispatcher::Dispatch(mNode, mPresContext,
                               aEvent, nullptr, aStatus, aCallBack);
 
--- a/dom/events/TextComposition.h
+++ b/dom/events/TextComposition.h
@@ -13,21 +13,21 @@
 #include "nsIWidget.h"
 #include "nsTArray.h"
 #include "nsThreadUtils.h"
 #include "nsPresContext.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/EventForwards.h"
 #include "mozilla/TextRange.h"
 
-class nsDispatchingCallback;
 class nsIEditor;
 
 namespace mozilla {
 
+class EventDispatchingCallback;
 class IMEStateManager;
 
 /**
  * TextComposition represents a text composition.  This class stores the
  * composition event target and its presContext.  At dispatching the event via
  * this class, the instances use the stored event target.
  */
 
@@ -214,17 +214,17 @@ private:
   void EditorDidHandleTextEvent();
 
   /**
    * DispatchEvent() dispatches the aEvent to the mContent synchronously.
    * The caller must ensure that it's safe to dispatch the event.
    */
   void DispatchEvent(WidgetGUIEvent* aEvent,
                      nsEventStatus* aStatus,
-                     nsDispatchingCallback* aCallBack);
+                     EventDispatchingCallback* aCallBack);
 
   /**
    * Calculate composition offset then notify composition update to widget
    */
   void NotityUpdateComposition(WidgetGUIEvent* aEvent);
 
   /**
    * CompositionEventDispatcher dispatches the specified composition (or text)
--- a/dom/events/nsEventDispatcher.cpp
+++ b/dom/events/nsEventDispatcher.cpp
@@ -152,17 +152,17 @@ public:
   /**
    * Dispatches event through the event target chain.
    * Handles capture, target and bubble phases both in default
    * and system event group and calls also PostHandleEvent for each
    * item in the chain.
    */
   static void HandleEventTargetChain(nsTArray<nsEventTargetChainItem>& aChain,
                                      EventChainPostVisitor& aVisitor,
-                                     nsDispatchingCallback* aCallback,
+                                     EventDispatchingCallback* aCallback,
                                      ELMCreationDetector& aCd);
 
   /**
    * Resets aVisitor object and calls PreHandleEvent.
    * Copies mItemFlags and mItemData to the current nsEventTargetChainItem.
    */
   void PreHandleEvent(EventChainPreVisitor& aVisitor);
 
@@ -237,17 +237,17 @@ nsEventTargetChainItem::PostHandleEvent(
   aVisitor.mItemData = mItemData;
   mTarget->PostHandleEvent(aVisitor);
 }
 
 void
 nsEventTargetChainItem::HandleEventTargetChain(
                           nsTArray<nsEventTargetChainItem>& aChain,
                           EventChainPostVisitor& aVisitor,
-                          nsDispatchingCallback* aCallback,
+                          EventDispatchingCallback* aCallback,
                           ELMCreationDetector& aCd)
 {
   // Save the target so that it can be restored later.
   nsCOMPtr<EventTarget> firstTarget = aVisitor.mEvent->target;
   uint32_t chainLength = aChain.Length();
 
   // Capture
   aVisitor.mEvent->mFlags.mInCapturePhase = true;
@@ -374,17 +374,17 @@ EventTargetChainItemForChromeTarget(nsTA
 }
 
 /* static */ nsresult
 nsEventDispatcher::Dispatch(nsISupports* aTarget,
                             nsPresContext* aPresContext,
                             WidgetEvent* aEvent,
                             nsIDOMEvent* aDOMEvent,
                             nsEventStatus* aEventStatus,
-                            nsDispatchingCallback* aCallback,
+                            EventDispatchingCallback* aCallback,
                             nsCOMArray<EventTarget>* aTargets)
 {
   PROFILER_LABEL("nsEventDispatcher", "Dispatch");
   NS_ASSERTION(aEvent, "Trying to dispatch without WidgetEvent!");
   NS_ENSURE_TRUE(!aEvent->mFlags.mIsBeingDispatched,
                  NS_ERROR_DOM_INVALID_STATE_ERR);
   NS_ASSERTION(!aTargets || !aEvent->message, "Wrong parameters!");
 
--- a/dom/events/nsEventDispatcher.h
+++ b/dom/events/nsEventDispatcher.h
@@ -201,29 +201,30 @@ class EventChainPostVisitor : public moz
 public:
   EventChainPostVisitor(EventChainVisitor& aOther)
     : EventChainVisitor(aOther.mPresContext, aOther.mEvent,
                         aOther.mDOMEvent, aOther.mEventStatus)
   {
   }
 };
 
-} // namespace mozilla
-
 /**
- * If an nsDispatchingCallback object is passed to Dispatch,
+ * If an EventDispatchingCallback object is passed to Dispatch,
  * its HandleEvent method is called after handling the default event group,
  * before handling the system event group.
  * This is used in nsPresShell.
  */
-class MOZ_STACK_CLASS nsDispatchingCallback {
+class MOZ_STACK_CLASS EventDispatchingCallback
+{
 public:
-  virtual void HandleEvent(mozilla::EventChainPostVisitor& aVisitor) = 0;
+  virtual void HandleEvent(EventChainPostVisitor& aVisitor) = 0;
 };
 
+} // namespace mozilla
+
 /**
  * The generic class for event dispatching.
  * Must not be used outside Gecko!
  */
 class nsEventDispatcher
 {
 public:
   /**
@@ -242,17 +243,17 @@ public:
    * NS_EVENT_NULL.
    * @note Use this method when dispatching a WidgetEvent.
    */
   static nsresult Dispatch(nsISupports* aTarget,
                            nsPresContext* aPresContext,
                            mozilla::WidgetEvent* aEvent,
                            nsIDOMEvent* aDOMEvent = nullptr,
                            nsEventStatus* aEventStatus = nullptr,
-                           nsDispatchingCallback* aCallback = nullptr,
+                           mozilla::EventDispatchingCallback* aCallback = nullptr,
                            nsCOMArray<mozilla::dom::EventTarget>* aTargets = nullptr);
 
   /**
    * Dispatches an event.
    * If aDOMEvent is not nullptr, it is used for dispatching
    * (aEvent can then be nullptr) and (if aDOMEvent is not |trusted| already),
    * the |trusted| flag is set based on the UniversalXPConnect capability.
    * Otherwise this works like nsEventDispatcher::Dispatch.
--- a/dom/events/nsEventStateManager.cpp
+++ b/dom/events/nsEventStateManager.cpp
@@ -4028,17 +4028,17 @@ nsEventStateManager::SetCursor(int32_t a
   }
 
   if (NS_FAILED(rv))
     aWidget->SetCursor(c);
 
   return NS_OK;
 }
 
-class MOZ_STACK_CLASS nsESMEventCB : public nsDispatchingCallback
+class MOZ_STACK_CLASS nsESMEventCB : public EventDispatchingCallback
 {
 public:
   nsESMEventCB(nsIContent* aTarget) : mTarget(aTarget) {}
 
   virtual void HandleEvent(EventChainPostVisitor& aVisitor)
   {
     if (aVisitor.mPresContext) {
       nsIFrame* frame = aVisitor.mPresContext->GetPrimaryFrameFor(mTarget);
--- a/layout/base/nsPresShell.cpp
+++ b/layout/base/nsPresShell.cpp
@@ -439,17 +439,17 @@ public:
     else {
       nsContentUtils::RemoveScriptBlocker();
     }
   }
 
   PresShell* mShell;
 };
 
-class MOZ_STACK_CLASS nsPresShellEventCB : public nsDispatchingCallback
+class MOZ_STACK_CLASS nsPresShellEventCB : public EventDispatchingCallback
 {
 public:
   nsPresShellEventCB(PresShell* aPresShell) : mPresShell(aPresShell) {}
 
   virtual void HandleEvent(EventChainPostVisitor& aVisitor) MOZ_OVERRIDE
   {
     if (aVisitor.mPresContext && aVisitor.mEvent->eventStructType != NS_EVENT) {
       if (aVisitor.mEvent->message == NS_MOUSE_BUTTON_DOWN ||