Bug 1316013 - Fixed by removing variables and building them as part of the Log statement (which never gets called because DEBUG is set to FALSE). r=sebastian
authorSwaroop Rao <swaroop.rao@gmail.com>
Wed, 16 Nov 2016 09:12:36 -0500
changeset 323020 f0f2dbc18d18
parent 323019 3560e9d6576b
child 323021 2fded03e0b2d
push id30966
push userphilringnalda@gmail.com
push date2016-11-18 03:14 +0000
treeherdermozilla-central@741cfaed340d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssebastian
bugs1316013
milestone53.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 1316013 - Fixed by removing variables and building them as part of the Log statement (which never gets called because DEBUG is set to FALSE). r=sebastian MozReview-Commit-ID: 7nWeXG50KLQ
mobile/android/base/java/org/mozilla/gecko/media/GeckoMediaDrmBridgeV21.java
--- a/mobile/android/base/java/org/mozilla/gecko/media/GeckoMediaDrmBridgeV21.java
+++ b/mobile/android/base/java/org/mozilla/gecko/media/GeckoMediaDrmBridgeV21.java
@@ -140,17 +140,16 @@ public class GeckoMediaDrmBridgeV21 impl
         if (mProvisioningPromiseId > 0 && mCrypto == null) {
             if (DEBUG) Log.d(LOGTAG, "Pending createSession because it's provisioning !");
             savePendingCreateSessionData(createSessionToken, promiseId,
                                          initData, initDataType);
             return;
         }
 
         ByteBuffer sessionId = null;
-        String strSessionId = null;
         try {
             boolean hasMediaCrypto = ensureMediaCryptoCreated();
             if (!hasMediaCrypto) {
                 onRejectPromise(promiseId, "MediaCrypto intance is not created !");
                 return;
             }
 
             sessionId = openSession();
@@ -168,19 +167,18 @@ public class GeckoMediaDrmBridgeV21 impl
             onSessionCreated(createSessionToken,
                              promiseId,
                              sessionId.array(),
                              request.getData());
             onSessionMessage(sessionId.array(),
                              LICENSE_REQUEST_INITIAL,
                              request.getData());
             mSessionMIMETypes.put(sessionId, initDataType);
-            strSessionId = new String(sessionId.array());
             mSessionIds.add(sessionId);
-            if (DEBUG) Log.d(LOGTAG, " StringID : " + strSessionId + " is put into mSessionIds ");
+            if (DEBUG) Log.d(LOGTAG, " StringID : " + new String(sessionId.array()) + " is put into mSessionIds ");
         } catch (android.media.NotProvisionedException e) {
             if (DEBUG) Log.d(LOGTAG, "Device not provisioned:" + e.getMessage());
             if (sessionId != null) {
                 // The promise of this createSession will be either resolved
                 // or rejected after provisioning.
                 mDrm.closeSession(sessionId.array());
             }
             savePendingCreateSessionData(createSessionToken, promiseId,
@@ -361,30 +359,29 @@ public class GeckoMediaDrmBridgeV21 impl
             }
             ByteBuffer session = ByteBuffer.wrap(sessionArray);
             if (!sessionExists(session)) {
                 if (DEBUG) Log.d(LOGTAG, "MediaDrmListener: Invalid session.");
                 return;
             }
             // On L, these events are treated as exceptions and handled correspondingly.
             // Leaving this code block for logging message.
-            String sessionId = new String(session.array());
             switch (event) {
                 case MediaDrm.EVENT_PROVISION_REQUIRED:
                     if (DEBUG) Log.d(LOGTAG, "MediaDrm.EVENT_PROVISION_REQUIRED");
                     break;
                 case MediaDrm.EVENT_KEY_REQUIRED:
                     if (DEBUG) Log.d(LOGTAG, "MediaDrm.EVENT_KEY_REQUIRED");
                     // No need to handle here if we're not in privacy mode.
                     break;
                 case MediaDrm.EVENT_KEY_EXPIRED:
-                    if (DEBUG) Log.d(LOGTAG, "MediaDrm.EVENT_KEY_EXPIRED, sessionId=" + sessionId);
+                    if (DEBUG) Log.d(LOGTAG, "MediaDrm.EVENT_KEY_EXPIRED, sessionId=" + new String(session.array()));
                     break;
                 case MediaDrm.EVENT_VENDOR_DEFINED:
-                    if (DEBUG) Log.d(LOGTAG, "MediaDrm.EVENT_VENDOR_DEFINED, sessionId=" + sessionId);
+                    if (DEBUG) Log.d(LOGTAG, "MediaDrm.EVENT_VENDOR_DEFINED, sessionId=" + new String(session.array()));
                     break;
                 default:
                     if (DEBUG) Log.d(LOGTAG, "Invalid DRM event " + event);
                     return;
             }
         }
     }
 
@@ -582,19 +579,18 @@ public class GeckoMediaDrmBridgeV21 impl
             if (mCryptoSessionId == null) {
                 if (DEBUG) Log.d(LOGTAG, "Cannot open session for MediaCrypto");
                 return false;
             }
 
             if (MediaCrypto.isCryptoSchemeSupported(mSchemeUUID)) {
                 final byte [] cryptoSessionId = mCryptoSessionId.array();
                 mCrypto = new MediaCrypto(mSchemeUUID, cryptoSessionId);
-                String strCryptoSessionId = new String(cryptoSessionId);
                 mSessionIds.add(mCryptoSessionId);
-                if (DEBUG) Log.d(LOGTAG, "MediaCrypto successfully created! - SId " + INVALID_SESSION_ID + ", " + strCryptoSessionId);
+                if (DEBUG) Log.d(LOGTAG, "MediaCrypto successfully created! - SId " + INVALID_SESSION_ID + ", " + new String(cryptoSessionId));
                 return true;
             } else {
                 if (DEBUG) Log.d(LOGTAG, "Cannot create MediaCrypto for unsupported scheme.");
                 return false;
             }
         } catch (android.media.MediaCryptoException e) {
             if (DEBUG) Log.d(LOGTAG, "Cannot create MediaCrypto:" + e.getMessage());
             release();