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

Issue 2178973004: DialogSurfaceManager implementation. (Closed)

Created:
4 years, 4 months ago by liberato (no reviews please)
Modified:
3 years, 8 months ago
CC:
avayvod+watch_chromium.org, chromium-reviews, darin-cc_chromium.org, feature-media-reviews_chromium.org, jam, mlamouri+watch-media_chromium.org, piman+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

DialogSurfaceManager implementation. Do-nothing implementation of DialogSurfaceManager. This CL introduces the plumbing for DialogSurfaceManager. It omits details about callbacks, and DialogSurfaces themselves. BUG=618368 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

Patch Set 1 #

Patch Set 2 : DialogSurfaceManager implementation. #

Patch Set 3 : rebased. #

Patch Set 4 : moved jni out of content/app #

Total comments: 38

Patch Set 5 : started kinda using mHandler #

Patch Set 6 : cl feedback #

Patch Set 7 : cl feedback #

Patch Set 8 : gyp #

Total comments: 18

Patch Set 9 : cl feedback #

Total comments: 15

Patch Set 10 : cl feedback #

Patch Set 11 : addedd DVLOG #

Total comments: 8

Patch Set 12 : removed unneeded jni registration fns #

Patch Set 13 : renamed DialogSurface* to AndroidSurface* #

Patch Set 14 : DialogSurface => DialogSurfaceHolder #

Patch Set 15 : window token post for thread safety #

Patch Set 16 : added locking for SurfaceManager::instance #

Patch Set 17 : DialogSurfaceManager.java => DialogSurfaceManagerImpl.java and stopped using activity for window to… #

Total comments: 12

Patch Set 18 : switched to UnguessableToken #

Patch Set 19 : removed whitespace changes #

Total comments: 18

Patch Set 20 : simplified DialogSurface, unified CL #

Patch Set 21 : removed IDialogSurfaceActivityMapper from common.aidl #

Total comments: 103

Patch Set 22 : cl feedback #

Patch Set 23 : renamed to AndroidOverlay, stopped modifying ContentViewCore #

Patch Set 24 : cleanup #

Total comments: 10
Unified diffs Side-by-side diffs Delta from patch set Stats (+1765 lines, -1 line) 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 16 17 18 19 20 21 22 4 chunks +13 lines, -1 line 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 18 19 20 21 22 1 chunk +2 lines, -0 lines 0 comments Download
M content/browser/android/browser_jni_registrar.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 2 chunks +3 lines, -0 lines 0 comments Download
A content/browser/android/dialog_android_overlay.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 chunk +54 lines, -0 lines 0 comments Download
A content/browser/android/dialog_android_overlay.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +154 lines, -0 lines 0 comments Download
M content/public/android/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 2 chunks +4 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 15 16 17 18 19 20 21 22 1 chunk +11 lines, -0 lines 1 comment 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 15 16 17 18 19 20 21 22 3 chunks +11 lines, -0 lines 0 comments Download
A content/public/android/java/src/org/chromium/content/browser/androidoverlay/AndroidOverlayProviderImpl.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +120 lines, -0 lines 2 comments Download
A content/public/android/java/src/org/chromium/content/browser/androidoverlay/DialogAndroidOverlay.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +177 lines, -0 lines 0 comments Download
A content/public/android/java/src/org/chromium/content/browser/androidoverlay/DialogAndroidOverlayCore.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +280 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 14 15 16 17 18 19 20 21 22 1 chunk +3 lines, -0 lines 0 comments Download
M gpu/ipc/common/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +2 lines, -0 lines 0 comments Download
A gpu/ipc/common/android/android_overlay_provider_lookup.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +34 lines, -0 lines 0 comments Download
A gpu/ipc/common/android/android_overlay_provider_lookup.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +28 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 15 16 17 18 19 20 21 22 4 chunks +27 lines, -0 lines 0 comments Download
A media/base/android/android_overlay_callback.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +91 lines, -0 lines 0 comments Download
A media/base/android/android_overlay_callback.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +183 lines, -0 lines 1 comment Download
A media/base/android/android_overlay_provider_proxy.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +67 lines, -0 lines 0 comments Download
A media/base/android/android_overlay_provider_proxy.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +69 lines, -0 lines 0 comments Download
A media/base/android/android_overlay_proxy.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +111 lines, -0 lines 0 comments Download
A media/base/android/android_overlay_proxy.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 chunk +66 lines, -0 lines 0 comments Download
A media/base/android/java/src/org/chromium/media/AndroidOverlayCallback.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +52 lines, -0 lines 3 comments Download
A media/base/android/java/src/org/chromium/media/AndroidOverlayProviderProxy.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +46 lines, -0 lines 1 comment Download
A media/base/android/java/src/org/chromium/media/AndroidOverlayProxy.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +43 lines, -0 lines 1 comment Download
A media/base/android/java/src/org/chromium/media/IAndroidOverlay.aidl View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +19 lines, -0 lines 0 comments Download
A media/base/android/java/src/org/chromium/media/IAndroidOverlayCallback.aidl View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +19 lines, -0 lines 1 comment Download
A media/base/android/java/src/org/chromium/media/IAndroidOverlayCompletion.aidl View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +11 lines, -0 lines 0 comments Download
A media/base/android/java/src/org/chromium/media/IAndroidOverlayProvider.aidl View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +31 lines, -0 lines 0 comments Download
A media/base/android/java/src/org/chromium/media/common.aidl View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +8 lines, -0 lines 0 comments Download
M media/base/android/media_jni_registrar.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 2 chunks +3 lines, -0 lines 0 comments Download
M ui/android/java/src/org/chromium/ui/base/WindowAndroid.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 2 chunks +15 lines, -0 lines 0 comments Download
M ui/android/window_android.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +3 lines, -0 lines 0 comments Download
M ui/android/window_android.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +5 lines, -0 lines 0 comments Download

