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

Issue 2765343003: media: Add MediaDrmStorage (Closed)

Created:
3 years, 9 months ago by xhwang
Modified:
3 years, 8 months ago
CC:
chromium-reviews, qsr+mojo_chromium.org, feature-media-reviews_chromium.org, chfremer+watch_chromium.org, viettrungluu+watch_chromium.org, avayvod+watch_chromium.org, yzshen+watch_chromium.org, abarth-chromium, Aaron Boodman, mcasas+watch+vc_chromium.org, alokp+watch_chromium.org, darin (slow to review), mlamouri+watch-media_chromium.org, alokp, jrummell
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

media: Add MediaDrmStorage MediaDrmStorage is an interface that provides persistent storage for MediaDrmBridge. This is needed for per-origin provisioning, and for persistent license support. The real storage is implemented using PrefService, and all the read and write operations happen in the browser process. This makes it easier to manage concurrent access to the storage by multiple MediaDrmBridge instances, and by code implementing related features, e.g. clearing media licenses in "Clear Browsing Data". A mojom MediaDrmStorage interface is added to connect MediaDrmBridge (typically running in the GPU process) and the PrefService running in the browser process. It strictly maps the C++ MediaDrmStorage interface. Here's a summary of the stack: MediaDrmBridge (Java) -> MediaDrmStorageBridge (JNI) -> MediaDrmStorage (C++ interface) -> MojoMediaDrmStorage (C++ interface implementation) -> media::mojom::MojoMediaDrm (mojo interface) -> ------ GPU process ------ mojo IPC ------ Browser process ------ MediaDrmStorageImpl (mojo interface implementation) -> PrefService Note that there's a mojo Preferences service (/services/preferences/). I prototyped it and talked with the owners. It provides some cool features, but is hard to code against when there are multiple clients of the preference. In our case, we could have multiple MediaDrmBridge instances running in the GPU process and UI code clearing media licenses in the Browser process accessing the preference at the same time. Plumbing everything to the browser process makes it much easier to avoid tricky race/synchronization problems, and is recommended by Preferences owners. BUG=493521 Review-Url: https://codereview.chromium.org/2765343003 Cr-Commit-Position: refs/heads/master@{#461479} Committed: https://chromium.googlesource.com/chromium/src/+/116acb96458241e0db329600538a40ae9c3d1abd

Patch Set 1 #

Total comments: 13

Patch Set 2 : Move MediaDrmStorageImpl to components/ #

Total comments: 1

Patch Set 3 : Removed MediaDrmStorageImpl impl (will finish in the next CL) #

Patch Set 4 : fix compile error #

Total comments: 46

Patch Set 5 : comments #

Patch Set 6 : struct #

Patch Set 7 : comments #

Patch Set 8 : Watch RenderFrameDeleted #

Patch Set 9 : media: Add MediaDrmStorage #

Patch Set 10 : rebase only #

Patch Set 11 : a few tweaks #

Patch Set 12 : media: Add MediaDrmStorage #

Total comments: 10

Patch Set 13 : comments addressed #

Total comments: 2

Patch Set 14 : fix DidFinishNavigation #

Patch Set 15 : rebase only #

