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.TargetApi; | 7 import android.annotation.TargetApi; |
8 import android.media.MediaCrypto; | 8 import android.media.MediaCrypto; |
9 import android.media.MediaDrm; | 9 import android.media.MediaDrm; |
10 import android.os.Build; | 10 import android.os.Build; |
(...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
689 * @param promiseId Promise ID of this call. | 689 * @param promiseId Promise ID of this call. |
690 */ | 690 */ |
691 @CalledByNative | 691 @CalledByNative |
692 private void updateSession(byte[] sessionId, byte[] response, long promiseId
) { | 692 private void updateSession(byte[] sessionId, byte[] response, long promiseId
) { |
693 Log.d(TAG, "updateSession()"); | 693 Log.d(TAG, "updateSession()"); |
694 if (mMediaDrm == null) { | 694 if (mMediaDrm == null) { |
695 onPromiseRejected(promiseId, "updateSession() called when MediaDrm i
s null."); | 695 onPromiseRejected(promiseId, "updateSession() called when MediaDrm i
s null."); |
696 return; | 696 return; |
697 } | 697 } |
698 | 698 |
699 // TODO(xhwang): DCHECK this when prefixed EME is deprecated. | 699 // TODO(xhwang): DCHECK this now that prefixed EME is deprecated. |
| 700 // https://crbug.com/249976 |
700 if (!sessionExists(sessionId)) { | 701 if (!sessionExists(sessionId)) { |
701 onPromiseRejected( | 702 onPromiseRejected( |
702 promiseId, "Invalid session in updateSession: " + bytesToHex
String(sessionId)); | 703 promiseId, "Invalid session in updateSession: " + bytesToHex
String(sessionId)); |
703 return; | 704 return; |
704 } | 705 } |
705 | 706 |
706 try { | 707 try { |
707 try { | 708 try { |
708 mMediaDrm.provideKeyResponse(sessionId, response); | 709 mMediaDrm.provideKeyResponse(sessionId, response); |
709 } catch (java.lang.IllegalStateException e) { | 710 } catch (java.lang.IllegalStateException e) { |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1002 private native void nativeOnSessionKeysChange(long nativeMediaDrmBridge, byt
e[] sessionId, | 1003 private native void nativeOnSessionKeysChange(long nativeMediaDrmBridge, byt
e[] sessionId, |
1003 Object[] keysInfo, boolean hasAdditionalUsableKey); | 1004 Object[] keysInfo, boolean hasAdditionalUsableKey); |
1004 private native void nativeOnSessionExpirationUpdate( | 1005 private native void nativeOnSessionExpirationUpdate( |
1005 long nativeMediaDrmBridge, byte[] sessionId, long expirationTime); | 1006 long nativeMediaDrmBridge, byte[] sessionId, long expirationTime); |
1006 private native void nativeOnLegacySessionError( | 1007 private native void nativeOnLegacySessionError( |
1007 long nativeMediaDrmBridge, byte[] sessionId, String errorMessage); | 1008 long nativeMediaDrmBridge, byte[] sessionId, String errorMessage); |
1008 | 1009 |
1009 private native void nativeOnResetDeviceCredentialsCompleted( | 1010 private native void nativeOnResetDeviceCredentialsCompleted( |
1010 long nativeMediaDrmBridge, boolean success); | 1011 long nativeMediaDrmBridge, boolean success); |
1011 } | 1012 } |
OLD | NEW |