Messages

Total messages: 67 (29 generated)
liberato (no reviews please)
hey folks! after some additional effort, i think that it's time to start landing DialogSurface. ...
4 years, 4 months ago (2016-07-26 16:42:05 UTC) #4
watk
just nits https://codereview.chromium.org/2178973004/diff/60001/content/browser/media/android/dialog_surface_activity_mapper.cc File content/browser/media/android/dialog_surface_activity_mapper.cc (right): https://codereview.chromium.org/2178973004/diff/60001/content/browser/media/android/dialog_surface_activity_mapper.cc#newcode19 content/browser/media/android/dialog_surface_activity_mapper.cc:19: jint renderHandle, Java side calls this renderer_pid ...
4 years, 4 months ago (2016-07-26 21:34:31 UTC) #17
liberato (no reviews please)
https://codereview.chromium.org/2178973004/diff/60001/content/browser/media/android/dialog_surface_activity_mapper.cc File content/browser/media/android/dialog_surface_activity_mapper.cc (right): https://codereview.chromium.org/2178973004/diff/60001/content/browser/media/android/dialog_surface_activity_mapper.cc#newcode19 content/browser/media/android/dialog_surface_activity_mapper.cc:19: jint renderHandle, On 2016/07/26 21:34:30, watk wrote: > Java ...
4 years, 4 months ago (2016-07-26 22:49:16 UTC) #21
DaleCurtis
https://codereview.chromium.org/2178973004/diff/140001/content/browser/media/android/dialog_surface_activity_mapper.cc File content/browser/media/android/dialog_surface_activity_mapper.cc (right): https://codereview.chromium.org/2178973004/diff/140001/content/browser/media/android/dialog_surface_activity_mapper.cc#newcode14 content/browser/media/android/dialog_surface_activity_mapper.cc:14: using namespace content; We don't typically use "using" https://codereview.chromium.org/2178973004/diff/140001/content/browser/media/android/dialog_surface_activity_mapper.cc#newcode16 ...
4 years, 4 months ago (2016-07-27 18:14:20 UTC) #29
liberato (no reviews please)
https://codereview.chromium.org/2178973004/diff/140001/content/browser/media/android/dialog_surface_activity_mapper.cc File content/browser/media/android/dialog_surface_activity_mapper.cc (right): https://codereview.chromium.org/2178973004/diff/140001/content/browser/media/android/dialog_surface_activity_mapper.cc#newcode14 content/browser/media/android/dialog_surface_activity_mapper.cc:14: using namespace content; On 2016/07/27 18:14:19, DaleCurtis wrote: > ...
4 years, 4 months ago (2016-07-28 15:33:31 UTC) #30
Tima Vaisburd
I cannot comment on the essence, just pedantic nits so far. https://codereview.chromium.org/2178973004/diff/160001/content/browser/media/android/dialog_surface_activity_mapper.cc File content/browser/media/android/dialog_surface_activity_mapper.cc (right): ...
4 years, 4 months ago (2016-08-03 18:05:13 UTC) #31
Tima Vaisburd
https://codereview.chromium.org/2178973004/diff/160001/media/base/android/dialog_surface_manager.h File media/base/android/dialog_surface_manager.h (right): https://codereview.chromium.org/2178973004/diff/160001/media/base/android/dialog_surface_manager.h#newcode33 media/base/android/dialog_surface_manager.h:33: // surface->GetSurface() On 2016/08/03 18:05:13, Tima Vaisburd wrote: > ...
4 years, 4 months ago (2016-08-03 18:28:23 UTC) #32
liberato (no reviews please)
thanks for the feedback. -fl https://codereview.chromium.org/2178973004/diff/160001/content/browser/media/android/dialog_surface_activity_mapper.cc File content/browser/media/android/dialog_surface_activity_mapper.cc (right): https://codereview.chromium.org/2178973004/diff/160001/content/browser/media/android/dialog_surface_activity_mapper.cc#newcode40 content/browser/media/android/dialog_surface_activity_mapper.cc:40: if (!frame) On 2016/08/03 ...
4 years, 4 months ago (2016-08-03 23:11:55 UTC) #33
DaleCurtis
lgtm % nits. https://codereview.chromium.org/2178973004/diff/200001/content/browser/media/android/dialog_surface_activity_mapper.cc File content/browser/media/android/dialog_surface_activity_mapper.cc (right): https://codereview.chromium.org/2178973004/diff/200001/content/browser/media/android/dialog_surface_activity_mapper.cc#newcode14 content/browser/media/android/dialog_surface_activity_mapper.cc:14: static ScopedJavaLocalRef<jobject> GetContentViewCore( This is still ...
4 years, 4 months ago (2016-08-04 00:20:36 UTC) #34
Tima Vaisburd
https://codereview.chromium.org/2178973004/diff/160001/media/base/android/dialog_surface_manager.h File media/base/android/dialog_surface_manager.h (right): https://codereview.chromium.org/2178973004/diff/160001/media/base/android/dialog_surface_manager.h#newcode33 media/base/android/dialog_surface_manager.h:33: // surface->GetSurface() On 2016/08/03 23:11:55, liberato wrote: > On ...
4 years, 4 months ago (2016-08-04 00:21:09 UTC) #35
liberato (no reviews please)
On 2016/08/04 00:21:09, Tima Vaisburd wrote: > https://codereview.chromium.org/2178973004/diff/160001/media/base/android/dialog_surface_manager.h > File media/base/android/dialog_surface_manager.h (right): > > https://codereview.chromium.org/2178973004/diff/160001/media/base/android/dialog_surface_manager.h#newcode33 ...
4 years, 4 months ago (2016-08-04 01:05:42 UTC) #36
liberato (no reviews please)
https://codereview.chromium.org/2178973004/diff/200001/content/browser/media/android/dialog_surface_activity_mapper.cc File content/browser/media/android/dialog_surface_activity_mapper.cc (right): https://codereview.chromium.org/2178973004/diff/200001/content/browser/media/android/dialog_surface_activity_mapper.cc#newcode14 content/browser/media/android/dialog_surface_activity_mapper.cc:14: static ScopedJavaLocalRef<jobject> GetContentViewCore( On 2016/08/04 00:20:36, DaleCurtis wrote: > ...
4 years, 4 months ago (2016-08-04 01:06:20 UTC) #37
liberato (no reviews please)
i renamed DialogSurface* to AndroidSurface*, and renamed AndroidSurface to AndroidSurfaceToken. here's my reasoning: - "Dialog" ...
4 years, 4 months ago (2016-08-04 17:17:19 UTC) #38
watk
On 2016/08/04 17:17:19, liberato wrote: > i renamed DialogSurface* to AndroidSurface*, and renamed AndroidSurface to ...
4 years, 4 months ago (2016-08-04 18:52:58 UTC) #39
Tima Vaisburd
Would you think I'd be good to get back to PS12 and then rename DialogSurface ...
4 years, 4 months ago (2016-08-04 19:08:35 UTC) #40
liberato (no reviews please)
On 2016/08/04 19:08:35, Tima Vaisburd wrote: > Would you think I'd be good to get ...
4 years, 4 months ago (2016-08-04 19:15:42 UTC) #41
liberato (no reviews please)
kenrb: PTAL @ gpu/ipc for security review, plus anything else you'd care to. thanks -fl
4 years, 4 months ago (2016-08-04 20:57:00 UTC) #43
kenrb
ipc lgtm
4 years, 4 months ago (2016-08-05 17:06:07 UTC) #44
liberato (no reviews please)
i realized yesterday that threading is broken since i moved out of gpu -- random ...
4 years, 4 months ago (2016-08-11 17:26:33 UTC) #45
liberato (no reviews please)
this causes ActivtyMapper to post to the browser ui thread in native, which i think ...
4 years, 4 months ago (2016-08-15 18:40:32 UTC) #46
liberato (no reviews please)
aelias, boliu: sievers suggested that one (or both) of you two might be appropriate to ...
4 years, 3 months ago (2016-09-19 21:04:36 UTC) #48
boliu
so uhh, what stage is this project? seems like it's past the design phase where ...
4 years, 3 months ago (2016-09-20 15:56:16 UTC) #49
boliu
On 2016/09/20 15:56:16, boliu wrote: > so uhh, what stage is this project? seems like ...
4 years, 3 months ago (2016-09-20 15:57:06 UTC) #50
liberato (no reviews please)
On 2016/09/20 15:57:06, boliu wrote: > On 2016/09/20 15:56:16, boliu wrote: > > so uhh, ...
4 years, 3 months ago (2016-09-20 16:44:48 UTC) #51
aelias_OOO_until_Jul13
At a high level, the idea seems good and I support this. We don't get ...
4 years, 3 months ago (2016-09-21 08:06:33 UTC) #52
liberato (no reviews please)
sorry for the delay. boliu: this version renames DialogSurfaceManager.java => DialogSurfaceManagerImpl.java . I didn't do ...
4 years, 1 month ago (2016-11-02 17:49:50 UTC) #54
boliu
definitely did not finish looking at everything (wasn't looking linearly) but some comments so far ...
4 years, 1 month ago (2016-11-04 00:07:20 UTC) #55
liberato (no reviews please)
boliu: now that UnguessableToken's java binding has landed, i went ahead and removed (pid, frame ...
4 years, 1 month ago (2016-11-11 21:52:36 UTC) #56
boliu
using CVC to listen to WindowAndroid changes is fine. Although that code is not in ...
4 years, 1 month ago (2016-11-14 16:39:25 UTC) #57
liberato (no reviews please)
i merged the CLs together, per offline discussion. i also simplified DialogSurface a bit -- ...
4 years ago (2016-12-20 17:16:38 UTC) #59
boliu
read the media stuff, which means I don't actually have the full picture in my ...
3 years, 11 months ago (2017-01-04 01:48:45 UTC) #60
boliu
https://codereview.chromium.org/2178973004/diff/420001/content/app/android/child_process_service_impl.cc File content/app/android/child_process_service_impl.cc (right): https://codereview.chromium.org/2178973004/diff/420001/content/app/android/child_process_service_impl.cc#newcode111 content/app/android/child_process_service_impl.cc:111: return // base::android::ScopedJavaLocalRef<jobject>( commented out code https://codereview.chromium.org/2178973004/diff/420001/content/public/android/java/src/org/chromium/content/browser/ChildProcessLauncher.java File content/public/android/java/src/org/chromium/content/browser/ChildProcessLauncher.java ...
3 years, 11 months ago (2017-01-04 23:14:39 UTC) #61
liberato (no reviews please)
thanks for the feedback. i'll do the class renaming as a separate PS. this CL ...
3 years, 11 months ago (2017-01-11 22:17:58 UTC) #62
boliu
Didn't look at new code, just replying to comments. I assume there's enough work there ...
3 years, 11 months ago (2017-01-12 20:24:19 UTC) #63
liberato (no reviews please)
boliu: thanks for the discussion yesterday. i've verified basic functionality of this PS to know ...
3 years, 10 months ago (2017-02-03 21:28:32 UTC) #64
liberato (no reviews please)
https://codereview.chromium.org/2178973004/diff/420001/media/base/android/dialog_surface_callback.cc File media/base/android/dialog_surface_callback.cc (right): https://codereview.chromium.org/2178973004/diff/420001/media/base/android/dialog_surface_callback.cc#newcode129 media/base/android/dialog_surface_callback.cc:129: void DialogSurfaceCallback::OnCallbackProperThread( On 2017/02/03 21:28:32, liberato wrote: > On ...
3 years, 10 months ago (2017-02-07 00:20:20 UTC) #65
boliu
I feel threading is still too hard to understand and trace at the moment. Eg ...
3 years, 10 months ago (2017-02-08 00:01:59 UTC) #66
liberato (no reviews please)
3 years, 10 months ago (2017-02-08 02:34:12 UTC) #67
On 2017/02/08 00:01:59, boliu wrote:
> I feel threading is still too hard to understand and trace at the moment. Eg
> DialogAndroidOverlay[Core] (java and native parts) run on binder threads, UI
> thread, and dialog thread. AndroidOverlayCallback still looks pretty complex
as
> well, though I guess that's getting better. 
> 
> I don't know if there's general good solution though. wish we could tell
binder
> to call us on a specific thread like how things work with chrome IPC.
> 
> The next best thing is keep objects single threaded where possible, and
document
> extensively lifetime and threading info.
> 
> And now that almost everything is oneway, there's one more binder edge case:
can
> a single binder object be called on multiple binder threads *concurrently*?
I'm
> guessing answer is yes, in which case... I probably need to look at everything
> again.
> 
> inline comments are all minor things
> 
>
https://codereview.chromium.org/2178973004/diff/480001/content/public/android...
> File
>
content/public/android/java/src/org/chromium/content/app/ChildProcessServiceImpl.java
> (right):
> 
>
https://codereview.chromium.org/2178973004/diff/480001/content/public/android...
>
content/public/android/java/src/org/chromium/content/app/ChildProcessServiceImpl.java:403:
> try {
> all the other calls have a null check for mCallback
> 
>
https://codereview.chromium.org/2178973004/diff/480001/content/public/android...
> File
>
content/public/android/java/src/org/chromium/content/browser/androidoverlay/AndroidOverlayProviderImpl.java
> (right):
> 
>
https://codereview.chromium.org/2178973004/diff/480001/content/public/android...
>
content/public/android/java/src/org/chromium/content/browser/androidoverlay/AndroidOverlayProviderImpl.java:73:
> @CalledByNative
> not needed, this doesn't generate jni headers
> 
>
https://codereview.chromium.org/2178973004/diff/480001/content/public/android...
>
content/public/android/java/src/org/chromium/content/browser/androidoverlay/AndroidOverlayProviderImpl.java:113:
> // Called with mLock held only.
> synhronized blocks are re-entrant safe, so rather than a comment and hoping
> caller remembers, could just add synchronized block here as well
> 
>
https://codereview.chromium.org/2178973004/diff/480001/media/base/android/and...
> File media/base/android/android_overlay_callback.cc (right):
> 
>
https://codereview.chromium.org/2178973004/diff/480001/media/base/android/and...
> media/base/android/android_overlay_callback.cc:78: task_runner_ =
> base::ThreadTaskRunnerHandle::Get();
> else DCHECK it's still the same thread?
> 
>
https://codereview.chromium.org/2178973004/diff/480001/media/base/android/jav...
> File
media/base/android/java/src/org/chromium/media/AndroidOverlayCallback.java
> (right):
> 
>
https://codereview.chromium.org/2178973004/diff/480001/media/base/android/jav...
> media/base/android/java/src/org/chromium/media/AndroidOverlayCallback.java:22:
> public AndroidOverlayCallback(long nativeId) {
> private
> 
>
https://codereview.chromium.org/2178973004/diff/480001/media/base/android/jav...
> media/base/android/java/src/org/chromium/media/AndroidOverlayCallback.java:27:
> public static AndroidOverlayCallback create(long nativeId) {
> private
> 
>
https://codereview.chromium.org/2178973004/diff/480001/media/base/android/jav...
> media/base/android/java/src/org/chromium/media/AndroidOverlayCallback.java:45:
}
> catch (RemoteException e) {
> Feel free to Log.d errors like this, Log.d is stripped out of release builds
> 
>
https://codereview.chromium.org/2178973004/diff/480001/media/base/android/jav...
> File
>
media/base/android/java/src/org/chromium/media/AndroidOverlayProviderProxy.java
> (right):
> 
>
https://codereview.chromium.org/2178973004/diff/480001/media/base/android/jav...
>
media/base/android/java/src/org/chromium/media/AndroidOverlayProviderProxy.java:43:
> throws RemoteException {
> any exception thrown by @CalledByNative methods will lead to an immediate
native
> crash
> 
> in this case, null is a valid return value rather than a failure case, so need
> to catch that exception here and return null instead
> 
>
https://codereview.chromium.org/2178973004/diff/480001/media/base/android/jav...
> File media/base/android/java/src/org/chromium/media/AndroidOverlayProxy.java
> (right):
> 
>
https://codereview.chromium.org/2178973004/diff/480001/media/base/android/jav...
> media/base/android/java/src/org/chromium/media/AndroidOverlayProxy.java:31:
> public void release() {
> private here and below
> 
>
https://codereview.chromium.org/2178973004/diff/480001/media/base/android/jav...
> File
media/base/android/java/src/org/chromium/media/IAndroidOverlayCallback.aidl
> (right):
> 
>
https://codereview.chromium.org/2178973004/diff/480001/media/base/android/jav...
>
media/base/android/java/src/org/chromium/media/IAndroidOverlayCallback.aidl:12:
> // Notify the client that the Androi Surface has been destroyed.  The client
> android typo

thanks for the comments.  i'm overhauling the callbacks to make overlay creation
oneway as well.

just a few quick replies.

> run on binder threads, UI thread, and dialog thread.

the browser UI thread isn't involved.  there's one dialog thread for all
DialogSurface instances.  android callbacks (surfaceCreated) come in on this
thread also.  we want to preserve that, since it keeps us from blocking the UI
thread when a surface is destroyed.

> I don't know if there's general good solution though. wish we could tell
binder
> to call us on a specific thread like how things work with chrome IPC.

DialogSurfaceImpl tries to simulate this -- it just posts to the handler for all
the binder calls, except release() where it has some internal state to clean up.
 DialogSurfaceCore is single-threaded (Dialog thread).  i'll add docs to make it
clearer.  goal is to need to think about only one binder thread and one
DialogSurface thread.

> a single binder object be called on multiple binder threads *concurrently*?
I'm

you're right, it can.  that's why DialogSurfaceImpl synchronizes immediately. 
actually, a misbehaving client could do so even without oneway, so we have to
handle it.  it just calls from multiple threads on the client side.  oneway just
makes it easier.

thanks
-fl

Powered by Google App Engine
This is Rietveld 408576698