Bug 1210585 - Fix parameter names; r=me
authorJim Chen <nchen@mozilla.com>
Thu, 22 Oct 2015 17:45:46 -0400
changeset 269120 f580afacaa7aded487c709b20293d1b88b2acee4
parent 269119 ed18e273554dc11a4bd7ece904a83c61b4b47294
child 269121 adc70fa9aa35e2370aad1b9c8554553f557648d1
push id29572
push usercbook@mozilla.com
push dateFri, 23 Oct 2015 09:34:20 +0000
treeherdermozilla-central@0625c68c0abc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs1210585
milestone44.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 1210585 - Fix parameter names; r=me
widget/android/nsWindow.cpp
--- a/widget/android/nsWindow.cpp
+++ b/widget/android/nsWindow.cpp
@@ -162,87 +162,87 @@ class nsWindow::Natives final
 
 public:
     typedef GeckoView::Window::Natives<Natives> Base;
     typedef GeckoEditable::Natives<Natives> EditableBase;
 
     MOZ_DECLARE_WEAKREFERENCE_TYPENAME(Natives);
 
     template<typename Functor>
-    static void OnNativeCall(Functor&& call)
+    static void OnNativeCall(Functor&& aCall)
     {
-        if (call.IsTarget(&Open) && NS_IsMainThread()) {
+        if (aCall.IsTarget(&Open) && NS_IsMainThread()) {
             // Gecko state probably just switched to PROFILE_READY, and the
             // event loop is not running yet. Skip the event loop here so we
             // can get a head start on opening our window.
-            return call();
+            return aCall();
         }
-        return UsesGeckoThreadProxy::OnNativeCall(mozilla::Move(call));
+        return UsesGeckoThreadProxy::OnNativeCall(mozilla::Move(aCall));
     }
 
-    Natives(nsWindow* w) : window(*w) {}
+    Natives(nsWindow* aWindow) : window(*aWindow) {}
     ~Natives();
 
     /**
      * GeckoView methods
      */
     // Detach and destroy the window that we created in Open().
-    void DisposeNative(const GeckoView::Window::LocalRef& instance);
+    void DisposeNative(const GeckoView::Window::LocalRef& aInstance);
 
     // Create and attach a window.
-    static void Open(const jni::ClassObject::LocalRef& cls,
-                     GeckoView::Window::Param gvWindow,
-                     GeckoView::Param view,
-                     int32_t width, int32_t height);
+    static void Open(const jni::ClassObject::LocalRef& aCls,
+                     GeckoView::Window::Param aWindow,
+                     GeckoView::Param aView,
+                     int32_t aWidth, int32_t aHeight);
 
     // Set the active layer client object
-    static void SetLayerClient(jni::Object::Param client)
+    static void SetLayerClient(jni::Object::Param aClient)
     {
         MOZ_ASSERT(NS_IsMainThread());
         AndroidBridge::Bridge()->SetLayerClient(
-                widget::GeckoLayerClient::Ref::From(client.Get()));
+                widget::GeckoLayerClient::Ref::From(aClient.Get()));
     }
 
     /**
      * GeckoEditable methods
      */
     // Handle an Android KeyEvent.
-    void OnKeyEvent(int32_t action, int32_t keyCode, int32_t scanCode,
-                    int32_t metaState, int64_t time, int32_t unicodeChar,
-                    int32_t baseUnicodeChar, int32_t domPrintableKeyValue,
-                    int32_t repeatCount, int32_t flags,
-                    bool isSynthesizedImeKey);
+    void OnKeyEvent(int32_t aAction, int32_t aKeyCode, int32_t aScanCode,
+                    int32_t aMetaState, int64_t aTime, int32_t aUnicodeChar,
+                    int32_t aBaseUnicodeChar, int32_t aDomPrintableKeyValue,
+                    int32_t aRepeatCount, int32_t aFlags,
+                    bool aIsSynthesizedImeKey);
 };
 
 nsWindow::Natives::~Natives()
 {
     // Disassociate our GeckoEditable instance with our native object.
     MOZ_ASSERT(mEditable);
     EditableBase::DisposeNative(mEditable);
 }
 
 void
