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

Issue 2285593002: Add ScopedSurfaceRequestManager (Closed)

Created:
4 years, 3 months ago by tguilbert
Modified:
4 years, 3 months ago
CC:
chromium-reviews, darin-cc_chromium.org, jam, piman+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add ScopedSurfaceRequestManager WebMediaPlayerAndroid (WMPA) used the EstablishSurfacePeer construct and the BrowserMediaPlayerManager to send a SurfaceTexture from the GPU process to a MediaPlayer in the BrowserProcess. MediaPlayerRender does not use a BrowserMediaPlayerManager, but needs a way to receive surface textures from the GPU. This change introduces the ScopedSurfaceRequestManager and the ScopedSurfaceRequestConduit. The Manager allows the registration of a callback in the Browser process, which can receive a ScopedJavaSurface. Upon registration, the manager creates a token that can be used at a later time to fulfill the request. The Conduit forwards surface texture to the Manager, using the issued token to route the ScopedJavaSurface to the right request. From the GPU process, surfaces are sent via the ChildProcessServices and the IChildProcessCallback, the same way that EstablishSurfacePeer currently does. In single process mode, the Manager directly implements the Conduit interface. Security recommended 128 bits as the token size. It is represented by base::Nonce class, which supports serialization accross IPC and Mojo, and is easy to send as two uint64_t through JNI and AIDL. The CL that covers the integration within StreamTexture and MediaPlayerRenderer is tracked by the same bug, and can be found at https://codereview.chromium.org/2282633002/. Adding palmer@ as TBR, since he is the only owner for aidl files, but is unavailable ATM. TBR=palmer BUG=627658 TEST=Added UTs, manually verified that it worked in the prototype. CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel Committed: https://crrev.com/f08485bfd9514a905dda4ca23eca02e4f1f3d72c Cr-Commit-Position: refs/heads/master@{#419971}

Patch Set 1 #

Patch Set 2 : Fixing typos #

Patch Set 3 : Changing |request_id| type from int to uint64_t #

Patch Set 4 : Fixed signed/unsigned in UTs #

Total comments: 13

Patch Set 5 : Simplified manager interface. Renamed to Conduit. #

Total comments: 22

Patch Set 6 : Addressing comments #

Total comments: 24

Patch Set 7 : Addressed comments. #

Total comments: 2

Patch Set 8 : Fixed DCHECKS and rebased #

Patch Set 9 : Added 128 bit MediaToken #

Patch Set 10 : rebase #

Patch Set 11 : Remove media token. Switch to base64 string #

Patch Set 12 : Fixing comments. #

Total comments: 2

Patch Set 13 : Changed to base::Nonce #

Patch Set 14 : Changed JNI serialization to 2 longs #

Total comments: 11

Patch Set 15 : Update to UnguessableToken. Addressed comments. #

Total comments: 11

Patch Set 16 : Addressed latest comments. #

Patch Set 17 : Remove unused string headers. #

Patch Set 18 : Rebase. #

Patch Set 19 : Added RunUntilIdle() to 2 UTs #

