Bug 1162771 - Rename gCaptureTouchList to sCaptureTouchList. r=smaug
authorKartikaya Gupta <kgupta@mozilla.com>
Thu, 18 Aug 2016 07:13:29 -0400
changeset 310096 e2eed81cdcffe3157070b070e03c20d1c2468710
parent 310095 47b7bf339876337b4b9d4ccb292b81d466c0d92d
child 310097 a92dc8fb77699da5fba12cc467b8ad8c6beb4ca3
push id30576
push userryanvm@gmail.com
push dateFri, 19 Aug 2016 13:53:39 +0000
treeherdermozilla-central@74f332c38a69 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1162771
milestone51.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 1162771 - Rename gCaptureTouchList to sCaptureTouchList. r=smaug MozReview-Commit-ID: 68HvuKZSZ8D
layout/base/TouchManager.cpp
layout/base/TouchManager.h
--- a/layout/base/TouchManager.cpp
+++ b/layout/base/TouchManager.cpp
@@ -9,31 +9,31 @@
 
 #include "mozilla/dom/EventTarget.h"
 #include "nsIFrame.h"
 #include "nsPresShell.h"
 #include "nsView.h"
 
 namespace mozilla {
 
-nsRefPtrHashtable<nsUint32HashKey, dom::Touch>* TouchManager::gCaptureTouchList;
+nsRefPtrHashtable<nsUint32HashKey, dom::Touch>* TouchManager::sCaptureTouchList;
 
 /*static*/ void
 TouchManager::InitializeStatics()
 {
-  NS_ASSERTION(!gCaptureTouchList, "InitializeStatics called multiple times!");
-  gCaptureTouchList = new nsRefPtrHashtable<nsUint32HashKey, dom::Touch>;
+  NS_ASSERTION(!sCaptureTouchList, "InitializeStatics called multiple times!");
+  sCaptureTouchList = new nsRefPtrHashtable<nsUint32HashKey, dom::Touch>;
 }
 
 /*static*/ void
 TouchManager::ReleaseStatics()
 {
-  NS_ASSERTION(gCaptureTouchList, "ReleaseStatics called without Initialize!");
-  delete gCaptureTouchList;
-  gCaptureTouchList = nullptr;
+  NS_ASSERTION(sCaptureTouchList, "ReleaseStatics called without Initialize!");
+  delete sCaptureTouchList;
+  sCaptureTouchList = nullptr;
 }
 
 void
 TouchManager::Init(PresShell* aPresShell, nsIDocument* aDocument)
 {
   mPresShell = aPresShell;
   mDocument = aDocument;
 }
@@ -67,24 +67,24 @@ TouchManager::EvictTouchPoint(RefPtr<dom
             nsEventStatus status;
             widget->DispatchEvent(&event, status);
           }
         }
       }
     }
   }
   if (!node || !aLimitToDocument || node->OwnerDoc() == aLimitToDocument) {
-    gCaptureTouchList->Remove(aTouch->Identifier());
+    sCaptureTouchList->Remove(aTouch->Identifier());
   }
 }
 
 /*static*/ void
 TouchManager::AppendToTouchList(WidgetTouchEvent::TouchArray* aTouchList)
 {
-  for (auto iter = gCaptureTouchList->Iter();
+  for (auto iter = sCaptureTouchList->Iter();
        !iter.Done();
        iter.Next()) {
     RefPtr<dom::Touch>& touch = iter.Data();
     touch->mChanged = false;
     aTouchList->AppendElement(touch);
   }
 }
 
@@ -118,22 +118,22 @@ TouchManager::PreHandleEvent(WidgetEvent
         for (uint32_t i = 0; i < touches.Length(); ++i) {
           EvictTouchPoint(touches[i]);
         }
       }
       // Add any new touches to the queue
       for (uint32_t i = 0; i < touchEvent->mTouches.Length(); ++i) {
         dom::Touch* touch = touchEvent->mTouches[i];
         int32_t id = touch->Identifier();
-        if (!gCaptureTouchList->Get(id, nullptr)) {
+        if (!sCaptureTouchList->Get(id, nullptr)) {
           // If it is not already in the queue, it is a new touch
           touch->mChanged = true;
         }
         touch->mMessage = aEvent->mMessage;
-        gCaptureTouchList->Put(id, touch);
+        sCaptureTouchList->Put(id, touch);
       }
       break;
     }
     case eTouchMove: {
       // Check for touches that changed. Mark them add to queue
       WidgetTouchEvent* touchEvent = aEvent->AsTouchEvent();
       WidgetTouchEvent::TouchArray& touches = touchEvent->mTouches;
       bool haveChanged = false;
@@ -141,34 +141,34 @@ TouchManager::PreHandleEvent(WidgetEvent
         --i;
         dom::Touch* touch = touches[i];
         if (!touch) {
           continue;
         }
         int32_t id = touch->Identifier();
         touch->mMessage = aEvent->mMessage;
 
-        RefPtr<dom::Touch> oldTouch = gCaptureTouchList->GetWeak(id);
+        RefPtr<dom::Touch> oldTouch = sCaptureTouchList->GetWeak(id);
         if (!oldTouch) {
           touches.RemoveElementAt(i);
           continue;
         }
         if (!touch->Equals(oldTouch)) {
           touch->mChanged = true;
           haveChanged = true;
         }
 
         nsCOMPtr<dom::EventTarget> targetPtr = oldTouch->mTarget;
         if (!targetPtr) {
           touches.RemoveElementAt(i);
           continue;
         }
         touch->SetTarget(targetPtr);
 
-        gCaptureTouchList->Put(id, touch);
+        sCaptureTouchList->Put(id, touch);
         // if we're moving from touchstart to touchmove for this touch
         // we allow preventDefault to prevent mouse events
         if (oldTouch->mMessage != touch->mMessage) {
           aTouchIsNew = true;
         }
       }
       // is nothing has changed, we should just return
       if (!haveChanged) {
@@ -204,62 +204,62 @@ TouchManager::PreHandleEvent(WidgetEvent
         dom::Touch* touch = touches[i];
         if (!touch) {
           continue;
         }
         touch->mMessage = aEvent->mMessage;
         touch->mChanged = true;
 
         int32_t id = touch->Identifier();
-        RefPtr<dom::Touch> oldTouch = gCaptureTouchList->GetWeak(id);
+        RefPtr<dom::Touch> oldTouch = sCaptureTouchList->GetWeak(id);
         if (!oldTouch) {
           continue;
         }
         nsCOMPtr<EventTarget> targetPtr = oldTouch->mTarget;
 
         aCurrentEventContent = do_QueryInterface(targetPtr);
         touch->SetTarget(targetPtr);
-        gCaptureTouchList->Remove(id);
+        sCaptureTouchList->Remove(id);
       }
       // add any touches left in the touch list, but ensure changed=false
       AppendToTouchList(&touches);
       break;
     }
     default:
       break;
   }
   return true;
 }
 
 /*static*/ already_AddRefed<nsIContent>
 TouchManager::GetAnyCapturedTouchTarget()
 {
   nsCOMPtr<nsIContent> result = nullptr;
-  if (gCaptureTouchList->Count() == 0) {
+  if (sCaptureTouchList->Count() == 0) {
     return result.forget();
   }
-  for (auto iter = gCaptureTouchList->Iter(); !iter.Done(); iter.Next()) {
+  for (auto iter = sCaptureTouchList->Iter(); !iter.Done(); iter.Next()) {
     RefPtr<dom::Touch>& touch = iter.Data();
     if (touch) {
       dom::EventTarget* target = touch->GetTarget();
       if (target) {
         result = do_QueryInterface(target);
         break;
       }
     }
   }
   return result.forget();
 }
 
 /*static*/ bool
 TouchManager::HasCapturedTouch(int32_t aId)
 {
-  return gCaptureTouchList->Contains(aId);
+  return sCaptureTouchList->Contains(aId);
 }
 
 /*static*/ already_AddRefed<dom::Touch>
 TouchManager::GetCapturedTouch(int32_t aId)
 {
-  RefPtr<dom::Touch> touch = gCaptureTouchList->GetWeak(aId);
+  RefPtr<dom::Touch> touch = sCaptureTouchList->GetWeak(aId);
   return touch.forget();
 }
 
 } // namespace mozilla
--- a/layout/base/TouchManager.h
+++ b/layout/base/TouchManager.h
@@ -45,14 +45,14 @@ private:
   void EvictTouches();
   static void EvictTouchPoint(RefPtr<dom::Touch>& aTouch,
                               nsIDocument* aLimitToDocument = nullptr);
   static void AppendToTouchList(WidgetTouchEvent::TouchArray* aTouchList);
 
   RefPtr<PresShell>   mPresShell;
   nsCOMPtr<nsIDocument> mDocument;
 
-  static nsRefPtrHashtable<nsUint32HashKey, mozilla::dom::Touch>* gCaptureTouchList;
+  static nsRefPtrHashtable<nsUint32HashKey, mozilla::dom::Touch>* sCaptureTouchList;
 };
 
 } // namespace mozilla
 
 #endif /* !defined(TouchManager_h_) */