Bug 1077559 - Rename APZCCallbackHandler to AndroidContentController. r=botond
authorKartikaya Gupta <kgupta@mozilla.com>
Fri, 24 Apr 2015 22:26:51 -0400
changeset 241072 ccd270cfe90bd2ee68a3865fcf1c06175f6f9f00
parent 241071 c78dde16ea78b466110c7c2fbee0600f9d373208
child 241073 94c2f1d254e7faf2d207b1ff227bb7549cdcedfe
push id28652
push usercbook@mozilla.com
push dateMon, 27 Apr 2015 10:00:58 +0000
treeherdermozilla-central@8aff0d2a7bc7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbotond
bugs1077559
milestone40.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 1077559 - Rename APZCCallbackHandler to AndroidContentController. r=botond
widget/android/APZCCallbackHandler.cpp
widget/android/APZCCallbackHandler.h
widget/android/AndroidContentController.cpp
widget/android/AndroidContentController.h
widget/android/AndroidJNI.cpp
widget/android/moz.build
widget/android/nsWindow.cpp
rename from widget/android/APZCCallbackHandler.cpp
rename to widget/android/AndroidContentController.cpp
--- a/widget/android/APZCCallbackHandler.cpp
+++ b/widget/android/AndroidContentController.cpp
@@ -1,57 +1,57 @@
 /* -*- Mode: c++; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#include "APZCCallbackHandler.h"
+#include "AndroidContentController.h"
 #include "mozilla/layers/APZCTreeManager.h"
 #include "base/message_loop.h"
 #include "nsWindow.h"
 #include "AndroidBridge.h"
 
 using mozilla::layers::APZCTreeManager;
 
 namespace mozilla {
 namespace widget {
 namespace android {
 
-NativePanZoomController::GlobalRef APZCCallbackHandler::sNativePanZoomController = nullptr;
+NativePanZoomController::GlobalRef AndroidContentController::sNativePanZoomController = nullptr;
 
 NativePanZoomController::LocalRef
-APZCCallbackHandler::SetNativePanZoomController(NativePanZoomController::Param obj)
+AndroidContentController::SetNativePanZoomController(NativePanZoomController::Param obj)
 {
     NativePanZoomController::LocalRef old = sNativePanZoomController;
     sNativePanZoomController = obj;
     return old;
 }
 
 void
-APZCCallbackHandler::NotifyDefaultPrevented(uint64_t aInputBlockId,
-                                            bool aDefaultPrevented)
+AndroidContentController::NotifyDefaultPrevented(uint64_t aInputBlockId,
+                                                 bool aDefaultPrevented)
 {
     if (!AndroidBridge::IsJavaUiThread()) {
         // The notification must reach the APZ on the Java UI thread (aka the
         // APZ "controller" thread) but we get it from the Gecko thread, so we
         // have to throw it onto the other thread.
         AndroidBridge::Bridge()->PostTaskToUiThread(NewRunnableFunction(
-            &APZCCallbackHandler::NotifyDefaultPrevented,
+            &AndroidContentController::NotifyDefaultPrevented,
             aInputBlockId, aDefaultPrevented), 0);
         return;
     }
 
     MOZ_ASSERT(AndroidBridge::IsJavaUiThread());
     APZCTreeManager* controller = nsWindow::GetAPZCTreeManager();
     if (controller) {
         controller->ContentReceivedInputBlock(aInputBlockId, aDefaultPrevented);
     }
 }
 
 void
-APZCCallbackHandler::PostDelayedTask(Task* aTask, int aDelayMs)
+AndroidContentController::PostDelayedTask(Task* aTask, int aDelayMs)
 {
     AndroidBridge::Bridge()->PostTaskToUiThread(aTask, aDelayMs);
 }
 
 } // namespace android
 } // namespace widget
 } // namespace mozilla
rename from widget/android/APZCCallbackHandler.h
rename to widget/android/AndroidContentController.h
--- a/widget/android/APZCCallbackHandler.h
+++ b/widget/android/AndroidContentController.h
@@ -1,33 +1,33 @@
 /* -*- Mode: c++; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#ifndef APZCCallbackHandler_h__
-#define APZCCallbackHandler_h__
+#ifndef AndroidContentController_h__
+#define AndroidContentController_h__
 
 #include "mozilla/layers/ChromeProcessController.h"
 #include "mozilla/layers/APZEventState.h"
 #include "mozilla/EventForwards.h"  // for Modifiers
 #include "mozilla/StaticPtr.h"
 #include "mozilla/TimeStamp.h"
 #include "GeneratedJNIWrappers.h"
 #include "nsIDOMWindowUtils.h"
 #include "nsTArray.h"
 
 namespace mozilla {
 namespace widget {
 namespace android {
 
-class APZCCallbackHandler final : public mozilla::layers::ChromeProcessController
+class AndroidContentController final : public mozilla::layers::ChromeProcessController
 {
 public:
-    APZCCallbackHandler(nsIWidget* aWidget, mozilla::layers::APZEventState* aAPZEventState)
+    AndroidContentController(nsIWidget* aWidget, mozilla::layers::APZEventState* aAPZEventState)
       : mozilla::layers::ChromeProcessController(aWidget, aAPZEventState)
     {}
 
     // ChromeProcessController methods
     void PostDelayedTask(Task* aTask, int aDelayMs) override;
 
 public:
     static NativePanZoomController::LocalRef SetNativePanZoomController(NativePanZoomController::Param obj);
--- a/widget/android/AndroidJNI.cpp
+++ b/widget/android/AndroidJNI.cpp
@@ -3,18 +3,18 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/Hal.h"
 #include "nsIFile.h"
 #include "nsString.h"
 
 #include "AndroidBridge.h"
+#include "AndroidContentController.h"
 #include "AndroidGraphicBuffer.h"
-#include "APZCCallbackHandler.h"
 
 #include <jni.h>
 #include <pthread.h>
 #include <dlfcn.h>
 #include <stdio.h>
 #include <unistd.h>
 
 #include "nsAppShell.h"
@@ -919,17 +919,17 @@ NS_EXPORT void JNICALL
 Java_org_mozilla_gecko_gfx_NativePanZoomController_init(JNIEnv* env, jobject instance)
 {
     if (!AndroidBridge::Bridge()) {
         return;
     }
 
     const auto& newRef = NativePanZoomController::Ref::From(instance);
     NativePanZoomController::LocalRef oldRef =
-            APZCCallbackHandler::SetNativePanZoomController(newRef);
+            AndroidContentController::SetNativePanZoomController(newRef);
 
     MOZ_ASSERT(!oldRef, "Registering a new NPZC when we already have one");
 }
 
 NS_EXPORT jboolean JNICALL
 Java_org_mozilla_gecko_gfx_NativePanZoomController_handleTouchEvent(JNIEnv* env, jobject instance, jobject event)
 {
     APZCTreeManager *controller = nsWindow::GetAPZCTreeManager();
@@ -963,17 +963,17 @@ Java_org_mozilla_gecko_gfx_NativePanZoom
 NS_EXPORT void JNICALL
 Java_org_mozilla_gecko_gfx_NativePanZoomController_destroy(JNIEnv* env, jobject instance)
 {
     if (!AndroidBridge::Bridge()) {
         return;
     }
 
     NativePanZoomController::LocalRef oldRef =
-            APZCCallbackHandler::SetNativePanZoomController(nullptr);
+            AndroidContentController::SetNativePanZoomController(nullptr);
 
     MOZ_ASSERT(oldRef, "Clearing a non-existent NPZC");
 }
 
 NS_EXPORT jboolean JNICALL
 Java_org_mozilla_gecko_gfx_NativePanZoomController_getRedrawHint(JNIEnv* env, jobject instance)
 {
     // FIXME implement this
--- a/widget/android/moz.build
+++ b/widget/android/moz.build
@@ -19,22 +19,22 @@ EXPORTS += [
     'AndroidBridge.h',
     'AndroidJavaWrappers.h',
     'AndroidJNIWrapper.h',
     'GeneratedJNIWrappers.h',
 ]
 
 SOURCES += [
     'AndroidBridge.cpp',
+    'AndroidContentController.cpp',
     'AndroidDirectTexture.cpp',
     'AndroidGraphicBuffer.cpp',
     'AndroidJavaWrappers.cpp',
     'AndroidJNI.cpp',
     'AndroidJNIWrapper.cpp',
-    'APZCCallbackHandler.cpp',
     'GeneratedJNIWrappers.cpp',
     'GfxInfo.cpp',
     'NativeJSContainer.cpp',
     'nsAndroidProtocolHandler.cpp',
     'nsAppShell.cpp',
     'nsClipboard.cpp',
     'nsDeviceContextAndroid.cpp',
     'nsIdleServiceAndroid.cpp',
--- a/widget/android/nsWindow.cpp
+++ b/widget/android/nsWindow.cpp
@@ -46,17 +46,17 @@ using mozilla::unused;
 #include "mozilla/layers/LayerManagerComposite.h"
 #include "mozilla/layers/AsyncCompositionManager.h"
 #include "mozilla/layers/APZCTreeManager.h"
 #include "mozilla/layers/APZThreadUtils.h"
 #include "GLContext.h"
 #include "GLContextProvider.h"
 #include "ScopedGLHelpers.h"
 #include "mozilla/layers/CompositorOGL.h"
-#include "APZCCallbackHandler.h"
+#include "AndroidContentController.h"
 
 #include "nsTArray.h"
 
 #include "AndroidBridge.h"
 #include "AndroidBridgeUtilities.h"
 #include "android_npapi.h"
 
 #include "imgIEncoder.h"
@@ -1072,30 +1072,30 @@ bool nsWindow::OnMultitouchEvent(Android
     // if the last event we got was a down event, then by now we know for sure whether
     // this block has been default-prevented or not. if we haven't already sent the
     // notification for this block, do so now.
     if (sLastWasDownEvent && !sDefaultPreventedNotified) {
         // if this event is a down event, that means it's the start of a new block, and the
         // previous block should not be default-prevented
         bool defaultPrevented = isDownEvent ? false : preventDefaultActions;
         if (ae->Type() == AndroidGeckoEvent::APZ_INPUT_EVENT) {
-            widget::android::APZCCallbackHandler::NotifyDefaultPrevented(ae->ApzInputBlockId(), defaultPrevented);
+            widget::android::AndroidContentController::NotifyDefaultPrevented(ae->ApzInputBlockId(), defaultPrevented);
         } else {
             GeckoAppShell::NotifyDefaultPrevented(defaultPrevented);
         }
         sDefaultPreventedNotified = true;
     }
 
     // now, if this event is a down event, then we might already know that it has been
     // default-prevented. if so, we send the notification right away; otherwise we wait
     // for the next event.
     if (isDownEvent) {
         if (preventDefaultActions) {
             if (ae->Type() == AndroidGeckoEvent::APZ_INPUT_EVENT) {
-                widget::android::APZCCallbackHandler::NotifyDefaultPrevented(ae->ApzInputBlockId(), true);
+                widget::android::AndroidContentController::NotifyDefaultPrevented(ae->ApzInputBlockId(), true);
             } else {
                 GeckoAppShell::NotifyDefaultPrevented(true);
             }
             sDefaultPreventedNotified = true;
         } else {
             sDefaultPreventedNotified = false;
         }
     }
@@ -2487,17 +2487,17 @@ void
 nsWindow::ConfigureAPZControllerThread()
 {
     APZThreadUtils::SetControllerThread(nullptr);
 }
 
 already_AddRefed<GeckoContentController>
 nsWindow::CreateRootContentController()
 {
-    nsRefPtr<GeckoContentController> controller = new widget::android::APZCCallbackHandler(this, mAPZEventState);
+    nsRefPtr<GeckoContentController> controller = new widget::android::AndroidContentController(this, mAPZEventState);
     return controller.forget();
 }
 
 uint64_t
 nsWindow::RootLayerTreeId()
 {
     MOZ_ASSERT(sCompositorParent);
     return sCompositorParent->RootLayerTreeId();