Bug 1509146 - Remove default implementations in GeckoView interfaces r=nalexander
authorJames Willcox <snorp@snorp.net>
Fri, 23 Nov 2018 19:42:26 +0000
changeset 507100 73385b8318802d1d7769bada221d96d17eea0ead
parent 507092 2317749c5abfb7eab139a2545d2fa5362d2309f0
child 507101 796ce1c75aa4f16bcb657f5957e04542e3f6c6f2
push id1905
push userffxbld-merge
push dateMon, 21 Jan 2019 12:33:13 +0000
treeherdermozilla-release@c2fca1944d8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnalexander
bugs1509146
milestone65.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 1509146 - Remove default implementations in GeckoView interfaces r=nalexander JaCoCo chokes on default implementations in interfaces, so remove those for now. Differential Revision: https://phabricator.services.mozilla.com/D12607
mobile/android/base/java/org/mozilla/gecko/GeckoApp.java
mobile/android/base/java/org/mozilla/gecko/customtabs/CustomTabsActivity.java
mobile/android/base/java/org/mozilla/gecko/webapps/WebAppActivity.java
mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/TestRunnerActivity.java
mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/util/Callbacks.kt
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoSession.java
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/MediaElement.java
mobile/android/geckoview_example/src/main/java/org/mozilla/geckoview_example/GeckoViewActivity.java
--- a/mobile/android/base/java/org/mozilla/gecko/GeckoApp.java
+++ b/mobile/android/base/java/org/mozilla/gecko/GeckoApp.java
@@ -909,16 +909,20 @@ public abstract class GeckoApp extends G
         // Won't happen, as we don't use the GeckoView download support in Fennec
     }
 
     @Override
     public void onCrash(final GeckoSession session) {
         // Won't happen, as we don't use e10s in Fennec
     }
 
+    @Override
+    public void onFirstComposite(final GeckoSession session) {
+    }
+
     protected void setFullScreen(final boolean fullscreen) {
         ThreadUtils.postToUiThread(new Runnable() {
             @Override
             public void run() {
                 onFullScreen(mLayerView.getSession(), fullscreen);
             }
         });
     }
--- a/mobile/android/base/java/org/mozilla/gecko/customtabs/CustomTabsActivity.java
+++ b/mobile/android/base/java/org/mozilla/gecko/customtabs/CustomTabsActivity.java
@@ -718,16 +718,20 @@ public class CustomTabsActivity extends 
         // Won't happen, as we don't use the GeckoView download support in Fennec
     }
 
     @Override
     public void onCrash(final GeckoSession session) {
         // Won't happen, as we don't use e10s in Fennec
     }
 
+    @Override
+    public void onFirstComposite(final GeckoSession session) {
+    }
+
     @Override // ActionModePresenter
     public void startActionMode(final ActionMode.Callback callback) {
         endActionMode();
         mActionMode = startSupportActionMode(callback);
     }
 
     @Override // ActionModePresenter
     public void endActionMode() {
--- a/mobile/android/base/java/org/mozilla/gecko/webapps/WebAppActivity.java
+++ b/mobile/android/base/java/org/mozilla/gecko/webapps/WebAppActivity.java
@@ -368,16 +368,20 @@ public class WebAppActivity extends AppC
         // Won't happen, as we don't use the GeckoView download support in Fennec
     }
 
     @Override // GeckoSession.ContentDelegate
     public void onCrash(final GeckoSession session) {
         // Won't happen, as we don't use e10s in Fennec
     }
 
+    @Override
+    public void onFirstComposite(final GeckoSession session) {
+    }
+
     @Override // GeckoSession.ContentDelegate
     public void onFullScreen(GeckoSession session, boolean fullScreen) {
         updateFullScreenContent(fullScreen);
     }
 
     @Override
     public GeckoResult<AllowOrDeny> onLoadRequest(final GeckoSession session,
                                                   final LoadRequest request) {
--- a/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/TestRunnerActivity.java
+++ b/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/TestRunnerActivity.java
@@ -100,16 +100,20 @@ public class TestRunnerActivity extends 
         }
 
         @Override
         public void onCrash(GeckoSession session) {
             if (System.getenv("MOZ_CRASHREPORTER_SHUTDOWN") != null) {
                 sRuntime.shutdown();
             }
         }
