| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.media; | 5 package org.chromium.media; |
| 6 | 6 |
| 7 import android.annotation.SuppressLint; | 7 import android.annotation.SuppressLint; |
| 8 import android.annotation.TargetApi; | 8 import android.annotation.TargetApi; |
| 9 import android.media.MediaCrypto; | 9 import android.media.MediaCrypto; |
| 10 import android.media.MediaDrm; | 10 import android.media.MediaDrm; |
| (...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 745 * @param promiseId Promise ID of this call. | 745 * @param promiseId Promise ID of this call. |
| 746 */ | 746 */ |
| 747 @CalledByNative | 747 @CalledByNative |
| 748 private void updateSession(byte[] sessionId, byte[] response, long promiseId
) { | 748 private void updateSession(byte[] sessionId, byte[] response, long promiseId
) { |
| 749 Log.d(TAG, "updateSession()"); | 749 Log.d(TAG, "updateSession()"); |
| 750 if (mMediaDrm == null) { | 750 if (mMediaDrm == null) { |
| 751 onPromiseRejected(promiseId, "updateSession() called when MediaDrm i
s null."); | 751 onPromiseRejected(promiseId, "updateSession() called when MediaDrm i
s null."); |
| 752 return; | 752 return; |
| 753 } | 753 } |
| 754 | 754 |
| 755 // TODO(xhwang): DCHECK this now that prefixed EME is deprecated. | |
| 756 // https://crbug.com/249976 | |
| 757 if (!sessionExists(sessionId)) { | 755 if (!sessionExists(sessionId)) { |
| 756 assert false; // Should never happen. |
| 758 onPromiseRejected( | 757 onPromiseRejected( |
| 759 promiseId, "Invalid session in updateSession: " + bytesToHex
String(sessionId)); | 758 promiseId, "Invalid session in updateSession: " + bytesToHex
String(sessionId)); |
| 760 return; | 759 return; |
| 761 } | 760 } |
| 762 | 761 |
| 763 try { | 762 try { |
| 764 try { | 763 try { |
| 765 mMediaDrm.provideKeyResponse(sessionId, response); | 764 mMediaDrm.provideKeyResponse(sessionId, response); |
| 766 } catch (java.lang.IllegalStateException e) { | 765 } catch (java.lang.IllegalStateException e) { |
| 767 // This is not really an exception. Some error code are incorrec
tly | 766 // This is not really an exception. Some error code are incorrec
tly |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1062 private native void nativeOnSessionKeysChange(long nativeMediaDrmBridge, byt
e[] sessionId, | 1061 private native void nativeOnSessionKeysChange(long nativeMediaDrmBridge, byt
e[] sessionId, |
| 1063 Object[] keysInfo, boolean hasAdditionalUsableKey); | 1062 Object[] keysInfo, boolean hasAdditionalUsableKey); |
| 1064 private native void nativeOnSessionExpirationUpdate( | 1063 private native void nativeOnSessionExpirationUpdate( |
| 1065 long nativeMediaDrmBridge, byte[] sessionId, long expirationTime); | 1064 long nativeMediaDrmBridge, byte[] sessionId, long expirationTime); |
| 1066 private native void nativeOnLegacySessionError( | 1065 private native void nativeOnLegacySessionError( |
| 1067 long nativeMediaDrmBridge, byte[] sessionId, String errorMessage); | 1066 long nativeMediaDrmBridge, byte[] sessionId, String errorMessage); |
| 1068 | 1067 |
| 1069 private native void nativeOnResetDeviceCredentialsCompleted( | 1068 private native void nativeOnResetDeviceCredentialsCompleted( |
| 1070 long nativeMediaDrmBridge, boolean success); | 1069 long nativeMediaDrmBridge, boolean success); |
| 1071 } | 1070 } |
| OLD | NEW |