Backed out changeset 2d8d0579cb0d (bug 1306185)
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Wed, 02 Nov 2016 15:24:11 +0100
changeset 347199 42e6e9452daab1637cfcaf4867918edde5f146b9
parent 347198 2a24a2c246a8ae12fde6a882ec080327d89a42c1
child 347200 ecc75858b17b6fa16ed3b43ff683a2de0e941320
push id10298
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:33:03 +0000
treeherdermozilla-aurora@7e29173b1641 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1306185
milestone52.0a1
backs out2d8d0579cb0dcd9d1f04d194a9686db6023e7227
Backed out changeset 2d8d0579cb0d (bug 1306185)
mobile/android/base/java/org/mozilla/gecko/media/LocalMediaDrmBridge.java
mobile/android/base/moz.build
deleted file mode 100644
--- a/mobile/android/base/java/org/mozilla/gecko/media/LocalMediaDrmBridge.java
+++ /dev/null
@@ -1,162 +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 org.mozilla.gecko.AppConstants;
-
-import android.media.MediaCrypto;
-import android.util.Log;
-
-final class LocalMediaDrmBridge implements GeckoMediaDrm {
-    private static final String LOGTAG = "GeckoLocalMediaDrmBridge";
-    private static final boolean DEBUG = false;
-    private GeckoMediaDrm mBridge = null;
-    private CallbacksForwarder mCallbacksFwd;
-
-    // Forward the callback calls from GeckoMediaDrmBridgeV{21,23}
-    // to the callback MediaDrmProxy.Callbacks.
-    private class CallbacksForwarder implements GeckoMediaDrm.Callbacks {
-        private final GeckoMediaDrm.Callbacks mProxyCallbacks;
-
-        CallbacksForwarder(GeckoMediaDrm.Callbacks callbacks) {
-            assertTrue(callbacks != null);
-            mProxyCallbacks = callbacks;
-        }
-
-        @Override
-        public void onSessionCreated(int createSessionToken,
-                                     int promiseId,
-                                     byte[] sessionId,
-                                     byte[] request) {
-            assertTrue(mProxyCallbacks != null);
-            mProxyCallbacks.onSessionCreated(createSessionToken,
-                                             promiseId,
-                                             sessionId,
-                                             request);
-        }
-
-        @Override
-        public void onSessionUpdated(int promiseId, byte[] sessionId) {
-            assertTrue(mProxyCallbacks != null);
-            mProxyCallbacks.onSessionUpdated(promiseId, sessionId);
-        }
-
-        @Override
-        public void onSessionClosed(int promiseId, byte[] sessionId) {
-            assertTrue(mProxyCallbacks != null);
-            mProxyCallbacks.onSessionClosed(promiseId, sessionId);
-        }
-
-        @Override
-        public void onSessionMessage(byte[] sessionId,
-                                     int sessionMessageType,
-                                     byte[] request) {
-            assertTrue(mProxyCallbacks != null);
-            mProxyCallbacks.onSessionMessage(sessionId, sessionMessageType, request);
-        }
-
-        @Override
-        public void onSessionError(byte[] sessionId,
-                                   String message) {
-            assertTrue(mProxyCallbacks != null);
-            mProxyCallbacks.onSessionError(sessionId, message);
-        }
-
-        @Override
-        public void onSessionBatchedKeyChanged(byte[] sessionId,
-                                               SessionKeyInfo[] keyInfos) {
-            assertTrue(mProxyCallbacks != null);
-            mProxyCallbacks.onSessionBatchedKeyChanged(sessionId, keyInfos);
-        }
-
-        @Override
-        public void onRejectPromise(int promiseId, String message) {
-            if (DEBUG) Log.d(LOGTAG, message);
-            assertTrue(mProxyCallbacks != null);
-            mProxyCallbacks.onRejectPromise(promiseId, message);
-        }
-    } // CallbacksForwarder
-
-    private static void assertTrue(boolean condition) {
-        if (DEBUG && !condition) {
-          throw new AssertionError("Expected condition to be true");
-        }
-      }
-
-    LocalMediaDrmBridge(String keySystem) throws Exception {
-        if (AppConstants.Versions.preLollipop) {
-            mBridge = null;
-        } else if (AppConstants.Versions.feature21Plus &&
-                   AppConstants.Versions.preMarshmallow) {
-            mBridge = new GeckoMediaDrmBridgeV21(keySystem);
-        } else {
-            mBridge = new GeckoMediaDrmBridgeV23(keySystem);
-        }
-    }
-
-    @Override
-    public synchronized void setCallbacks(Callbacks callbacks) {
-        if (DEBUG) Log.d(LOGTAG, "setCallbacks()");
-        mCallbacksFwd = new CallbacksForwarder(callbacks);
-        assertTrue(mBridge != null);
-        mBridge.setCallbacks(mCallbacksFwd);
-    }
-
-    @Override
-    public synchronized void createSession(int createSessionToken,
-                                           int promiseId,
-                                           String initDataType,
-                                           byte[] initData) {
-        if (DEBUG) Log.d(LOGTAG, "createSession()");
-        assertTrue(mCallbacksFwd != null);
-        try {
-            mBridge.createSession(createSessionToken, promiseId, initDataType, initData);
-        } catch (Exception e) {
-            Log.e(LOGTAG, "Failed to createSession.", e);
-            mCallbacksFwd.onRejectPromise(promiseId, "Failed to createSession.");
-        }
-    }
-
-    @Override
-    public synchronized void updateSession(int promiseId, String sessionId, byte[] response) {
-        if (DEBUG) Log.d(LOGTAG, "updateSession()");
-        assertTrue(mCallbacksFwd != null);
-        try {
-            mBridge.updateSession(promiseId, sessionId, response);
-        } catch (Exception e) {
-            Log.e(LOGTAG, "Failed to updateSession.", e);
-            mCallbacksFwd.onRejectPromise(promiseId, "Failed to updateSession.");
-        }
-    }
-
-    @Override
-    public synchronized void closeSession(int promiseId, String sessionId) {
-        if (DEBUG) Log.d(LOGTAG, "closeSession()");
-        assertTrue(mCallbacksFwd != null);
-        try {
-            mBridge.closeSession(promiseId, sessionId);
-        } catch (Exception e) {
-            Log.e(LOGTAG, "Failed to closeSession.", e);
-            mCallbacksFwd.onRejectPromise(promiseId, "Failed to closeSession.");
-        }
-    }
-
-    @Override
-    public synchronized void release() {
-        if (DEBUG) Log.d(LOGTAG, "release()");
-        try {
-            mBridge.release();
-            mBridge = null;
-            mCallbacksFwd = null;
-        } catch (Exception e) {
-            Log.e(LOGTAG, "Failed to release", e);
-        }
-    }
-
-    @Override
-    public synchronized MediaCrypto getMediaCrypto() {
-        if (DEBUG) Log.d(LOGTAG, "getMediaCrypto()");
-        return mBridge != null ? mBridge.getMediaCrypto() : null;
-    }
-}
--- a/mobile/android/base/moz.build
+++ b/mobile/android/base/moz.build
@@ -551,20 +551,17 @@ gbjar.sources += ['java/org/mozilla/geck
     'mdns/MulticastDNSManager.java',
     'media/AsyncCodec.java',
     'media/AsyncCodecFactory.java',
     'media/AudioFocusAgent.java',
     'media/Codec.java',
     'media/CodecProxy.java',
     'media/FormatParam.java',
     'media/GeckoMediaDrm.java',
-    'media/GeckoMediaDrmBridgeV21.java',
-    'media/GeckoMediaDrmBridgeV23.java',
     'media/JellyBeanAsyncCodec.java',
-    'media/LocalMediaDrmBridge.java',
     'media/MediaControlService.java',
     'media/MediaDrmProxy.java',
     'media/MediaManager.java',
     'media/RemoteManager.java',
     'media/Sample.java',
     'media/SamplePool.java',
     'media/SessionKeyInfo.java',
     'media/VideoPlayer.java',