Bug 984271 part.4 Move the all other stuff in EventStateManager.cpp into mozilla:: namespace r=smaug
authorMasayuki Nakano <masayuki@d-toybox.com>
Tue, 01 Apr 2014 13:09:24 +0900
changeset 176465 e522bee65d65a4c3c66ce2dada3f6cc7bfdf4e0b
parent 176464 6e171e00a903a9857fbb72ed4a0143ad2fe9b692
child 176466 561b9329d832ff3c5c3d2a83e8026e70dd88f97a
push id26524
push userryanvm@gmail.com
push dateTue, 01 Apr 2014 20:44:18 +0000
treeherdermozilla-central@0ff6afce0133 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs984271
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 984271 part.4 Move the all other stuff in EventStateManager.cpp into mozilla:: namespace r=smaug
dom/events/EventStateManager.cpp
--- a/dom/events/EventStateManager.cpp
+++ b/dom/events/EventStateManager.cpp
@@ -86,18 +86,19 @@
 #include "mozilla/LookAndFeel.h"
 #include "GeckoProfiler.h"
 #include "Units.h"
 
 #ifdef XP_MACOSX
 #import <ApplicationServices/ApplicationServices.h>
 #endif
 
-using namespace mozilla;
-using namespace mozilla::dom;
+namespace mozilla {
+
+using namespace dom;
 
 //#define DEBUG_DOCSHELL_FOCUS
 
 #define NS_USER_INTERACTION_INTERVAL 5000 // ms
 
 static const LayoutDeviceIntPoint kInvalidRefPoint = LayoutDeviceIntPoint(-1,-1);
 
 static uint32_t gMouseOrKeyboardEventCounter = 0;
@@ -166,32 +167,50 @@ PrintDocTreeAll(nsIDocShellTreeItem* aIt
       break;
     item = parent;
   }
 
   PrintDocTree(item, 0);
 }
 #endif
 
-class nsUITimerCallback MOZ_FINAL : public nsITimerCallback
+// mask values for ui.key.chromeAccess and ui.key.contentAccess
+#define NS_MODIFIER_SHIFT    1
+#define NS_MODIFIER_CONTROL  2
+#define NS_MODIFIER_ALT      4
+#define NS_MODIFIER_META     8
+#define NS_MODIFIER_OS       16
+
+static nsIDocument *
+GetDocumentFromWindow(nsIDOMWindow *aWindow)
+{
+  nsCOMPtr<nsPIDOMWindow> win = do_QueryInterface(aWindow);
+  return win ? win->GetExtantDoc() : nullptr;
+}
+
+/******************************************************************/
+/* mozilla::UITimerCallback                                       */
+/******************************************************************/
+
+class UITimerCallback MOZ_FINAL : public nsITimerCallback
 {
 public:
-  nsUITimerCallback() : mPreviousCount(0) {}
+  UITimerCallback() : mPreviousCount(0) {}
   NS_DECL_ISUPPORTS
   NS_DECL_NSITIMERCALLBACK
 private:
   uint32_t mPreviousCount;
 };
 
-NS_IMPL_ISUPPORTS1(nsUITimerCallback, nsITimerCallback)
+NS_IMPL_ISUPPORTS1(UITimerCallback, nsITimerCallback)
 
 // If aTimer is nullptr, this method always sends "user-interaction-inactive"
 // notification.
 NS_IMETHODIMP
-nsUITimerCallback::Notify(nsITimer* aTimer)
+UITimerCallback::Notify(nsITimer* aTimer)
 {
   nsCOMPtr<nsIObserverService> obs =
     mozilla::services::GetObserverService();
   if (!obs)
     return NS_ERROR_FAILURE;
   if ((gMouseOrKeyboardEventCounter == mPreviousCount) || !aTimer) {
     gMouseOrKeyboardEventCounter = 0;
     obs->NotifyObservers(nullptr, "user-interaction-inactive", nullptr);
@@ -202,36 +221,20 @@ nsUITimerCallback::Notify(nsITimer* aTim
   } else {
     obs->NotifyObservers(nullptr, "user-interaction-active", nullptr);
     EventStateManager::UpdateUserActivityTimer();
   }
   mPreviousCount = gMouseOrKeyboardEventCounter;
   return NS_OK;
 }
 
-// mask values for ui.key.chromeAccess and ui.key.contentAccess
-#define NS_MODIFIER_SHIFT    1
-#define NS_MODIFIER_CONTROL  2
-#define NS_MODIFIER_ALT      4
-#define NS_MODIFIER_META     8
-#define NS_MODIFIER_OS       16
-
-static nsIDocument *
-GetDocumentFromWindow(nsIDOMWindow *aWindow)
-{
-  nsCOMPtr<nsPIDOMWindow> win = do_QueryInterface(aWindow);
-  return win ? win->GetExtantDoc() : nullptr;
-}
-
 /******************************************************************/
 /* mozilla::OverOutElementsWrapper                                */
 /******************************************************************/
 
-namespace mozilla {
-
 OverOutElementsWrapper::OverOutElementsWrapper()
   : mLastOverFrame(nullptr)
 {
 }
 
 OverOutElementsWrapper::~OverOutElementsWrapper()
 {
 }
@@ -283,17 +286,17 @@ EventStateManager::EventStateManager()
   , mGestureDownPoint(0,0)
   , mPresContext(nullptr)
   , mLClickCount(0)
   , mMClickCount(0)
   , mRClickCount(0)
   , m_haveShutdown(false)
 {
   if (sESMInstanceCount == 0) {
-    gUserInteractionTimerCallback = new nsUITimerCallback();
+    gUserInteractionTimerCallback = new UITimerCallback();
     if (gUserInteractionTimerCallback)
       NS_ADDREF(gUserInteractionTimerCallback);
     UpdateUserActivityTimer();
   }
   ++sESMInstanceCount;
 }
 
 nsresult