Bug 1416310 - 5. Remove GeckoLayerClient.java and update generated bindings; r=jchen
authorJim Chen <nchen@mozilla.com>
Mon, 20 Nov 2017 17:17:02 -0500
changeset 437350 bc5cc9edd496d21585338cb90e5a025bb57281ff
parent 437349 dd54872af9e74fa04114f817a5eeef2d886e6e72
child 437351 23fbfd83e957ed08174aa8eefd2ba8e3b2e1e2c7
push id117
push userfmarier@mozilla.com
push dateTue, 28 Nov 2017 20:17:16 +0000
reviewersjchen
bugs1416310
milestone59.0a1
Bug 1416310 - 5. Remove GeckoLayerClient.java and update generated bindings; r=jchen Remove GeckoLayerClient.java since it's no longer used, and update auto-generated JNI bindings. r=me for trivial patch. MozReview-Commit-ID: CiNPLLkh3VJ
mobile/android/base/moz.build
mobile/android/geckoview/src/main/java/org/mozilla/gecko/gfx/GeckoLayerClient.java
widget/android/GeneratedJNIWrappers.cpp
widget/android/GeneratedJNIWrappers.h
--- a/mobile/android/base/moz.build
+++ b/mobile/android/base/moz.build
@@ -393,17 +393,16 @@ gvjar.sources += [geckoview_source_dir +
     'GeckoVRManager.java',
     'gfx/BitmapUtils.java',
     'gfx/BufferedImage.java',
     'gfx/BufferedImageGLInfo.java',
     'gfx/DynamicToolbarAnimator.java',
     'gfx/FloatSize.java',
     'gfx/FullScreenState.java',
     'gfx/GeckoDisplay.java',
-    'gfx/GeckoLayerClient.java',
     'gfx/GeckoSurface.java',
     'gfx/GeckoSurfaceTexture.java',
     'gfx/ImmutableViewportMetrics.java',
     'gfx/IntSize.java',
     'gfx/LayerSession.java',
     'gfx/LayerView.java',
     'gfx/NativePanZoomController.java',
     'gfx/Overscroll.java',
deleted file mode 100644
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/gfx/GeckoLayerClient.java
+++ /dev/null
@@ -1,375 +0,0 @@
-/* -*- Mode: Java; 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/. */
-
-package org.mozilla.gecko.gfx;
-
-import org.mozilla.gecko.annotation.RobocopTarget;
-import org.mozilla.gecko.annotation.WrapForJNI;
-import org.mozilla.gecko.util.GeckoBundle;
-
-import android.graphics.Color;
-import android.graphics.Matrix;
-import android.graphics.PointF;
-import android.graphics.RectF;
-import android.os.SystemClock;
-import android.util.Log;
-import android.view.InputDevice;
-import android.view.MotionEvent;
-
-import java.util.ArrayList;
-
-class GeckoLayerClient implements LayerView.Listener
-{
-    private static final String LOGTAG = "GeckoLayerClient";
-
-    private IntSize mWindowSize;
-
-    private boolean mForceRedraw;
-
-    /* The current viewport metrics.
-     * This is volatile so that we can read and write to it from different threads.
-     * We avoid synchronization to make getting the viewport metrics from
-     * the compositor as cheap as possible. The viewport is immutable so
-     * we don't need to worry about anyone mutating it while we're reading from it.
-     * Specifically:
-     * 1) reading mViewportMetrics from any thread is fine without synchronization
-     * 2) writing to mViewportMetrics requires synchronizing on the layer controller object
-     * 3) whenever reading multiple fields from mViewportMetrics without synchronization (i.e. in
-     *    case 1 above) you should always first grab a local copy of the reference, and then use
-     *    that because mViewportMetrics might get reassigned in between reading the different
-     *    fields. */
-    private volatile ImmutableViewportMetrics mViewportMetrics;
-
-    private final PanZoomController mPanZoomController;
-    private final DynamicToolbarAnimator mToolbarAnimator;
-    private final LayerView mView;
-
-    /* This flag is true from the time that browser.js detects a first-paint is about to start,
-     * to the time that we receive the first-paint composite notification from the compositor.
-     * Note that there is a small race condition with this; if there are two paints that both
-     * have the first-paint flag set, and the second paint happens concurrently with the
-     * composite for the first paint, then this flag may be set to true prematurely. Fixing this
-     * is possible but risky; see https://bugzilla.mozilla.org/show_bug.cgi?id=797615#c751
-     */
-    private volatile boolean mContentDocumentIsDisplayed;
-
-    private SynthesizedEventState mPointerState;
-
-    public GeckoLayerClient(LayerView view) {
-        // we can fill these in with dummy values because they are always written
-        // to before being read
-        mWindowSize = new IntSize(0, 0);
-
-        mForceRedraw = true;
-        mViewportMetrics = new ImmutableViewportMetrics()
-                           .setViewportSize(view.getWidth(), view.getHeight());
-
-        mToolbarAnimator = new DynamicToolbarAnimator(this);
-        mPanZoomController = PanZoomController.Factory.create(view);
-        mView = view;
-        mView.setListener(this);
-        mContentDocumentIsDisplayed = true;
-    }
-
-    public void setOverscrollHandler(final Overscroll listener) {
-        mPanZoomController.setOverscrollHandler(listener);
-    }
-
-    public void destroy() {
-        mPanZoomController.destroy();
-    }
-
-    public LayerView getView() {
-        return mView;
-    }
-
-    public FloatSize getViewportSize() {
-        return mViewportMetrics.getSize();
-    }
-
-    /**
-     * The view calls this function to indicate that the viewport changed size. It must hold the
-     * monitor while calling it.
-     *
-     * TODO: Refactor this to use an interface. Expose that interface only to the view and not
-     * to the layer client. That way, the layer client won't be tempted to call this, which might
-     * result in an infinite loop.
-     */
-    boolean setViewportSize(int width, int height) {
-        if (mViewportMetrics.viewportRectWidth == width &&
-            mViewportMetrics.viewportRectHeight == height) {
-            return false;
-        }
-        mViewportMetrics = mViewportMetrics.setViewportSize(width, height);
-        return true;
-    }
-
-    PanZoomController getPanZoomController() {
-        return mPanZoomController;
-    }
-
-    DynamicToolbarAnimator getDynamicToolbarAnimator() {
-        return mToolbarAnimator;
-    }
-
-    @WrapForJNI(calledFrom = "gecko")
-    void contentDocumentChanged() {
-        mContentDocumentIsDisplayed = false;
-    }
-
-    @WrapForJNI(calledFrom = "gecko")
-    boolean isContentDocumentDisplayed() {
-        return mContentDocumentIsDisplayed;
-    }
-
-    /** The compositor invokes this function just before compositing a frame where the document
-      * is different from the document composited on the last frame. In these cases, the viewport
-      * information we have in Java is no longer valid and needs to be replaced with the new
-      * viewport information provided.
-      */
-    @WrapForJNI(calledFrom = "ui")
-    public void updateRootFrameMetrics(float scrollX, float scrollY, float zoom) {
-        mViewportMetrics = mViewportMetrics.setViewportOrigin(scrollX, scrollY)
-            .setZoomFactor(zoom);
-
-        mToolbarAnimator.onMetricsChanged(mViewportMetrics);
-        mContentDocumentIsDisplayed = true;
-    }
-
-    private static class PointerInfo {
-        // We reserve one pointer ID for the mouse, so that tests don't have
-        // to worry about tracking pointer IDs if they just want to test mouse
-        // event synthesization. If somebody tries to use this ID for a
-        // synthesized touch event we'll throw an exception.
-        public static final int RESERVED_MOUSE_POINTER_ID = 100000;
-
-        public int pointerId;
-        public int source;
-        public int screenX;
-        public int screenY;
-        public double pressure;
-        public int orientation;
-
-        public MotionEvent.PointerCoords getCoords() {
-            MotionEvent.PointerCoords coords = new MotionEvent.PointerCoords();
-            coords.orientation = orientation;
-            coords.pressure = (float)pressure;
-            coords.x = screenX;
-            coords.y = screenY;
-            return coords;
-        }
-    }
-
-    private static class SynthesizedEventState {
-        public final ArrayList<PointerInfo> pointers;
-        public long downTime;
-
-        SynthesizedEventState() {
-            pointers = new ArrayList<PointerInfo>();
-        }
-
-        int getPointerIndex(int pointerId) {
-            for (int i = 0; i < pointers.size(); i++) {
-                if (pointers.get(i).pointerId == pointerId) {
-                    return i;
-                }
-            }
-            return -1;
-        }
-
-        int addPointer(int pointerId, int source) {
-            PointerInfo info = new PointerInfo();
-            info.pointerId = pointerId;
-            info.source = source;
-            pointers.add(info);
-            return pointers.size() - 1;
-        }
-
-        int getPointerCount(int source) {
-            int count = 0;
-            for (int i = 0; i < pointers.size(); i++) {
-                if (pointers.get(i).source == source) {
-                    count++;
-                }
-            }
-            return count;
-        }
-
-        MotionEvent.PointerProperties[] getPointerProperties(int source) {
-            MotionEvent.PointerProperties[] props = new MotionEvent.PointerProperties[getPointerCount(source)];
-            int index = 0;
-            for (int i = 0; i < pointers.size(); i++) {
-                if (pointers.get(i).source == source) {
-                    MotionEvent.PointerProperties p = new MotionEvent.PointerProperties();
-                    p.id = pointers.get(i).pointerId;
-                    switch (source) {
-                        case InputDevice.SOURCE_TOUCHSCREEN:
-                            p.toolType = MotionEvent.TOOL_TYPE_FINGER;
-                            break;
-                        case InputDevice.SOURCE_MOUSE:
-                            p.toolType = MotionEvent.TOOL_TYPE_MOUSE;
-                            break;
-                    }
-                    props[index++] = p;
-                }
-            }
-            return props;
-        }
-
-        MotionEvent.PointerCoords[] getPointerCoords(int source) {
-            MotionEvent.PointerCoords[] coords = new MotionEvent.PointerCoords[getPointerCount(source)];
-            int index = 0;
-            for (int i = 0; i < pointers.size(); i++) {
-                if (pointers.get(i).source == source) {
-                    coords[index++] = pointers.get(i).getCoords();
-                }
-            }
-            return coords;
-        }
-    }
-
-    private void synthesizeNativePointer(int source, int pointerId,
-            int eventType, int screenX, int screenY, double pressure,
-            int orientation)
-    {
-        Log.d(LOGTAG, "Synthesizing pointer from " + source + " id " + pointerId + " at " + screenX + ", " + screenY);
-
-        final int[] origin = new int[2];
-        mView.getLocationOnScreen(origin);
-        screenX -= origin[0];
-        screenY -= origin[1];
-
-        if (mPointerState == null) {
-            mPointerState = new SynthesizedEventState();
-        }
-
-        // Find the pointer if it already exists
-        int pointerIndex = mPointerState.getPointerIndex(pointerId);
-
-        // Event-specific handling
-        switch (eventType) {
-            case MotionEvent.ACTION_POINTER_UP:
-                if (pointerIndex < 0) {
-                    Log.d(LOGTAG, "Requested synthesis of a pointer-up for a pointer that doesn't exist!");
-                    return;
-                }
-                if (mPointerState.pointers.size() == 1) {
-                    // Last pointer is going up
-                    eventType = MotionEvent.ACTION_UP;
-                }
-                break;
-            case MotionEvent.ACTION_CANCEL:
-                if (pointerIndex < 0) {
-                    Log.d(LOGTAG, "Requested synthesis of a pointer-cancel for a pointer that doesn't exist!");
-                    return;
-                }
-                break;
-            case MotionEvent.ACTION_POINTER_DOWN:
-                if (pointerIndex < 0) {
-                    // Adding a new pointer
-                    pointerIndex = mPointerState.addPointer(pointerId, source);
-                    if (pointerIndex == 0) {
-                        // first pointer
-                        eventType = MotionEvent.ACTION_DOWN;
-                        mPointerState.downTime = SystemClock.uptimeMillis();
-                    }
-                } else {
-                    // We're moving an existing pointer
-                    eventType = MotionEvent.ACTION_MOVE;
-                }
-                break;
-            case MotionEvent.ACTION_HOVER_MOVE:
-                if (pointerIndex < 0) {
-                    // Mouse-move a pointer without it going "down". However
-                    // in order to send the right MotionEvent without a lot of
-                    // duplicated code, we add the pointer to mPointerState,
-                    // and then remove it at the bottom of this function.
-                    pointerIndex = mPointerState.addPointer(pointerId, source);
-                } else {
-                    // We're moving an existing mouse pointer that went down.
-                    eventType = MotionEvent.ACTION_MOVE;
-                }
-                break;
-        }
-
-        // Update the pointer with the new info
-        PointerInfo info = mPointerState.pointers.get(pointerIndex);
-        info.screenX = screenX;
-        info.screenY = screenY;
-        info.pressure = pressure;
-        info.orientation = orientation;
-
-        // Dispatch the event
-        int action = 0;
-        if (eventType == MotionEvent.ACTION_POINTER_DOWN ||
-            eventType == MotionEvent.ACTION_POINTER_UP) {
-            // for pointer-down and pointer-up events we need to add the
-            // index of the relevant pointer.
-            action = (pointerIndex << MotionEvent.ACTION_POINTER_INDEX_SHIFT);
-            action &= MotionEvent.ACTION_POINTER_INDEX_MASK;
-        }
-        action |= (eventType & MotionEvent.ACTION_MASK);
-        boolean isButtonDown = (source == InputDevice.SOURCE_MOUSE) &&
-                               (eventType == MotionEvent.ACTION_DOWN || eventType == MotionEvent.ACTION_MOVE);
-        final MotionEvent event = MotionEvent.obtain(
-            /*downTime*/ mPointerState.downTime,
-            /*eventTime*/ SystemClock.uptimeMillis(),
-            /*action*/ action,
-            /*pointerCount*/ mPointerState.getPointerCount(source),
-            /*pointerProperties*/ mPointerState.getPointerProperties(source),
-            /*pointerCoords*/ mPointerState.getPointerCoords(source),
-            /*metaState*/ 0,
-            /*buttonState*/ (isButtonDown ? MotionEvent.BUTTON_PRIMARY : 0),
-            /*xPrecision*/ 0,
-            /*yPrecision*/ 0,
-            /*deviceId*/ 0,
-            /*edgeFlags*/ 0,
-            /*source*/ source,
-            /*flags*/ 0);
-        mView.post(new Runnable() {
-            @Override
-            public void run() {
-                getView().dispatchTouchEvent(event);
-            }
-        });
-
-        // Forget about removed pointers
-        if (eventType == MotionEvent.ACTION_POINTER_UP ||
-            eventType == MotionEvent.ACTION_UP ||
-            eventType == MotionEvent.ACTION_CANCEL ||
-            eventType == MotionEvent.ACTION_HOVER_MOVE)
-        {
-            mPointerState.pointers.remove(pointerIndex);
-        }
-    }
-
-    @WrapForJNI(calledFrom = "gecko")
-    public void synthesizeNativeTouchPoint(int pointerId, int eventType, int screenX,
-            int screenY, double pressure, int orientation)
-    {
-        if (pointerId == PointerInfo.RESERVED_MOUSE_POINTER_ID) {
-            throw new IllegalArgumentException("Use a different pointer ID in your test, this one is reserved for mouse");
-        }
-        synthesizeNativePointer(InputDevice.SOURCE_TOUCHSCREEN, pointerId,
-            eventType, screenX, screenY, pressure, orientation);
-    }
-
-    @WrapForJNI(calledFrom = "gecko")
-    public void synthesizeNativeMouseEvent(int eventType, int screenX, int screenY) {
-        synthesizeNativePointer(InputDevice.SOURCE_MOUSE, PointerInfo.RESERVED_MOUSE_POINTER_ID,
-            eventType, screenX, screenY, 0, 0);
-    }
-
-    /** Implementation of LayerView.Listener */
-    @Override
-    public void surfaceChanged() {
-        IntSize viewportSize = mToolbarAnimator.getViewportSize();
-        setViewportSize(viewportSize.width, viewportSize.height);
-    }
-
-    ImmutableViewportMetrics getViewportMetrics() {
-        return mViewportMetrics;
-    }
-}
--- a/widget/android/GeneratedJNIWrappers.cpp
+++ b/widget/android/GeneratedJNIWrappers.cpp
@@ -1099,59 +1099,16 @@ auto SurfaceTextureListener::New() -> Su
 }
 
 constexpr char SurfaceTextureListener::DisposeNative_t::name[];
 constexpr char SurfaceTextureListener::DisposeNative_t::signature[];
 
 constexpr char SurfaceTextureListener::OnFrameAvailable_t::name[];
 constexpr char SurfaceTextureListener::OnFrameAvailable_t::signature[];
 