Unified diffs Side-by-side diffs Delta from patch set Stats (+514 lines, -0 lines) Patch
M content/app/android/child_process_service_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 4 chunks +18 lines, -0 lines 0 comments Download
M content/browser/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +2 lines, -0 lines 0 comments Download
M content/browser/android/child_process_launcher_android.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +21 lines, -0 lines 0 comments Download
A content/browser/android/scoped_surface_request_manager.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +84 lines, -0 lines 0 comments Download
A content/browser/android/scoped_surface_request_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +90 lines, -0 lines 0 comments Download
A content/browser/android/scoped_surface_request_manager_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +186 lines, -0 lines 0 comments Download
M content/browser/browser_main_loop.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +3 lines, -0 lines 0 comments Download
M content/public/android/java/src/org/chromium/content/app/ChildProcessServiceImpl.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +21 lines, -0 lines 0 comments Download
M content/public/android/java/src/org/chromium/content/browser/ChildProcessLauncher.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +15 lines, -0 lines 0 comments Download
M content/public/android/java/src/org/chromium/content/common/IChildProcessCallback.aidl View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +3 lines, -0 lines 0 comments Download
M content/test/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +1 line, -0 lines 0 comments Download
M gpu/ipc/common/BUILD.gn View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -0 lines 0 comments Download
A gpu/ipc/common/android/scoped_surface_request_conduit.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +39 lines, -0 lines 0 comments Download
A gpu/ipc/common/android/scoped_surface_request_conduit.cc View 1 2 3 4 1 chunk +29 lines, -0 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 111 (76 generated)
tguilbert
PTAL! The CL that shows how all of this code is integrated in the MediaPlayerRenderer ...
4 years, 3 months ago (2016-08-26 02:17:06 UTC) #5
DaleCurtis
=> liberato
4 years, 3 months ago (2016-08-26 19:11:54 UTC) #16
watk
Since we're intending for request_id to be used for authentication I'd suggest calling it request_token ...
4 years, 3 months ago (2016-08-26 22:01:32 UTC) #17
tguilbert
I changed the ScopedSurfaceRequestManager into ScopedSurfaceRequestConduit and simplified the interface. This allowed me to rename ...
4 years, 3 months ago (2016-08-29 18:30:46 UTC) #18
watk
https://codereview.chromium.org/2285593002/diff/60001/content/browser/android/browser_scoped_surface_request_manager.cc File content/browser/android/browser_scoped_surface_request_manager.cc (right): https://codereview.chromium.org/2285593002/diff/60001/content/browser/android/browser_scoped_surface_request_manager.cc#newcode29 content/browser/android/browser_scoped_surface_request_manager.cc:29: BrowserScopedSurfaceRequestManager::GetAndUnregisterScopedSurfaceRequest( On 2016/08/29 18:30:46, ThomasGuilbert wrote: > On 2016/08/26 ...
4 years, 3 months ago (2016-08-29 19:42:27 UTC) #21
liberato (no reviews please)
sorry for the delay. watk's comments covered what i was going to say -- mostly, ...
4 years, 3 months ago (2016-08-29 21:10:19 UTC) #22
liberato (no reviews please)
sorry for the delay. -fl https://codereview.chromium.org/2285593002/diff/80001/content/browser/android/child_process_launcher_android.cc File content/browser/android/child_process_launcher_android.cc (right): https://codereview.chromium.org/2285593002/diff/80001/content/browser/android/child_process_launcher_android.cc#newcode95 content/browser/android/child_process_launcher_android.cc:95: const base::android::JavaRef<jobject>& surface, perhaps ...
4 years, 3 months ago (2016-08-30 17:58:35 UTC) #25
tguilbert
Addressed most comments. If I didn't specifically address it, it might be because the changes ...
4 years, 3 months ago (2016-08-30 22:53:09 UTC) #28
watk
This looks great https://codereview.chromium.org/2285593002/diff/100001/content/browser/android/scoped_surface_request_manager.cc File content/browser/android/scoped_surface_request_manager.cc (right): https://codereview.chromium.org/2285593002/diff/100001/content/browser/android/scoped_surface_request_manager.cc#newcode77 content/browser/android/scoped_surface_request_manager.cc:77: if (!request.is_null()) { remove braces for ...
4 years, 3 months ago (2016-08-31 00:47:36 UTC) #31
tguilbert
PTAL. https://codereview.chromium.org/2285593002/diff/100001/content/browser/android/scoped_surface_request_manager.cc File content/browser/android/scoped_surface_request_manager.cc (right): https://codereview.chromium.org/2285593002/diff/100001/content/browser/android/scoped_surface_request_manager.cc#newcode77 content/browser/android/scoped_surface_request_manager.cc:77: if (!request.is_null()) { On 2016/08/31 00:47:35, watk wrote: ...
4 years, 3 months ago (2016-08-31 17:58:56 UTC) #32
watk
lgtm https://codereview.chromium.org/2285593002/diff/100001/content/browser/android/scoped_surface_request_manager_unittest.cc File content/browser/android/scoped_surface_request_manager_unittest.cc (right): https://codereview.chromium.org/2285593002/diff/100001/content/browser/android/scoped_surface_request_manager_unittest.cc#newcode184 content/browser/android/scoped_surface_request_manager_unittest.cc:184: // Makes sure that the code is resilient ...
4 years, 3 months ago (2016-08-31 18:12:14 UTC) #35
liberato (no reviews please)
lgtm
4 years, 3 months ago (2016-08-31 19:54:31 UTC) #39
tguilbert
dtrainor, PTAL at content/public/android/* sievers, PTAL at content/browser/* and content/app/* dcheng, PTAL at gpu/ipc/* @dcheng: ...
4 years, 3 months ago (2016-08-31 20:44:44 UTC) #41
dcheng
On 2016/08/31 20:44:44, ThomasGuilbert wrote: > dtrainor, PTAL at content/public/android/* > sievers, PTAL at content/browser/* ...
4 years, 3 months ago (2016-09-01 21:06:13 UTC) #46
David Trainor- moved to gerrit
content/public/android lgtm
4 years, 3 months ago (2016-09-02 16:09:57 UTC) #47
tguilbert
Security recommended 128 bits as a token size. The discussion also sparked the idea of ...
4 years, 3 months ago (2016-09-09 20:37:21 UTC) #64
dcheng
How much time do you think it'd take to implement the unguessable token? In general, ...
4 years, 3 months ago (2016-09-09 20:51:08 UTC) #65
tguilbert
@dcheng I uploaded a tentative CL of what the unguessable token might look like (https://codereview.chromium.org/2333443002/). ...
4 years, 3 months ago (2016-09-10 09:50:48 UTC) #67
dcheng
On 2016/09/10 09:50:48, ThomasGuilbert wrote: > @dcheng I uploaded a tentative CL of what the ...
4 years, 3 months ago (2016-09-10 19:11:31 UTC) #72
tguilbert
@dcheng I wasn't hard to change it to two longs. That is how I had ...
4 years, 3 months ago (2016-09-13 01:37:39 UTC) #73
no sievers
lgtm w/ a few nits https://codereview.chromium.org/2285593002/diff/260001/content/browser/android/child_process_launcher_android.cc File content/browser/android/child_process_launcher_android.cc (right): https://codereview.chromium.org/2285593002/diff/260001/content/browser/android/child_process_launcher_android.cc#newcode249 content/browser/android/child_process_launcher_android.cc:249: gl::ScopedJavaSurface scoped_surface(jsurface); nit: Doesn't ...
4 years, 3 months ago (2016-09-13 23:25:56 UTC) #75
tguilbert
base::UnguessableToken has landed. PTAL. Thanks! https://codereview.chromium.org/2285593002/diff/260001/content/browser/android/child_process_launcher_android.cc File content/browser/android/child_process_launcher_android.cc (right): https://codereview.chromium.org/2285593002/diff/260001/content/browser/android/child_process_launcher_android.cc#newcode249 content/browser/android/child_process_launcher_android.cc:249: gl::ScopedJavaSurface scoped_surface(jsurface); On 2016/09/13 ...
4 years, 3 months ago (2016-09-20 03:08:40 UTC) #78
dcheng
gpu/ipc LGTM with a few nits https://codereview.chromium.org/2285593002/diff/280001/content/app/android/child_process_service_impl.cc File content/app/android/child_process_service_impl.cc (right): https://codereview.chromium.org/2285593002/diff/280001/content/app/android/child_process_service_impl.cc#newcode55 content/app/android/child_process_service_impl.cc:55: gpu::ScopedSurfaceRequestConduit::SetInstance(NULL); Nit: nullptr ...
4 years, 3 months ago (2016-09-20 06:50:35 UTC) #81
tguilbert
Submitting latest patch to CQ. Thank you everyone! https://codereview.chromium.org/2285593002/diff/280001/content/app/android/child_process_service_impl.cc File content/app/android/child_process_service_impl.cc (right): https://codereview.chromium.org/2285593002/diff/280001/content/app/android/child_process_service_impl.cc#newcode55 content/app/android/child_process_service_impl.cc:55: gpu::ScopedSurfaceRequestConduit::SetInstance(NULL); ...
4 years, 3 months ago (2016-09-20 20:59:19 UTC) #82
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/2285593002/300001
4 years, 3 months ago (2016-09-20 21:00:05 UTC) #85
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/263275)
4 years, 3 months ago (2016-09-20 21:11:43 UTC) #87
ncarter (slow)
rubber stamp lgtm for content/ (sievers lgtmed this while a content owner)
4 years, 3 months ago (2016-09-20 22:10:01 UTC) #89
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/2285593002/300001
4 years, 3 months ago (2016-09-20 22:14:45 UTC) #92
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/2285593002/320001
4 years, 3 months ago (2016-09-21 00:38:44 UTC) #97
commit-bot: I haz the power
Try jobs failed on following builders: android_arm64_dbg_recipe on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_arm64_dbg_recipe/builds/131979) linux_android_rel_ng on master.tryserver.chromium.android (JOB_FAILED, ...
4 years, 3 months ago (2016-09-21 00:43:17 UTC) #99
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/2285593002/340001
4 years, 3 months ago (2016-09-21 00:54:21 UTC) #102
commit-bot: I haz the power
Try jobs failed on following builders: android_n5x_swarming_rel on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_n5x_swarming_rel/builds/34106)
4 years, 3 months ago (2016-09-21 02:16:32 UTC) #104
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/2285593002/360001
4 years, 3 months ago (2016-09-21 02:42:35 UTC) #107
commit-bot: I haz the power
Committed patchset #19 (id:360001)
4 years, 3 months ago (2016-09-21 04:12:04 UTC) #109
commit-bot: I haz the power
4 years, 3 months ago (2016-09-21 04:16:03 UTC) #111
Message was sent while issue was closed.
Patchset 19 (id:??) landed as
https://crrev.com/f08485bfd9514a905dda4ca23eca02e4f1f3d72c
Cr-Commit-Position: refs/heads/master@{#419971}

Powered by Google App Engine
This is Rietveld 408576698