Unified diffs Side-by-side diffs Delta from patch set Stats (+677 lines, -16 lines) Patch
M chrome/browser/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/chrome_content_browser_client.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +7 lines, -0 lines 0 comments Download
A chrome/browser/media/android/cdm/media_drm_storage_factory.h View 1 1 chunk +21 lines, -0 lines 0 comments Download
A chrome/browser/media/android/cdm/media_drm_storage_factory.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +53 lines, -0 lines 0 comments Download
M chrome/browser/prefs/browser_prefs.cc View 1 2 3 4 5 6 7 8 9 2 chunks +2 lines, -0 lines 0 comments Download
M components/cdm/browser/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 1 chunk +4 lines, -0 lines 0 comments Download
M components/cdm/browser/DEPS View 1 2 3 4 5 6 7 8 9 10 1 chunk +3 lines, -0 lines 0 comments Download
A components/cdm/browser/media_drm_storage_impl.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +69 lines, -0 lines 0 comments Download
A components/cdm/browser/media_drm_storage_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +167 lines, -0 lines 0 comments Download
M media/base/android/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +2 lines, -0 lines 0 comments Download
M media/base/android/android_cdm_factory.h View 3 chunks +4 lines, -1 line 0 comments Download
M media/base/android/android_cdm_factory.cc View 1 2 2 chunks +6 lines, -4 lines 0 comments Download
M media/base/android/media_drm_bridge.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 5 chunks +7 lines, -0 lines 0 comments Download
M media/base/android/media_drm_bridge.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 7 chunks +17 lines, -9 lines 0 comments Download
A media/base/android/media_drm_storage.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +82 lines, -0 lines 0 comments Download
A media/base/android/media_drm_storage.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +21 lines, -0 lines 0 comments Download
M media/mojo/interfaces/BUILD.gn View 1 2 2 chunks +5 lines, -0 lines 0 comments Download
A media/mojo/interfaces/media_drm_storage.mojom View 1 2 3 4 5 1 chunk +34 lines, -0 lines 0 comments Download
M media/mojo/services/BUILD.gn View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M media/mojo/services/android_mojo_media_client.cc View 1 2 3 4 3 chunks +16 lines, -1 line 0 comments Download
M media/mojo/services/gpu_mojo_media_client.cc View 1 2 3 4 5 chunks +18 lines, -1 line 0 comments Download
A media/mojo/services/mojo_media_drm_storage.h View 1 2 3 4 5 1 chunk +50 lines, -0 lines 0 comments Download
A media/mojo/services/mojo_media_drm_storage.cc View 1 2 3 4 5 1 chunk +85 lines, -0 lines 0 comments Download

Messages

