Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(33)

Unified Diff: media/base/android/java/src/org/chromium/media/MediaDrmBridge.java

Issue 1071413002: MediaDrmBridge: guards MediaDrm.removeKeys call in case of failure. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: adds comments about the try/catch Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/android/java/src/org/chromium/media/MediaDrmBridge.java
diff --git a/media/base/android/java/src/org/chromium/media/MediaDrmBridge.java b/media/base/android/java/src/org/chromium/media/MediaDrmBridge.java
index 2c5adf3846b12b306d3216d897de187735c537b9..8f32ccb85b000a9c9c511f5d1424cfaffbc902cb 100644
--- a/media/base/android/java/src/org/chromium/media/MediaDrmBridge.java
+++ b/media/base/android/java/src/org/chromium/media/MediaDrmBridge.java
@@ -378,7 +378,12 @@ public class MediaDrmBridge {
mPendingCreateSessionDataQueue = null;
for (ByteBuffer sessionId : mSessionIds.keySet()) {
- mMediaDrm.removeKeys(sessionId.array());
+ try {
+ // Some implementations don't have removeKeys, crbug/475632
+ mMediaDrm.removeKeys(sessionId.array());
+ } catch (Exception e) {
+ Log.e(TAG, "removeKeys failed: ", e);
+ }
mMediaDrm.closeSession(sessionId.array());
onSessionClosed(sessionId.array());
}
@@ -568,7 +573,12 @@ public class MediaDrmBridge {
return;
}
- mMediaDrm.removeKeys(sessionId);
+ try {
+ // Some implementations don't have removeKeys, crbug/475632
+ mMediaDrm.removeKeys(sessionId);
+ } catch (Exception e) {
+ Log.e(TAG, "removeKeys failed: ", e);
+ }
mMediaDrm.closeSession(sessionId);
mSessionIds.remove(ByteBuffer.wrap(sessionId));
onPromiseResolved(promiseId);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698