Bug 1368907 - Part3 - Rename GeckoHlsResourceWrapper to GeckoHLSResourceWrapper for naming consistency. r?jolin draft
authorJames Cheng <jacheng@mozilla.com>
Mon, 12 Jun 2017 15:57:15 +0800
changeset 593432 689cc2834008469da38f03dbde994b5dd49d06a5
parent 593431 9b261fe486fec690f44525de492eb6726dcdb89c
child 593433 213fe496ead50b5593942dd4a8c36a5954f99791
push id63684
push userbmo:jacheng@mozilla.com
push dateTue, 13 Jun 2017 14:26:05 +0000
reviewersjolin
bugs1368907
milestone56.0a1
Bug 1368907 - Part3 - Rename GeckoHlsResourceWrapper to GeckoHLSResourceWrapper for naming consistency. r?jolin MozReview-Commit-ID: Lvmf5p4lYTb
mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/GeckoHLSResourceWrapper.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/GeckoHlsResourceWrapper.java
new file mode 100644
--- /dev/null
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/GeckoHLSResourceWrapper.java
@@ -0,0 +1,79 @@
+/* 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.media;
+
+import android.util.Log;
+
+import org.mozilla.gecko.annotation.WrapForJNI;
+import org.mozilla.gecko.mozglue.JNIObject;
+
+public class GeckoHLSResourceWrapper {
+    private static final String LOGTAG = "GeckoHLSResourceWrapper";
+    private static final boolean DEBUG = false;
+    private GeckoHlsPlayer mPlayer = null;
+    private boolean mDestroy = false;
+
+    public static class Callbacks extends JNIObject
+    implements GeckoHlsPlayer.ResourceCallbacks {
+        @WrapForJNI(calledFrom = "gecko")
+        Callbacks() {}
+
+        @Override
+        @WrapForJNI(dispatchTo = "gecko")
+        public native void onDataArrived();
+
+        @Override
+        @WrapForJNI(dispatchTo = "gecko")
+        public native void onError(int errorCode);
+
+        @Override // JNIObject
+        protected void disposeNative() {
+            throw new UnsupportedOperationException();
+        }
+    } // Callbacks
+
+    private GeckoHLSResourceWrapper(String url,
+                                    GeckoHlsPlayer.ResourceCallbacks callback) {
+        if (DEBUG) Log.d(LOGTAG, "GeckoHLSResourceWrapper created with url = " + url);
+        assertTrue(callback != null);
+
+        mPlayer = new GeckoHlsPlayer();
+        mPlayer.addResourceWrapperCallbackListener(callback);
+        mPlayer.init(url);
+    }
+
+    @WrapForJNI(calledFrom = "gecko")
+    public static GeckoHLSResourceWrapper create(String url,
+                                                 GeckoHlsPlayer.ResourceCallbacks callback) {
+        return new GeckoHLSResourceWrapper(url, callback);
+    }
+
+    @WrapForJNI(calledFrom = "gecko")
+    public GeckoHlsPlayer GetPlayer() {
+        // GeckoHLSResourceWrapper should always be created before others
+        assertTrue(!mDestroy);
+        assertTrue(mPlayer != null);
+        return mPlayer;
+    }
+
+    private static void assertTrue(boolean condition) {
+        if (DEBUG && !condition) {
+            throw new AssertionError("Expected condition to be true");
+        }
+    }
+
+    @WrapForJNI // Called when native object is mDestroy.
+    private void destroy() {
+        if (DEBUG) Log.d(LOGTAG, "destroy!! Native object is destroyed.");
+        if (mDestroy) {
+            return;
+        }
+        mDestroy = true;
+        if (mPlayer != null) {
+            mPlayer.release();
+            mPlayer = null;
+        }
+    }
+}
deleted file mode 100644
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/GeckoHlsResourceWrapper.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/* 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.media;
-
-import android.util.Log;
-
-import org.mozilla.gecko.annotation.WrapForJNI;
-import org.mozilla.gecko.mozglue.JNIObject;
-
-public class GeckoHlsResourceWrapper {
-    private static final String LOGTAG = "GeckoHlsResourceWrapper";
-    private static final boolean DEBUG = false;
-    private GeckoHlsPlayer mPlayer = null;
-    private boolean mDestroy = false;
-
-    public static class HlsResourceCallbacks extends JNIObject
-    implements GeckoHlsPlayer.ResourceCallbacks {
-        @WrapForJNI(calledFrom = "gecko")
-        HlsResourceCallbacks() {}
-
-        @Override
-        @WrapForJNI(dispatchTo = "gecko")
-        public native void onDataArrived();
-
-        @Override
-        @WrapForJNI(dispatchTo = "gecko")
-        public native void onError(int errorCode);
-
-        @Override // JNIObject
-        protected void disposeNative() {
-            throw new UnsupportedOperationException();
-        }
-    } // HlsResourceCallbacks
-
-    private GeckoHlsResourceWrapper(String url,
-                                    GeckoHlsPlayer.ResourceCallbacks callback) {
-        if (DEBUG) Log.d(LOGTAG, "GeckoHlsResourceWrapper created with url = " + url);
-        assertTrue(callback != null);
-
-        mPlayer = new GeckoHlsPlayer();
-        mPlayer.addResourceWrapperCallbackListener(callback);
-        mPlayer.init(url);
-    }
-
-    @WrapForJNI(calledFrom = "gecko")
-    public static GeckoHlsResourceWrapper create(String url,
-                                                 GeckoHlsPlayer.ResourceCallbacks callback) {
-        return new GeckoHlsResourceWrapper(url, callback);
-    }
-
-    @WrapForJNI(calledFrom = "gecko")
-    public GeckoHlsPlayer GetPlayer() {
-        // GeckoHlsResourceWrapper should always be created before others
-        assertTrue(!mDestroy);
-        assertTrue(mPlayer != null);
-        return mPlayer;
-    }
-
-    private static void assertTrue(boolean condition) {
-        if (DEBUG && !condition) {
-            throw new AssertionError("Expected condition to be true");
-        }
-    }
-
-    @WrapForJNI // Called when native object is mDestroy.
-    private void destroy() {
-        if (DEBUG) Log.d(LOGTAG, "destroy!! Native object is destroyed.");
-        if (mDestroy) {
-            return;
-        }
-        mDestroy = true;
-        if (mPlayer != null) {
-            mPlayer.release();
-            mPlayer = null;
-        }
-    }
-}