-const char GeckoLayerClient::name[] =
-        "org/mozilla/gecko/gfx/GeckoLayerClient";
-
-constexpr char GeckoLayerClient::ContentDocumentChanged_t::name[];
-constexpr char GeckoLayerClient::ContentDocumentChanged_t::signature[];
-
-auto GeckoLayerClient::ContentDocumentChanged() const -> void
-{
-    return mozilla::jni::Method<ContentDocumentChanged_t>::Call(GeckoLayerClient::mCtx, nullptr);
-}
-
-constexpr char GeckoLayerClient::IsContentDocumentDisplayed_t::name[];
-constexpr char GeckoLayerClient::IsContentDocumentDisplayed_t::signature[];
-
-auto GeckoLayerClient::IsContentDocumentDisplayed() const -> bool
-{
-    return mozilla::jni::Method<IsContentDocumentDisplayed_t>::Call(GeckoLayerClient::mCtx, nullptr);
-}
-
-constexpr char GeckoLayerClient::SynthesizeNativeMouseEvent_t::name[];
-constexpr char GeckoLayerClient::SynthesizeNativeMouseEvent_t::signature[];
-
-auto GeckoLayerClient::SynthesizeNativeMouseEvent(int32_t a0, int32_t a1, int32_t a2) const -> void
-{
-    return mozilla::jni::Method<SynthesizeNativeMouseEvent_t>::Call(GeckoLayerClient::mCtx, nullptr, a0, a1, a2);
-}
-
-constexpr char GeckoLayerClient::SynthesizeNativeTouchPoint_t::name[];
-constexpr char GeckoLayerClient::SynthesizeNativeTouchPoint_t::signature[];
-
-auto GeckoLayerClient::SynthesizeNativeTouchPoint(int32_t a0, int32_t a1, int32_t a2, int32_t a3, double a4, int32_t a5) const -> void
-{
-    return mozilla::jni::Method<SynthesizeNativeTouchPoint_t>::Call(GeckoLayerClient::mCtx, nullptr, a0, a1, a2, a3, a4, a5);
-}
-
-constexpr char GeckoLayerClient::UpdateRootFrameMetrics_t::name[];
-constexpr char GeckoLayerClient::UpdateRootFrameMetrics_t::signature[];
-
-auto GeckoLayerClient::UpdateRootFrameMetrics(float a0, float a1, float a2) const -> void
-{
-    return mozilla::jni::Method<UpdateRootFrameMetrics_t>::Call(GeckoLayerClient::mCtx, nullptr, a0, a1, a2);
-}
-
 const char GeckoSurface::name[] =
         "org/mozilla/gecko/gfx/GeckoSurface";
 
 constexpr char GeckoSurface::New_t::name[];
 constexpr char GeckoSurface::New_t::signature[];
 
 auto GeckoSurface::New(mozilla::jni::Object::Param a0, GeckoSurface::LocalRef* a1) -> nsresult
 {
@@ -1292,25 +1249,41 @@ const char LayerSession::name[] =
         "org/mozilla/gecko/gfx/LayerSession";
 
 const char LayerSession::Compositor::name[] =
         "org/mozilla/gecko/gfx/LayerSession$Compositor";
 
 constexpr char LayerSession::Compositor::AttachToJava_t::name[];
 constexpr char LayerSession::Compositor::AttachToJava_t::signature[];
 
+constexpr char LayerSession::Compositor::ContentDocumentChanged_t::name[];
+constexpr char LayerSession::Compositor::ContentDocumentChanged_t::signature[];
+
+auto LayerSession::Compositor::ContentDocumentChanged() const -> void
+{
+    return mozilla::jni::Method<ContentDocumentChanged_t>::Call(Compositor::mCtx, nullptr);
+}
+
 constexpr char LayerSession::Compositor::CreateCompositor_t::name[];
 constexpr char LayerSession::Compositor::CreateCompositor_t::signature[];
 
 constexpr char LayerSession::Compositor::DisposeNative_t::name[];
 constexpr char LayerSession::Compositor::DisposeNative_t::signature[];
 
 constexpr char LayerSession::Compositor::EnableLayerUpdateNotifications_t::name[];
 constexpr char LayerSession::Compositor::EnableLayerUpdateNotifications_t::signature[];
 
+constexpr char LayerSession::Compositor::IsContentDocumentDisplayed_t::name[];
+constexpr char LayerSession::Compositor::IsContentDocumentDisplayed_t::signature[];
+
+auto LayerSession::Compositor::IsContentDocumentDisplayed() const -> bool
+{
+    return mozilla::jni::Method<IsContentDocumentDisplayed_t>::Call(Compositor::mCtx, nullptr);
+}
+
 constexpr char LayerSession::Compositor::OnBoundsChanged_t::name[];
 constexpr char LayerSession::Compositor::OnBoundsChanged_t::signature[];
 
 constexpr char LayerSession::Compositor::OnCompositorAttached_t::name[];
 constexpr char LayerSession::Compositor::OnCompositorAttached_t::signature[];
 
 auto LayerSession::Compositor::OnCompositorAttached() const -> void
 {
@@ -1360,16 +1333,24 @@ constexpr char LayerSession::Compositor:
 constexpr char LayerSession::Compositor::SetPinned_t::signature[];
 
 constexpr char LayerSession::Compositor::SyncPauseCompositor_t::name[];
 constexpr char LayerSession::Compositor::SyncPauseCompositor_t::signature[];
 
 constexpr char LayerSession::Compositor::SyncResumeResizeCompositor_t::name[];
 constexpr char LayerSession::Compositor::SyncResumeResizeCompositor_t::signature[];
 
+constexpr char LayerSession::Compositor::UpdateRootFrameMetrics_t::name[];
+constexpr char LayerSession::Compositor::UpdateRootFrameMetrics_t::signature[];
+
+auto LayerSession::Compositor::UpdateRootFrameMetrics(float a0, float a1, float a2) const -> void
+{
+    return mozilla::jni::Method<UpdateRootFrameMetrics_t>::Call(Compositor::mCtx, nullptr, a0, a1, a2);
+}
+
 const char LayerView::name[] =
         "org/mozilla/gecko/gfx/LayerView";
 
 constexpr char LayerView::GetCompositor_t::name[];
 constexpr char LayerView::GetCompositor_t::signature[];
 
 auto LayerView::GetCompositor() const -> mozilla::jni::Object::LocalRef
 {
@@ -1405,16 +1386,32 @@ constexpr char NativePanZoomController::
 constexpr char NativePanZoomController::OnSelectionDragState_t::name[];
 constexpr char NativePanZoomController::OnSelectionDragState_t::signature[];
 
 auto NativePanZoomController::OnSelectionDragState(bool a0) const -> void
 {
     return mozilla::jni::Method<OnSelectionDragState_t>::Call(NativePanZoomController::mCtx, nullptr, a0);
 }
 
+constexpr char NativePanZoomController::SynthesizeNativeMouseEvent_t::name[];
+constexpr char NativePanZoomController::SynthesizeNativeMouseEvent_t::signature[];
+
+auto NativePanZoomController::SynthesizeNativeMouseEvent(int32_t a0, int32_t a1, int32_t a2) const -> void
+{
+    return mozilla::jni::Method<SynthesizeNativeMouseEvent_t>::Call(NativePanZoomController::mCtx, nullptr, a0, a1, a2);
+}
+
+constexpr char NativePanZoomController::SynthesizeNativeTouchPoint_t::name[];
+constexpr char NativePanZoomController::SynthesizeNativeTouchPoint_t::signature[];
+
+auto NativePanZoomController::SynthesizeNativeTouchPoint(int32_t a0, int32_t a1, int32_t a2, int32_t a3, double a4, int32_t a5) const -> void
+{
+    return mozilla::jni::Method<SynthesizeNativeTouchPoint_t>::Call(NativePanZoomController::mCtx, nullptr, a0, a1, a2, a3, a4, a5);
+}
+
 constexpr char NativePanZoomController::UpdateOverscrollOffset_t::name[];
 constexpr char NativePanZoomController::UpdateOverscrollOffset_t::signature[];
 
 auto NativePanZoomController::UpdateOverscrollOffset(float a0, float a1) const -> void
 {
     return mozilla::jni::Method<UpdateOverscrollOffset_t>::Call(NativePanZoomController::mCtx, nullptr, a0, a1);
 }
 
--- a/widget/android/GeneratedJNIWrappers.h
+++ b/widget/android/GeneratedJNIWrappers.h
@@ -3434,135 +3434,16 @@ public:
     };
 
     static const mozilla::jni::CallingThread callingThread =
             mozilla::jni::CallingThread::ANY;
 
     template<class Impl> class Natives;
 };
 
-class GeckoLayerClient : public mozilla::jni::ObjectBase<GeckoLayerClient>
-{
-public:
-    static const char name[];
-
-    explicit GeckoLayerClient(const Context& ctx) : ObjectBase<GeckoLayerClient>(ctx) {}
-
-    struct ContentDocumentChanged_t {
-        typedef GeckoLayerClient Owner;
-        typedef void ReturnType;
-        typedef void SetterType;
-        typedef mozilla::jni::Args<> Args;
-        static constexpr char name[] = "contentDocumentChanged";
-        static constexpr char signature[] =
-                "()V";
-        static const bool isStatic = false;
-        static const mozilla::jni::ExceptionMode exceptionMode =
-                mozilla::jni::ExceptionMode::ABORT;
-        static const mozilla::jni::CallingThread callingThread =
-                mozilla::jni::CallingThread::GECKO;
-        static const mozilla::jni::DispatchTarget dispatchTarget =
-                mozilla::jni::DispatchTarget::CURRENT;
-    };
-
-    auto ContentDocumentChanged() const -> void;
-
-    struct IsContentDocumentDisplayed_t {
-        typedef GeckoLayerClient Owner;
-        typedef bool ReturnType;
-        typedef bool SetterType;
-        typedef mozilla::jni::Args<> Args;
-        static constexpr char name[] = "isContentDocumentDisplayed";
-        static constexpr char signature[] =
-                "()Z";
-        static const bool isStatic = false;
-        static const mozilla::jni::ExceptionMode exceptionMode =
-                mozilla::jni::ExceptionMode::ABORT;
-        static const mozilla::jni::CallingThread callingThread =
-                mozilla::jni::CallingThread::GECKO;
-        static const mozilla::jni::DispatchTarget dispatchTarget =
-                mozilla::jni::DispatchTarget::CURRENT;
-    };
-
-    auto IsContentDocumentDisplayed() const -> bool;
-
-    struct SynthesizeNativeMouseEvent_t {
-        typedef GeckoLayerClient Owner;
-        typedef void ReturnType;
-        typedef void SetterType;
-        typedef mozilla::jni::Args<
-                int32_t,
-                int32_t,
-                int32_t> Args;
-        static constexpr char name[] = "synthesizeNativeMouseEvent";
-        static constexpr char signature[] =
-                "(III)V";
-        static const bool isStatic = false;
-        static const mozilla::jni::ExceptionMode exceptionMode =
-                mozilla::jni::ExceptionMode::ABORT;
-        static const mozilla::jni::CallingThread callingThread =
-                mozilla::jni::CallingThread::GECKO;
-        static const mozilla::jni::DispatchTarget dispatchTarget =
-                mozilla::jni::DispatchTarget::CURRENT;
-    };
-
-    auto SynthesizeNativeMouseEvent(int32_t, int32_t, int32_t) const -> void;
-
-    struct SynthesizeNativeTouchPoint_t {
-        typedef GeckoLayerClient Owner;
-        typedef void ReturnType;
-        typedef void SetterType;
-        typedef mozilla::jni::Args<
-                int32_t,
-                int32_t,
-                int32_t,
-                int32_t,
-                double,
-                int32_t> Args;
-        static constexpr char name[] = "synthesizeNativeTouchPoint";
-        static constexpr char signature[] =
-                "(IIIIDI)V";
-        static const bool isStatic = false;
-        static const mozilla::jni::ExceptionMode exceptionMode =
-                mozilla::jni::ExceptionMode::ABORT;
-        static const mozilla::jni::CallingThread callingThread =
-                mozilla::jni::CallingThread::GECKO;
-        static const mozilla::jni::DispatchTarget dispatchTarget =
-                mozilla::jni::DispatchTarget::CURRENT;
-    };
-
-    auto SynthesizeNativeTouchPoint(int32_t, int32_t, int32_t, int32_t, double, int32_t) const -> void;
-
-    struct UpdateRootFrameMetrics_t {
-        typedef GeckoLayerClient Owner;
-        typedef void ReturnType;
-        typedef void SetterType;
-        typedef mozilla::jni::Args<
-                float,
-                float,
-                float> Args;
-        static constexpr char name[] = "updateRootFrameMetrics";
-        static constexpr char signature[] =
-                "(FFF)V";
-        static const bool isStatic = false;
-        static const mozilla::jni::ExceptionMode exceptionMode =
-                mozilla::jni::ExceptionMode::ABORT;
-        static const mozilla::jni::CallingThread callingThread =
-                mozilla::jni::CallingThread::UI;
-        static const mozilla::jni::DispatchTarget dispatchTarget =
-                mozilla::jni::DispatchTarget::CURRENT;
-    };
-
-    auto UpdateRootFrameMetrics(float, float, float) const -> void;
-
-    static const mozilla::jni::CallingThread callingThread =
-            mozilla::jni::CallingThread::ANY;
-
-};
-
 class GeckoSurface : public mozilla::jni::ObjectBase<GeckoSurface>
 {
 public:
     static const char name[];
 
     explicit GeckoSurface(const Context& ctx) : ObjectBase<GeckoSurface>(ctx) {}
 
     struct New_t {
@@ -3913,30 +3794,48 @@ public:
 
     explicit Compositor(const Context& ctx) : ObjectBase<Compositor>(ctx) {}
 
     struct AttachToJava_t {
         typedef Compositor Owner;
         typedef void ReturnType;
         typedef void SetterType;
         typedef mozilla::jni::Args<
-                mozilla::jni::Object::Param,
                 mozilla::jni::Object::Param> Args;
         static constexpr char name[] = "attachToJava";
         static constexpr char signature[] =
-                "(Lorg/mozilla/gecko/gfx/GeckoLayerClient;Lorg/mozilla/gecko/gfx/NativePanZoomController;)V";
+                "(Lorg/mozilla/gecko/gfx/NativePanZoomController;)V";
         static const bool isStatic = false;
         static const mozilla::jni::ExceptionMode exceptionMode =
                 mozilla::jni::ExceptionMode::ABORT;
         static const mozilla::jni::CallingThread callingThread =
                 mozilla::jni::CallingThread::ANY;
         static const mozilla::jni::DispatchTarget dispatchTarget =
                 mozilla::jni::DispatchTarget::GECKO;
     };
 
+    struct ContentDocumentChanged_t {
+        typedef Compositor Owner;
+        typedef void ReturnType;
+        typedef void SetterType;
+        typedef mozilla::jni::Args<> Args;
+        static constexpr char name[] = "contentDocumentChanged";
+        static constexpr char signature[] =
+                "()V";
+        static const bool isStatic = false;
+        static const mozilla::jni::ExceptionMode exceptionMode =
+                mozilla::jni::ExceptionMode::ABORT;
+        static const mozilla::jni::CallingThread callingThread =
+                mozilla::jni::CallingThread::GECKO;
+        static const mozilla::jni::DispatchTarget dispatchTarget =
+                mozilla::jni::DispatchTarget::CURRENT;
+    };
+
+    auto ContentDocumentChanged() const -> void;
+
     struct CreateCompositor_t {
         typedef Compositor Owner;
         typedef void ReturnType;
         typedef void SetterType;
         typedef mozilla::jni::Args<
                 int32_t,
                 int32_t,
                 mozilla::jni::Object::Param> Args;
@@ -3982,16 +3881,35 @@ public:
         static const mozilla::jni::ExceptionMode exceptionMode =
                 mozilla::jni::ExceptionMode::ABORT;
         static const mozilla::jni::CallingThread callingThread =
                 mozilla::jni::CallingThread::UI;
         static const mozilla::jni::DispatchTarget dispatchTarget =
                 mozilla::jni::DispatchTarget::CURRENT;
     };
 
+    struct IsContentDocumentDisplayed_t {
+        typedef Compositor Owner;
+        typedef bool ReturnType;
+        typedef bool SetterType;
+        typedef mozilla::jni::Args<> Args;
+        static constexpr char name[] = "isContentDocumentDisplayed";
+        static constexpr char signature[] =
+                "()Z";
+        static const bool isStatic = false;
+        static const mozilla::jni::ExceptionMode exceptionMode =
+                mozilla::jni::ExceptionMode::ABORT;
+        static const mozilla::jni::CallingThread callingThread =
+                mozilla::jni::CallingThread::GECKO;
+        static const mozilla::jni::DispatchTarget dispatchTarget =
+                mozilla::jni::DispatchTarget::CURRENT;
+    };
+
+    auto IsContentDocumentDisplayed() const -> bool;
+
     struct OnBoundsChanged_t {
         typedef Compositor Owner;
         typedef void ReturnType;
         typedef void SetterType;
         typedef mozilla::jni::Args<
                 int32_t,
                 int32_t,
                 int32_t,
@@ -4230,16 +4148,38 @@ public:
         static const mozilla::jni::ExceptionMode exceptionMode =
                 mozilla::jni::ExceptionMode::ABORT;
         static const mozilla::jni::CallingThread callingThread =
                 mozilla::jni::CallingThread::UI;
         static const mozilla::jni::DispatchTarget dispatchTarget =
                 mozilla::jni::DispatchTarget::CURRENT;
     };
 
+    struct UpdateRootFrameMetrics_t {
+        typedef Compositor Owner;
+        typedef void ReturnType;
+        typedef void SetterType;
+        typedef mozilla::jni::Args<
+                float,
+                float,
+                float> Args;
+        static constexpr char name[] = "updateRootFrameMetrics";
+        static constexpr char signature[] =
+                "(FFF)V";
+        static const bool isStatic = false;
+        static const mozilla::jni::ExceptionMode exceptionMode =
+                mozilla::jni::ExceptionMode::ABORT;
+        static const mozilla::jni::CallingThread callingThread =
+                mozilla::jni::CallingThread::UI;
+        static const mozilla::jni::DispatchTarget dispatchTarget =
+                mozilla::jni::DispatchTarget::CURRENT;
+    };
+
+    auto UpdateRootFrameMetrics(float, float, float) const -> void;
+
     static const mozilla::jni::CallingThread callingThread =
             mozilla::jni::CallingThread::ANY;
 
     template<class Impl> class Natives;
 };
 
 class LayerView : public mozilla::jni::ObjectBase<LayerView>
 {
@@ -4422,16 +4362,63 @@ public:
         static const mozilla::jni::CallingThread callingThread =
                 mozilla::jni::CallingThread::GECKO;
         static const mozilla::jni::DispatchTarget dispatchTarget =
                 mozilla::jni::DispatchTarget::CURRENT;
     };
 
     auto OnSelectionDragState(bool) const -> void;
 
+    struct SynthesizeNativeMouseEvent_t {
+        typedef NativePanZoomController Owner;
+        typedef void ReturnType;
+        typedef void SetterType;
+        typedef mozilla::jni::Args<
+                int32_t,
+                int32_t,
+                int32_t> Args;
+        static constexpr char name[] = "synthesizeNativeMouseEvent";
+        static constexpr char signature[] =
+                "(III)V";
+        static const bool isStatic = false;
+        static const mozilla::jni::ExceptionMode exceptionMode =
+                mozilla::jni::ExceptionMode::ABORT;
+        static const mozilla::jni::CallingThread callingThread =
+                mozilla::jni::CallingThread::GECKO;
+        static const mozilla::jni::DispatchTarget dispatchTarget =
+                mozilla::jni::DispatchTarget::CURRENT;
+    };
+
+    auto SynthesizeNativeMouseEvent(int32_t, int32_t, int32_t) const -> void;
+
+    struct SynthesizeNativeTouchPoint_t {
+        typedef NativePanZoomController Owner;
+        typedef void ReturnType;
+        typedef void SetterType;
+        typedef mozilla::jni::Args<
+                int32_t,
+                int32_t,
+                int32_t,
+                int32_t,
+                double,
+                int32_t> Args;
+        static constexpr char name[] = "synthesizeNativeTouchPoint";
+        static constexpr char signature[] =
+                "(IIIIDI)V";
+        static const bool isStatic = false;
+        static const mozilla::jni::ExceptionMode exceptionMode =
+                mozilla::jni::ExceptionMode::ABORT;
+        static const mozilla::jni::CallingThread callingThread =
+                mozilla::jni::CallingThread::GECKO;
+        static const mozilla::jni::DispatchTarget dispatchTarget =
+                mozilla::jni::DispatchTarget::CURRENT;
+    };
+
+    auto SynthesizeNativeTouchPoint(int32_t, int32_t, int32_t, int32_t, double, int32_t) const -> void;
+
     struct UpdateOverscrollOffset_t {
         typedef NativePanZoomController Owner;
         typedef void ReturnType;
         typedef void SetterType;
         typedef mozilla::jni::Args<
                 float,
                 float> Args;
         static constexpr char name[] = "updateOverscrollOffset";