Total messages: 90 (49 generated)
xhwang
yucliu: This is the prototype CL I have. The most important part is the new ...
3 years, 9 months ago (2017-03-23 00:25:11 UTC) #3
yucliu1
The patch is good. I think we can use these APIs for storage. https://codereview.chromium.org/2765343003/diff/1/chrome/browser/media/android/cdm/media_drm_storage_impl.cc File ...
3 years, 9 months ago (2017-03-23 01:07:17 UTC) #4
xhwang
https://codereview.chromium.org/2765343003/diff/1/chrome/browser/media/android/cdm/media_drm_storage_impl.cc File chrome/browser/media/android/cdm/media_drm_storage_impl.cc (right): https://codereview.chromium.org/2765343003/diff/1/chrome/browser/media/android/cdm/media_drm_storage_impl.cc#newcode25 chrome/browser/media/android/cdm/media_drm_storage_impl.cc:25: // "origin_id": $origin_id On 2017/03/23 01:07:16, yucliu1 wrote: > ...
3 years, 9 months ago (2017-03-23 05:22:06 UTC) #5
xhwang
https://codereview.chromium.org/2765343003/diff/1/chrome/browser/media/android/cdm/media_drm_storage_impl.cc File chrome/browser/media/android/cdm/media_drm_storage_impl.cc (right): https://codereview.chromium.org/2765343003/diff/1/chrome/browser/media/android/cdm/media_drm_storage_impl.cc#newcode10 chrome/browser/media/android/cdm/media_drm_storage_impl.cc:10: #include "chrome/browser/profiles/profile.h" yucliu: This is the only place where ...
3 years, 9 months ago (2017-03-23 05:25:26 UTC) #6
yucliu1
https://codereview.chromium.org/2765343003/diff/1/chrome/browser/media/android/cdm/media_drm_storage_impl.cc File chrome/browser/media/android/cdm/media_drm_storage_impl.cc (right): https://codereview.chromium.org/2765343003/diff/1/chrome/browser/media/android/cdm/media_drm_storage_impl.cc#newcode10 chrome/browser/media/android/cdm/media_drm_storage_impl.cc:10: #include "chrome/browser/profiles/profile.h" On 2017/03/23 05:25:26, xhwang_slow wrote: > yucliu: ...
3 years, 9 months ago (2017-03-23 16:36:50 UTC) #7
alokp
drive-by comment https://codereview.chromium.org/2765343003/diff/20001/media/mojo/interfaces/media_drm_storage.mojom File media/mojo/interfaces/media_drm_storage.mojom (right): https://codereview.chromium.org/2765343003/diff/20001/media/mojo/interfaces/media_drm_storage.mojom#newcode15 media/mojo/interfaces/media_drm_storage.mojom:15: interface MediaDrmStorage { If you could access ...
3 years, 9 months ago (2017-03-24 04:51:26 UTC) #9
xhwang
On 2017/03/24 04:51:26, alokp wrote: > drive-by comment > > https://codereview.chromium.org/2765343003/diff/20001/media/mojo/interfaces/media_drm_storage.mojom > File media/mojo/interfaces/media_drm_storage.mojom (right): ...
3 years, 9 months ago (2017-03-24 05:03:49 UTC) #10
xhwang
alokp/jrummell: FYI https://codereview.chromium.org/2765343003/diff/80001/components/cdm/browser/media_drm_storage_impl.cc File components/cdm/browser/media_drm_storage_impl.cc (right): https://codereview.chromium.org/2765343003/diff/80001/components/cdm/browser/media_drm_storage_impl.cc#newcode71 components/cdm/browser/media_drm_storage_impl.cc:71: NOTIMPLEMENTED(); Partial implementation of these functions and ...
3 years, 9 months ago (2017-03-24 21:22:38 UTC) #29
xhwang
yucliu1: Please review everything! liberato: Please review from meida/clank/mojo's perspective. It's harder for me to ...
3 years, 9 months ago (2017-03-24 21:26:14 UTC) #31
xhwang
BTW, the CL is mostly interfaces and plumbing so it should be pretty straightforward to ...
3 years, 9 months ago (2017-03-24 21:32:45 UTC) #32
yucliu1
https://codereview.chromium.org/2765343003/diff/80001/chrome/browser/chrome_content_browser_client.cc File chrome/browser/chrome_content_browser_client.cc (right): https://codereview.chromium.org/2765343003/diff/80001/chrome/browser/chrome_content_browser_client.cc#newcode3134 chrome/browser/chrome_content_browser_client.cc:3134: base::Bind(&chrome::CreateMediaDrmStorage, render_frame_host)); Is it possible for media code to ...
3 years, 8 months ago (2017-03-27 19:06:41 UTC) #35
xhwang
Comments only. https://codereview.chromium.org/2765343003/diff/80001/chrome/browser/chrome_content_browser_client.cc File chrome/browser/chrome_content_browser_client.cc (right): https://codereview.chromium.org/2765343003/diff/80001/chrome/browser/chrome_content_browser_client.cc#newcode3134 chrome/browser/chrome_content_browser_client.cc:3134: base::Bind(&chrome::CreateMediaDrmStorage, render_frame_host)); On 2017/03/27 19:06:41, yucliu1 wrote: ...
3 years, 8 months ago (2017-03-27 20:28:46 UTC) #36
xhwang
https://codereview.chromium.org/2765343003/diff/80001/chrome/browser/chrome_content_browser_client.cc File chrome/browser/chrome_content_browser_client.cc (right): https://codereview.chromium.org/2765343003/diff/80001/chrome/browser/chrome_content_browser_client.cc#newcode3134 chrome/browser/chrome_content_browser_client.cc:3134: base::Bind(&chrome::CreateMediaDrmStorage, render_frame_host)); On 2017/03/27 20:28:46, xhwang_slow wrote: > On ...
3 years, 8 months ago (2017-03-27 20:46:33 UTC) #37
xhwang
FYI, the implementation and test are uploaded in https://chromiumcodereview.appspot.com/2780683002/
3 years, 8 months ago (2017-03-27 22:23:02 UTC) #38
liberato (no reviews please)
lgtm % two questions. thanks -fl https://codereview.chromium.org/2765343003/diff/80001/chrome/browser/media/android/cdm/media_drm_storage_factory.cc File chrome/browser/media/android/cdm/media_drm_storage_factory.cc (right): https://codereview.chromium.org/2765343003/diff/80001/chrome/browser/media/android/cdm/media_drm_storage_factory.cc#newcode39 chrome/browser/media/android/cdm/media_drm_storage_factory.cc:39: PrefService* pref_service = ...
3 years, 8 months ago (2017-03-28 16:42:44 UTC) #39
yucliu1
lgtm https://codereview.chromium.org/2765343003/diff/80001/media/mojo/services/mojo_media_drm_storage.cc File media/mojo/services/mojo_media_drm_storage.cc (right): https://codereview.chromium.org/2765343003/diff/80001/media/mojo/services/mojo_media_drm_storage.cc#newcode21 media/mojo/services/mojo_media_drm_storage.cc:21: void MojoMediaDrmStorage::Initialize(const url::Origin& origin) { I think all ...
3 years, 8 months ago (2017-03-28 18:10:20 UTC) #40
xhwang
https://codereview.chromium.org/2765343003/diff/80001/media/mojo/services/mojo_media_drm_storage.cc File media/mojo/services/mojo_media_drm_storage.cc (right): https://codereview.chromium.org/2765343003/diff/80001/media/mojo/services/mojo_media_drm_storage.cc#newcode21 media/mojo/services/mojo_media_drm_storage.cc:21: void MojoMediaDrmStorage::Initialize(const url::Origin& origin) { On 2017/03/28 18:10:20, yucliu1 ...
3 years, 8 months ago (2017-03-28 20:57:09 UTC) #41
xhwang
dcheng: PTAL!
3 years, 8 months ago (2017-03-28 20:57:22 UTC) #42
dcheng
https://codereview.chromium.org/2765343003/diff/80001/chrome/browser/media/android/cdm/media_drm_storage_factory.cc File chrome/browser/media/android/cdm/media_drm_storage_factory.cc (right): https://codereview.chromium.org/2765343003/diff/80001/chrome/browser/media/android/cdm/media_drm_storage_factory.cc#newcode28 chrome/browser/media/android/cdm/media_drm_storage_factory.cc:28: if (!web_contents) I'm curious how many of these early ...
3 years, 8 months ago (2017-03-29 01:17:23 UTC) #43
xhwang
dcheng: Thanks for the comments. PTAL again! https://codereview.chromium.org/2765343003/diff/80001/chrome/browser/media/android/cdm/media_drm_storage_factory.cc File chrome/browser/media/android/cdm/media_drm_storage_factory.cc (right): https://codereview.chromium.org/2765343003/diff/80001/chrome/browser/media/android/cdm/media_drm_storage_factory.cc#newcode28 chrome/browser/media/android/cdm/media_drm_storage_factory.cc:28: if (!web_contents) ...
3 years, 8 months ago (2017-03-29 20:47:26 UTC) #44
dcheng
https://codereview.chromium.org/2765343003/diff/80001/components/cdm/browser/media_drm_storage_impl.cc File components/cdm/browser/media_drm_storage_impl.cc (right): https://codereview.chromium.org/2765343003/diff/80001/components/cdm/browser/media_drm_storage_impl.cc#newcode63 components/cdm/browser/media_drm_storage_impl.cc:63: origin_ = origin.Serialize(); On 2017/03/29 20:47:25, xhwang_slow wrote: > ...
3 years, 8 months ago (2017-03-29 21:15:12 UTC) #45
xhwang
comments-only https://codereview.chromium.org/2765343003/diff/80001/components/cdm/browser/media_drm_storage_impl.cc File components/cdm/browser/media_drm_storage_impl.cc (right): https://codereview.chromium.org/2765343003/diff/80001/components/cdm/browser/media_drm_storage_impl.cc#newcode63 components/cdm/browser/media_drm_storage_impl.cc:63: origin_ = origin.Serialize(); On 2017/03/29 21:15:12, dcheng wrote: ...
3 years, 8 months ago (2017-03-29 21:30:44 UTC) #46
xhwang
dcheng: I updated the CL to use a struct for the session data. PTAnotherL! Thanks! ...
3 years, 8 months ago (2017-03-30 00:04:24 UTC) #48
dcheng
https://codereview.chromium.org/2765343003/diff/80001/components/cdm/browser/media_drm_storage_impl.cc File components/cdm/browser/media_drm_storage_impl.cc (right): https://codereview.chromium.org/2765343003/diff/80001/components/cdm/browser/media_drm_storage_impl.cc#newcode63 components/cdm/browser/media_drm_storage_impl.cc:63: origin_ = origin.Serialize(); On 2017/03/29 21:30:44, xhwang_slow wrote: > ...
3 years, 8 months ago (2017-03-30 00:29:15 UTC) #50
xhwang
On 2017/03/30 00:29:15, dcheng wrote: > https://codereview.chromium.org/2765343003/diff/80001/components/cdm/browser/media_drm_storage_impl.cc > File components/cdm/browser/media_drm_storage_impl.cc (right): > > https://codereview.chromium.org/2765343003/diff/80001/components/cdm/browser/media_drm_storage_impl.cc#newcode63 > ...
3 years, 8 months ago (2017-03-30 04:41:45 UTC) #53
xhwang
On 2017/03/30 04:41:45, xhwang_slow wrote: > On 2017/03/30 00:29:15, dcheng wrote: > > > https://codereview.chromium.org/2765343003/diff/80001/components/cdm/browser/media_drm_storage_impl.cc ...
3 years, 8 months ago (2017-03-30 18:17:29 UTC) #54
xhwang
dcheng: As discussed, I added RenderFrameDeleted(). PTAL!
3 years, 8 months ago (2017-03-30 20:00:05 UTC) #55
xhwang
rebase only
3 years, 8 months ago (2017-03-30 23:06:50 UTC) #56
dcheng
https://codereview.chromium.org/2765343003/diff/240001/chrome/browser/media/android/cdm/media_drm_storage_factory.cc File chrome/browser/media/android/cdm/media_drm_storage_factory.cc (right): https://codereview.chromium.org/2765343003/diff/240001/chrome/browser/media/android/cdm/media_drm_storage_factory.cc#newcode43 chrome/browser/media/android/cdm/media_drm_storage_factory.cc:43: DVLOG(1) << __func__ << ": Profile not available."; Per ...
3 years, 8 months ago (2017-03-31 18:01:56 UTC) #65
xhwang
comments addressed
3 years, 8 months ago (2017-03-31 18:23:43 UTC) #66
xhwang
dcheng: all done with one question. Thanks! https://codereview.chromium.org/2765343003/diff/240001/chrome/browser/media/android/cdm/media_drm_storage_factory.cc File chrome/browser/media/android/cdm/media_drm_storage_factory.cc (right): https://codereview.chromium.org/2765343003/diff/240001/chrome/browser/media/android/cdm/media_drm_storage_factory.cc#newcode43 chrome/browser/media/android/cdm/media_drm_storage_factory.cc:43: DVLOG(1) << ...
3 years, 8 months ago (2017-03-31 18:25:37 UTC) #67
xhwang
gab: Please OWNERS review the trivial change in chrome/browser/prefs/browser_prefs.cc and the new deps on 'components/prefs' ...
3 years, 8 months ago (2017-03-31 19:02:08 UTC) #69
dcheng
https://codereview.chromium.org/2765343003/diff/260001/components/cdm/browser/media_drm_storage_impl.cc File components/cdm/browser/media_drm_storage_impl.cc (right): https://codereview.chromium.org/2765343003/diff/260001/components/cdm/browser/media_drm_storage_impl.cc#newcode154 components/cdm/browser/media_drm_storage_impl.cc:154: if (navigation_handle->GetRenderFrameHost() != render_frame_host_) { This should be ==, ...
3 years, 8 months ago (2017-04-01 00:32:03 UTC) #70
xhwang
dcheng: Thanks! PTAL again https://codereview.chromium.org/2765343003/diff/260001/components/cdm/browser/media_drm_storage_impl.cc File components/cdm/browser/media_drm_storage_impl.cc (right): https://codereview.chromium.org/2765343003/diff/260001/components/cdm/browser/media_drm_storage_impl.cc#newcode154 components/cdm/browser/media_drm_storage_impl.cc:154: if (navigation_handle->GetRenderFrameHost() != render_frame_host_) { ...
3 years, 8 months ago (2017-04-01 00:37:02 UTC) #71
dcheng
LGTM
3 years, 8 months ago (2017-04-01 00:39:04 UTC) #72
xhwang
rebase only
3 years, 8 months ago (2017-04-03 04:36:48 UTC) #77
xhwang
gab / rockot: kindly ping :) gab: Please OWNERS review the trivial change in chrome/browser/prefs/browser_prefs.cc ...
3 years, 8 months ago (2017-04-03 16:33:13 UTC) #82
gab
On 2017/04/03 16:33:13, xhwang_slow wrote: > gab / rockot: kindly ping :) > > gab: ...
3 years, 8 months ago (2017-04-03 16:44:19 UTC) #83
yzshen1
On 2017/04/03 16:44:19, gab wrote: > On 2017/04/03 16:33:13, xhwang_slow wrote: > > gab / ...
3 years, 8 months ago (2017-04-03 18:06:59 UTC) #84
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2765343003/300001
3 years, 8 months ago (2017-04-03 18:08:10 UTC) #87
commit-bot: I haz the power
3 years, 8 months ago (2017-04-03 18:28:24 UTC) #90
Message was sent while issue was closed.
Committed patchset #15 (id:300001) as
https://chromium.googlesource.com/chromium/src/+/116acb96458241e0db329600538a...

Powered by Google App Engine
This is Rietveld 408576698