+
+        @Override
+        public void onFirstComposite(final GeckoSession session) {
+        }
     };
 
     private GeckoSession createSession() {
         return createSession(null);
     }
 
     private GeckoSession createSession(GeckoSessionSettings settings) {
         if (settings == null) {
--- a/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/util/Callbacks.kt
+++ b/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/util/Callbacks.kt
@@ -41,16 +41,19 @@ class Callbacks private constructor() {
         override fun onContextMenu(session: GeckoSession, screenX: Int, screenY: Int, uri: String, elementType: Int, elementSrc: String) {
         }
 
         override fun onExternalResponse(session: GeckoSession, response: GeckoSession.WebResponseInfo) {
         }
 
         override fun onCrash(session: GeckoSession) {
         }
+
+        override fun onFirstComposite(session: GeckoSession) {
+        }
     }
 
     interface NavigationDelegate : GeckoSession.NavigationDelegate {
         override fun onLocationChange(session: GeckoSession, url: String) {
         }
 
         override fun onCanGoBack(session: GeckoSession, canGoBack: Boolean) {
         }
--- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoSession.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoSession.java
@@ -2595,17 +2595,17 @@ public class GeckoSession implements Par
         void onCrash(GeckoSession session);
 
         /**
          * Notification that the first content composition has occurred.
          * This callback is invoked for the first content composite after either
          * a start or a restart of the compositor.
          * @param session The GeckoSession that had a first paint event.
          */
-        default void onFirstComposite(GeckoSession session) {}
+        void onFirstComposite(GeckoSession session);
     }
 
     public interface SelectionActionDelegate {
         @IntDef(flag = true, value = {FLAG_IS_COLLAPSED,
                                       FLAG_IS_EDITABLE})
         /* package */ @interface Flag {}
 
         /**
--- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/MediaElement.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/MediaElement.java
@@ -259,84 +259,84 @@ public class MediaElement {
     public interface Delegate {
         /**
          * The media playback state has changed.
          *
          * @param mediaElement A reference to the MediaElement that dispatched the event.
          * @param mediaState The playback state of the media.
          *                   One of the {@link #MEDIA_STATE_PLAY MEDIA_STATE_*} flags.
          */
-        default void onPlaybackStateChange(MediaElement mediaElement, @MediaStateFlags int mediaState) {}
+        void onPlaybackStateChange(MediaElement mediaElement, @MediaStateFlags int mediaState);
 
         /**
          * The readiness state of the media has changed.
          *
          * @param mediaElement A reference to the MediaElement that dispatched the event.
          * @param readyState The readiness state of the media.
          *                   One of the {@link #MEDIA_READY_STATE_HAVE_NOTHING MEDIA_READY_STATE_*} flags.
          */
-        default void onReadyStateChange(MediaElement mediaElement, @ReadyStateFlags int readyState) {}
+        void onReadyStateChange(MediaElement mediaElement, @ReadyStateFlags int readyState);
 
         /**
          * The media metadata has loaded or changed.
          *
          * @param mediaElement A reference to the MediaElement that dispatched the event.
          * @param metaData The MetaData values of the media.
          */
-        default void onMetadataChange(MediaElement mediaElement, Metadata metaData) {}
+        void onMetadataChange(MediaElement mediaElement, Metadata metaData);
 
         /**
          * Indicates that a loading operation is in progress for the media.
          *
          * @param mediaElement A reference to the MediaElement that dispatched the event.
          * @param progressInfo Information about the load progress and buffered ranges.
          */
-        default void onLoadProgress(MediaElement mediaElement, LoadProgressInfo progressInfo) {}
+        void onLoadProgress(MediaElement mediaElement, LoadProgressInfo progressInfo);
 
         /**
          * The media audio volume has changed.
          *
          * @param mediaElement A reference to the MediaElement that dispatched the event.
          * @param volume The volume of the media.
          * @param muted True if the media is muted.
          */
-        default void onVolumeChange(MediaElement mediaElement, double volume, boolean muted) {}
+        void onVolumeChange(MediaElement mediaElement, double volume, boolean muted);
 
         /**
          * The current playback time has changed. This event is usually dispatched every 250ms.
          *
          * @param mediaElement A reference to the MediaElement that dispatched the event.
          * @param time The current playback time in seconds.
          */
-        default void onTimeChange(MediaElement mediaElement, double time) {}
+        void onTimeChange(MediaElement mediaElement, double time);
 
         /**
          * The media playback speed has changed.
          *
          * @param mediaElement A reference to the MediaElement that dispatched the event.
          * @param rate The current playback rate. A value of 1.0 indicates normal speed.
          */
-        default void onPlaybackRateChange(MediaElement mediaElement, double rate) {}
+        void onPlaybackRateChange(MediaElement mediaElement, double rate);
 
         /**
          * A media element has entered or exited fullscreen mode.
          *
          * @param mediaElement A reference to the MediaElement that dispatched the event.
          * @param fullscreen True if the media has entered full screen mode.
          */
-        default void onFullscreenChange(MediaElement mediaElement, boolean fullscreen) {}
+        void onFullscreenChange(MediaElement mediaElement, boolean fullscreen);
 
         /**
          * An error has occurred.
          *
          * @param mediaElement A reference to the MediaElement that dispatched the event.
          * @param errorCode The error code.
          *                  One of the {@link #MEDIA_ERROR_NETWORK_NO_SOURCE MEDIA_ERROR_*} flags.
          */
-        default void onError(MediaElement mediaElement, @MediaErrorFlags int errorCode) {}
+        void onError(MediaElement mediaElement, @MediaErrorFlags int errorCode);
     }
 
     /* package */ long getVideoId() {
         return mVideoId;
     }
 
     /**
      * Gets the current the media callback handler.
--- a/mobile/android/geckoview_example/src/main/java/org/mozilla/geckoview_example/GeckoViewActivity.java
+++ b/mobile/android/geckoview_example/src/main/java/org/mozilla/geckoview_example/GeckoViewActivity.java
@@ -496,16 +496,21 @@ public class GeckoViewActivity extends A
         }
 
         @Override
         public void onCrash(GeckoSession session) {
             Log.e(LOGTAG, "Crashed, reopening session");
             session.open(sGeckoRuntime);
             session.loadUri(DEFAULT_URL);
         }
+
+        @Override
+        public void onFirstComposite(final GeckoSession session) {
+            Log.d(LOGTAG, "onFirstComposite");
+        }
     }
 
     private class ExampleProgressDelegate implements GeckoSession.ProgressDelegate {
         private ExampleTrackingProtectionDelegate mTp;
 
         private ExampleProgressDelegate(final ExampleTrackingProtectionDelegate tp) {
             mTp = tp;
         }