-nsWindow::Natives::Open(const jni::ClassObject::LocalRef& cls,
-                        GeckoView::Window::Param gvWindow,
-                        GeckoView::Param view,
-                        int32_t width, int32_t height)
+nsWindow::Natives::Open(const jni::ClassObject::LocalRef& aCls,
+                        GeckoView::Window::Param aWindow,
+                        GeckoView::Param aView,
+                        int32_t aWidth, int32_t aHeight)
 {
     MOZ_ASSERT(NS_IsMainThread());
 
     PROFILER_LABEL("nsWindow", "Natives::Open",
                    js::ProfileEntry::Category::OTHER);
 
     if (gGeckoViewWindow) {
         // Should have been created the first time.
         MOZ_ASSERT(gGeckoViewWindow->mNatives);
 
         // Associate our previous GeckoEditable with the new GeckoView.
-        gGeckoViewWindow->mEditable->OnViewChange(view);
-
-        Base::AttachNative(GeckoView::Window::LocalRef(cls.Env(), gvWindow),
+        gGeckoViewWindow->mEditable->OnViewChange(aView);
+
+        Base::AttachNative(GeckoView::Window::LocalRef(aCls.Env(), aWindow),
                            gGeckoViewWindow->mNatives.get());
         return;
     }
 
     nsCOMPtr<nsIWindowWatcher> ww = do_GetService(NS_WINDOWWATCHER_CONTRACTID);
     MOZ_ASSERT(ww);
 
     nsAdoptingCString url = Preferences::GetCString("toolkit.defaultChromeURI");
@@ -254,18 +254,18 @@ nsWindow::Natives::Open(const jni::Class
             = do_CreateInstance(NS_SUPPORTSARRAY_CONTRACTID);
     nsCOMPtr<nsISupportsPRInt32> widthArg
             = do_CreateInstance(NS_SUPPORTS_PRINT32_CONTRACTID);
     nsCOMPtr<nsISupportsPRInt32> heightArg
             = do_CreateInstance(NS_SUPPORTS_PRINT32_CONTRACTID);
 
     // Arguments are optional so it's okay if this fails.
     if (args && widthArg && heightArg &&
-            NS_SUCCEEDED(widthArg->SetData(width)) &&
-            NS_SUCCEEDED(heightArg->SetData(height)))
+            NS_SUCCEEDED(widthArg->SetData(aWidth)) &&
+            NS_SUCCEEDED(heightArg->SetData(aHeight)))
     {
         args->AppendElement(widthArg);
         args->AppendElement(heightArg);
     }
 
     nsCOMPtr<nsIDOMWindow> window;
     ww->OpenWindow(nullptr, url, "_blank", "chrome,dialog=no,all",
                    args, getter_AddRefs(window));
@@ -275,40 +275,40 @@ nsWindow::Natives::Open(const jni::Class
     MOZ_ASSERT(widget);
 
     gGeckoViewWindow = static_cast<nsWindow*>(widget.get());
     gGeckoViewWindow->mNatives = mozilla::MakeUnique<Natives>(gGeckoViewWindow);
 
     // Create GeckoEditable for the new nsWindow/GeckoView pair.
     GeckoEditable::LocalRef editable = GeckoEditable::New();
     EditableBase::AttachNative(editable, gGeckoViewWindow->mNatives.get());
-    editable->OnViewChange(view);
+    editable->OnViewChange(aView);
     gGeckoViewWindow->mEditable = editable;
 
-    Base::AttachNative(GeckoView::Window::LocalRef(cls.Env(), gvWindow),
+    Base::AttachNative(GeckoView::Window::LocalRef(aCls.Env(), aWindow),
                        gGeckoViewWindow->mNatives.get());
 }
 
 void
-nsWindow::Natives::DisposeNative(const GeckoView::Window::LocalRef& instance)
+nsWindow::Natives::DisposeNative(const GeckoView::Window::LocalRef& aInstance)
 {
     // FIXME: because we don't support separate nsWindow for each GeckoView
     // yet, we have to keep this window around in case another GeckoView
     // wants to attach.
     /*
     if (mWidgetListener) {
         nsCOMPtr<nsIXULWindow> xulWindow(mWidgetListener->GetXULWindow());
         // GeckoView-created top-level windows should be a XUL window.
         MOZ_ASSERT(xulWindow);
         nsCOMPtr<nsIBaseWindow> baseWindow(do_QueryInterface(xulWindow));
         MOZ_ASSERT(baseWindow);
         baseWindow->Destroy();
     }
     */
-    Base::DisposeNative(instance);
+    Base::DisposeNative(aInstance);
 }
 
 void
 nsWindow::InitNatives()
 {
     nsWindow::Natives::Base::Init();
     nsWindow::Natives::EditableBase::Init();
 }
@@ -1688,71 +1688,71 @@ InitKeyEvent(WidgetKeyboardEvent& event,
     }
 
     event.location =
         WidgetKeyboardEvent::ComputeLocationFromCodeValue(event.mCodeNameIndex);
     event.time = time;
 }
 
 void
-nsWindow::Natives::OnKeyEvent(int32_t action, int32_t keyCode, int32_t scanCode,
-                              int32_t metaState, int64_t time,
-                              int32_t unicodeChar, int32_t baseUnicodeChar,
-                              int32_t domPrintableKeyValue, int32_t repeatCount,
-                              int32_t flags, bool isSynthesizedImeKey)
+nsWindow::Natives::OnKeyEvent(int32_t aAction, int32_t aKeyCode,
+        int32_t aScanCode, int32_t aMetaState, int64_t aTime,
+        int32_t aUnicodeChar, int32_t aBaseUnicodeChar,
+        int32_t aDomPrintableKeyValue, int32_t aRepeatCount, int32_t aFlags,
+        bool aIsSynthesizedImeKey)
 {
     RefPtr<nsWindow> kungFuDeathGrip(&window);
     window.UserActivity();
     window.RemoveIMEComposition();
 
     EventMessage msg;
-    if (action == sdk::KeyEvent::ACTION_DOWN) {
+    if (aAction == sdk::KeyEvent::ACTION_DOWN) {
         msg = eKeyDown;
-    } else if (action == sdk::KeyEvent::ACTION_UP) {
+    } else if (aAction == sdk::KeyEvent::ACTION_UP) {
         msg = eKeyUp;
-    } else if (action == sdk::KeyEvent::ACTION_MULTIPLE) {
+    } else if (aAction == sdk::KeyEvent::ACTION_MULTIPLE) {
         // Keys with multiple action are handled in Java,
         // and we should never see one here
         MOZ_CRASH("Cannot handle key with multiple action");
     } else {
         ALOG("Unknown key action event!");
         return;
     }
 
     nsEventStatus status = nsEventStatus_eIgnore;
     WidgetKeyboardEvent event(true, msg, &window);
     window.InitEvent(event, nullptr);
-    InitKeyEvent(event, action, keyCode, scanCode, metaState, time,
-                 unicodeChar, baseUnicodeChar, domPrintableKeyValue,
-                 repeatCount, flags);
-
-    if (isSynthesizedImeKey) {
+    InitKeyEvent(event, aAction, aKeyCode, aScanCode, aMetaState, aTime,
+                 aUnicodeChar, aBaseUnicodeChar, aDomPrintableKeyValue,
+                 aRepeatCount, aFlags);
+
+    if (aIsSynthesizedImeKey) {
         // Keys synthesized by Java IME code are saved in the mIMEKeyEvents
         // array until the next IME_REPLACE_TEXT event, at which point
         // these keys are dispatched in sequence.
         window.mIMEKeyEvents.AppendElement(
                 mozilla::UniquePtr<WidgetEvent>(event.Duplicate()));
     } else {
         window.DispatchEvent(&event, status);
     }
 
     if (window.Destroyed() ||
             status == nsEventStatus_eConsumeNoDefault ||
-            msg != eKeyDown || IsModifierKey(keyCode)) {
+            msg != eKeyDown || IsModifierKey(aKeyCode)) {
         // Skip sending key press event.
         return;
     }
 
     WidgetKeyboardEvent pressEvent(true, eKeyPress, &window);
     window.InitEvent(pressEvent, nullptr);
-    InitKeyEvent(pressEvent, action, keyCode, scanCode, metaState, time,
-                 unicodeChar, baseUnicodeChar, domPrintableKeyValue,
-                 repeatCount, flags);
-
-    if (isSynthesizedImeKey) {
+    InitKeyEvent(pressEvent, aAction, aKeyCode, aScanCode, aMetaState, aTime,
+                 aUnicodeChar, aBaseUnicodeChar, aDomPrintableKeyValue,
+                 aRepeatCount, aFlags);
+
+    if (aIsSynthesizedImeKey) {
         window.mIMEKeyEvents.AppendElement(
                 mozilla::UniquePtr<WidgetEvent>(pressEvent.Duplicate()));
     } else {
         window.DispatchEvent(&pressEvent, status);
     }
 }
 
 #ifdef DEBUG_ANDROID_IME