|
|
Created:
5 years ago by xhwang Modified:
4 years, 11 months ago CC:
chromium-reviews, posciak+watch_chromium.org, feature-media-reviews_chromium.org, avayvod+watch_chromium.org, mcasas+watch_chromium.org, mlamouri+watch-media_chromium.org Base URL:
https://chromium.googlesource.com/chromium/src.git@master Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
Descriptionmedia: Create MediaCrypto upon MediaDrmBridge creation.
- Create MediaCrypto right after MediaDrmBridge construction or after
provisioning is successfully completed.
- Do not store mMediaCrypto in Java.
Tests:
- MediaCrypto creation on provisioned device.
- MediaCrypto creation on unprovisioned device with successful provisioning.
- MediaCrypto creation on unprovisioned device with failed provisioning (so null
MediaCrypto was notified).
BUG=564246
TEST=See above.
Committed: https://crrev.com/4a1a996e31209104d3eabda56234c55596c0d1a6
Cr-Commit-Position: refs/heads/master@{#368438}
Patch Set 1 #
Total comments: 6
Patch Set 2 : comments addressed #Patch Set 3 : drop mAllowsSession #Patch Set 4 : rebase only #
Total comments: 4
Patch Set 5 : comments addressed #
Total comments: 4
Patch Set 6 : comments addressed #
Messages
Total messages: 29 (10 generated)
Description was changed from ========== media: Create MediaCrypto upon MediaDrmBridge construction. Tests: - MediaCrypto creation on provisioned device. - MediaCrypto creation on unprovisioned device with successful provisioning. - MediaCrypto creation on unprovisioned device with failed provisioning (so null MediaCrypto was notified). BUG=564246 TEST=See above. ========== to ========== media: Create MediaCrypto upon MediaDrmBridge creation. Tests: - MediaCrypto creation on provisioned device. - MediaCrypto creation on unprovisioned device with successful provisioning. - MediaCrypto creation on unprovisioned device with failed provisioning (so null MediaCrypto was notified). BUG=564246 TEST=See above. ==========
xhwang@chromium.org changed reviewers: + qinmin@chromium.org, timav@chromium.org
Description was changed from ========== media: Create MediaCrypto upon MediaDrmBridge creation. Tests: - MediaCrypto creation on provisioned device. - MediaCrypto creation on unprovisioned device with successful provisioning. - MediaCrypto creation on unprovisioned device with failed provisioning (so null MediaCrypto was notified). BUG=564246 TEST=See above. ========== to ========== media: Create MediaCrypto upon MediaDrmBridge creation. - Add allowsSession to distinguish between normal and sessionless MediaDrmBridge. - Try to create MediaCrypto right after MediaDrmBridge construction if "allowsSession". - Do not store mMediaCrypto in Java. Tests: - MediaCrypto creation on provisioned device. - MediaCrypto creation on unprovisioned device with successful provisioning. - MediaCrypto creation on unprovisioned device with failed provisioning (so null MediaCrypto was notified). BUG=564246 TEST=See above. ==========
timav / qinmin: I am not super happy with the follow of this CL, but this is the best I can get. I guess I am not super familiar with how to deal with exceptions. Any suggestions are welcome. PTAL!
https://chromiumcodereview.appspot.com/1540033002/diff/1/media/base/android/j... File media/base/android/java/src/org/chromium/media/MediaDrmBridge.java (right): https://chromiumcodereview.appspot.com/1540033002/diff/1/media/base/android/j... media/base/android/java/src/org/chromium/media/MediaDrmBridge.java:246: if (MediaCrypto.isCryptoSchemeSupported(mSchemeUUID)) { create() already calls MediaDrm.isCryptoSchemeSupported(), is this call redundant? This is MediaCrypto and not MediaDrm, but both methods are static... https://chromiumcodereview.appspot.com/1540033002/diff/1/media/base/android/j... media/base/android/java/src/org/chromium/media/MediaDrmBridge.java:344: if (allowsSession && !mediaDrmBridge.createMediaCrypto()) { [Q]: Do I get it right that if device has been provisioned and we cannot create the media crypto, we will fail MediaDrmBridge creation; whereas if the device has not been provisioned, then we will create MediaDrmBridge, provision the device, and then if the MediaCrypto creation fails, report an error by onMediaCryptoReady()? https://chromiumcodereview.appspot.com/1540033002/diff/1/media/base/android/j... media/base/android/java/src/org/chromium/media/MediaDrmBridge.java:792: release(); Does this release() call onMediaCryptoReady(null) even for mAllowSession == false, in other words, when a caller is not interested in onMediaCryptoReady()?
comments addressed
PTAL again! https://chromiumcodereview.appspot.com/1540033002/diff/1/media/base/android/j... File media/base/android/java/src/org/chromium/media/MediaDrmBridge.java (right): https://chromiumcodereview.appspot.com/1540033002/diff/1/media/base/android/j... media/base/android/java/src/org/chromium/media/MediaDrmBridge.java:246: if (MediaCrypto.isCryptoSchemeSupported(mSchemeUUID)) { On 2015/12/22 00:16:21, Tima Vaisburd wrote: > create() already calls MediaDrm.isCryptoSchemeSupported(), is this call > redundant? This is MediaCrypto and not MediaDrm, but both methods are static... It "should be" redundant, but there's no such guarantee based on Android documentation. I'd like to err on the safer side. https://chromiumcodereview.appspot.com/1540033002/diff/1/media/base/android/j... media/base/android/java/src/org/chromium/media/MediaDrmBridge.java:344: if (allowsSession && !mediaDrmBridge.createMediaCrypto()) { On 2015/12/22 00:16:21, Tima Vaisburd wrote: > [Q]: Do I get it right that if device has been provisioned and we cannot create > the media crypto, we will fail MediaDrmBridge creation; whereas if the device > has not been provisioned, then we will create MediaDrmBridge, provision the > device, and then if the MediaCrypto creation fails, report an error by > onMediaCryptoReady()? Correct. I see your worries about having different ways to report the same error. But on the other side, I am kinda following the idea of "fail-fast" [1]. We have to handle creation failure at the caller anyways so this "fragmentation" doesn't make the caller more "fragmented". [1] https://en.wikipedia.org/wiki/Fail-fast https://chromiumcodereview.appspot.com/1540033002/diff/1/media/base/android/j... media/base/android/java/src/org/chromium/media/MediaDrmBridge.java:792: release(); On 2015/12/22 00:16:21, Tima Vaisburd wrote: > Does this release() call onMediaCryptoReady(null) even for mAllowSession == > false, in other words, when a caller is not interested in onMediaCryptoReady()? Good point. Updated release(). As I said, I don't like the current implementation but don't have better ideas right now (at least for M49). Suggestions are welcome!
BTW, now I don't really like mAllowsSession. How about we don't differentiate normal mode and sessionless mode in the Java code? The only issue would be that we will be creating MediaCrypto when users try to reset credentials. But as discussed offline, MediaCrypto creation is fairly cheap. Also, I don't think "credential resetting" is used very often. Maybe it's not worth complicating our code only for this minor saving? WDYT?
On 2016/01/07 22:35:26, xhwang wrote: > BTW, now I don't really like mAllowsSession. How about we don't differentiate > normal mode and sessionless mode in the Java code? The only issue would be that > we will be creating MediaCrypto when users try to reset credentials. But as > discussed offline, MediaCrypto creation is fairly cheap. Also, I don't think > "credential resetting" is used very often. Maybe it's not worth complicating our > code only for this minor saving? > > WDYT? I agree
Updated. PTAL again!
Description was changed from ========== media: Create MediaCrypto upon MediaDrmBridge creation. - Add allowsSession to distinguish between normal and sessionless MediaDrmBridge. - Try to create MediaCrypto right after MediaDrmBridge construction if "allowsSession". - Do not store mMediaCrypto in Java. Tests: - MediaCrypto creation on provisioned device. - MediaCrypto creation on unprovisioned device with successful provisioning. - MediaCrypto creation on unprovisioned device with failed provisioning (so null MediaCrypto was notified). BUG=564246 TEST=See above. ========== to ========== media: Create MediaCrypto upon MediaDrmBridge creation. - Create MediaCrypto right after MediaDrmBridge construction or after provisioning is successfully completed. - Do not store mMediaCrypto in Java. Tests: - MediaCrypto creation on provisioned device. - MediaCrypto creation on unprovisioned device with successful provisioning. - MediaCrypto creation on unprovisioned device with failed provisioning (so null MediaCrypto was notified). BUG=564246 TEST=See above. ==========
rebase only
The CQ bit was checked by xhwang@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1540033002/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1540033002/60001
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
lgtm % nits https://chromiumcodereview.appspot.com/1540033002/diff/60001/media/base/andro... File media/base/android/java/src/org/chromium/media/MediaDrmBridge.java (right): https://chromiumcodereview.appspot.com/1540033002/diff/60001/media/base/andro... media/base/android/java/src/org/chromium/media/MediaDrmBridge.java:229: Log.e(TAG, "Device not provisioned", e); nit: This is not an error: device is not provisioned yet, we need to do provisioninig. I'd change Log.e() to Log.i() or Log.d(). https://chromiumcodereview.appspot.com/1540033002/diff/60001/media/base/andro... media/base/android/java/src/org/chromium/media/MediaDrmBridge.java:357: nit: assert mMediaDrm != null; ?
comments addressed
qinmin: Do you also want to take a look? https://chromiumcodereview.appspot.com/1540033002/diff/60001/media/base/andro... File media/base/android/java/src/org/chromium/media/MediaDrmBridge.java (right): https://chromiumcodereview.appspot.com/1540033002/diff/60001/media/base/andro... media/base/android/java/src/org/chromium/media/MediaDrmBridge.java:229: Log.e(TAG, "Device not provisioned", e); On 2016/01/08 19:38:03, Tima Vaisburd wrote: > nit: This is not an error: device is not provisioned yet, we need to do > provisioninig. I'd change Log.e() to Log.i() or Log.d(). Done. https://chromiumcodereview.appspot.com/1540033002/diff/60001/media/base/andro... media/base/android/java/src/org/chromium/media/MediaDrmBridge.java:357: On 2016/01/08 19:38:03, Tima Vaisburd wrote: > nit: assert mMediaDrm != null; ? Done.
lgtm % comments https://chromiumcodereview.appspot.com/1540033002/diff/80001/media/base/andro... File media/base/android/java/src/org/chromium/media/MediaDrmBridge.java (right): https://chromiumcodereview.appspot.com/1540033002/diff/80001/media/base/andro... media/base/android/java/src/org/chromium/media/MediaDrmBridge.java:341: return null; this can be moved to the above line as they fit the character limit https://chromiumcodereview.appspot.com/1540033002/diff/80001/media/base/andro... media/base/android/java/src/org/chromium/media/MediaDrmBridge.java:787: if (!success) { I think you can merge this if and the if block below: success = success && (mMediaCryptoSession != null || createMediaCrypto()); if (!success) { release(); return; }
comments addressed
https://chromiumcodereview.appspot.com/1540033002/diff/80001/media/base/andro... File media/base/android/java/src/org/chromium/media/MediaDrmBridge.java (right): https://chromiumcodereview.appspot.com/1540033002/diff/80001/media/base/andro... media/base/android/java/src/org/chromium/media/MediaDrmBridge.java:341: return null; On 2016/01/08 20:25:45, qinmin wrote: > this can be moved to the above line as they fit the character limit git cl format likes the current style :) https://chromiumcodereview.appspot.com/1540033002/diff/80001/media/base/andro... media/base/android/java/src/org/chromium/media/MediaDrmBridge.java:787: if (!success) { On 2016/01/08 20:25:45, qinmin wrote: > I think you can merge this if and the if block below: > > > success = success && (mMediaCryptoSession != null || createMediaCrypto()); > > if (!success) { > release(); > return; > } Done.
The CQ bit was checked by xhwang@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from timav@chromium.org, qinmin@chromium.org Link to the patchset: https://chromiumcodereview.appspot.com/1540033002/#ps100001 (title: "comments addressed")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1540033002/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1540033002/100001
Message was sent while issue was closed.
Description was changed from ========== media: Create MediaCrypto upon MediaDrmBridge creation. - Create MediaCrypto right after MediaDrmBridge construction or after provisioning is successfully completed. - Do not store mMediaCrypto in Java. Tests: - MediaCrypto creation on provisioned device. - MediaCrypto creation on unprovisioned device with successful provisioning. - MediaCrypto creation on unprovisioned device with failed provisioning (so null MediaCrypto was notified). BUG=564246 TEST=See above. ========== to ========== media: Create MediaCrypto upon MediaDrmBridge creation. - Create MediaCrypto right after MediaDrmBridge construction or after provisioning is successfully completed. - Do not store mMediaCrypto in Java. Tests: - MediaCrypto creation on provisioned device. - MediaCrypto creation on unprovisioned device with successful provisioning. - MediaCrypto creation on unprovisioned device with failed provisioning (so null MediaCrypto was notified). BUG=564246 TEST=See above. ==========
Message was sent while issue was closed.
Committed patchset #6 (id:100001)
Message was sent while issue was closed.
Description was changed from ========== media: Create MediaCrypto upon MediaDrmBridge creation. - Create MediaCrypto right after MediaDrmBridge construction or after provisioning is successfully completed. - Do not store mMediaCrypto in Java. Tests: - MediaCrypto creation on provisioned device. - MediaCrypto creation on unprovisioned device with successful provisioning. - MediaCrypto creation on unprovisioned device with failed provisioning (so null MediaCrypto was notified). BUG=564246 TEST=See above. ========== to ========== media: Create MediaCrypto upon MediaDrmBridge creation. - Create MediaCrypto right after MediaDrmBridge construction or after provisioning is successfully completed. - Do not store mMediaCrypto in Java. Tests: - MediaCrypto creation on provisioned device. - MediaCrypto creation on unprovisioned device with successful provisioning. - MediaCrypto creation on unprovisioned device with failed provisioning (so null MediaCrypto was notified). BUG=564246 TEST=See above. Committed: https://crrev.com/4a1a996e31209104d3eabda56234c55596c0d1a6 Cr-Commit-Position: refs/heads/master@{#368438} ==========
Message was sent while issue was closed.
Patchset 6 (id:??) landed as https://crrev.com/4a1a996e31209104d3eabda56234c55596c0d1a6 Cr-Commit-Position: refs/heads/master@{#368438} |