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

Issue 920443003: Android: SetCreateContextCallback (Closed)

Created:
5 years, 10 months ago by tfarina
Modified:
5 years, 7 months ago
Reviewers:
boliu, piman
CC:
chromium-reviews, darin-cc_chromium.org, jam, Avi (use Gerrit), jamesr, jochen (gone - plz use gerrit), pilgrim_google
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Android: SetCreateContextCallback BUG=338338 TEST= R=boliu@chromium.org,piman@chromium.org

Patch Set 1 #

Total comments: 1

Patch Set 2 : ContextHolder #

Total comments: 2

Patch Set 3 : inline docs #

Patch Set 4 : base::Bind #

Total comments: 3

Patch Set 5 : gpu::GLInProcessContext::Create() #

Total comments: 5

Patch Set 6 : g_service #

Total comments: 2

Patch Set 7 : changes... #

Total comments: 10

Patch Set 8 : more changes #

Patch Set 9 : attributes.shareResources #

Total comments: 1

Patch Set 10 : reduce the diff #

Unified diffs Side-by-side diffs Delta from patch set Stats (+104 lines, -100 lines) Patch
M android_webview/browser/DEPS View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M android_webview/browser/deferred_gpu_command_service.cc View 1 2 3 4 5 2 chunks +43 lines, -1 line 0 comments Download
M content/browser/android/in_process/synchronous_compositor_factory_impl.h View 1 2 3 4 5 6 3 chunks +5 lines, -4 lines 0 comments Download
M content/browser/android/in_process/synchronous_compositor_factory_impl.cc View 1 2 3 4 5 6 7 8 9 5 chunks +25 lines, -88 lines 0 comments Download
M content/browser/android/in_process/synchronous_compositor_impl.cc View 1 2 3 4 5 6 2 chunks +9 lines, -3 lines 0 comments Download
A + content/public/browser/android/DEPS View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M content/public/browser/android/synchronous_compositor.h View 1 2 3 4 5 6 3 chunks +20 lines, -3 lines 0 comments Download

Messages

Total messages: 17 (0 generated)
boliu
https://codereview.chromium.org/920443003/diff/1/content/public/browser/android/synchronous_compositor.h File content/public/browser/android/synchronous_compositor.h (right): https://codereview.chromium.org/920443003/diff/1/content/public/browser/android/synchronous_compositor.h#newcode45 content/public/browser/android/synchronous_compositor.h:45: CreateContextCallback; Return type should be a struct like below ...
5 years, 10 months ago (2015-02-11 16:52:41 UTC) #1
tfarina
I have been having problems to compile for Android: $ ./build/gyp_chromium -DOS=android -Goutput_dir=out_android $ ninja ...
5 years, 10 months ago (2015-02-15 20:47:17 UTC) #2
tfarina
FYI, I got the Android build working again. I will make the changes you suggested ...
5 years, 10 months ago (2015-02-17 13:16:15 UTC) #3
tfarina
Added ContextHolder struct. PTAL.
5 years, 10 months ago (2015-02-17 13:44:11 UTC) #4
boliu
looks good so far Are you intending to submit this as is, or trying to ...
5 years, 10 months ago (2015-02-17 16:50:43 UTC) #5
tfarina
I'm trying to get feedback, more like a guide of what to do in a ...
5 years, 10 months ago (2015-02-17 16:58:18 UTC) #6
boliu
On 2015/02/17 16:58:18, tfarina wrote: > I'm trying to get feedback, more like a guide ...
5 years, 10 months ago (2015-02-17 18:06:18 UTC) #7
tfarina
Bo, I advanced a little here. Please, see my question below. I hope to advance ...
5 years, 10 months ago (2015-02-21 16:39:08 UTC) #8
boliu
https://codereview.chromium.org/920443003/diff/60001/android_webview/browser/deferred_gpu_command_service.cc File android_webview/browser/deferred_gpu_command_service.cc (right): https://codereview.chromium.org/920443003/diff/60001/android_webview/browser/deferred_gpu_command_service.cc#newcode28 android_webview/browser/deferred_gpu_command_service.cc:28: return holder; On 2015/02/21 16:39:08, tfarina wrote: > What ...
5 years, 10 months ago (2015-02-23 21:33:07 UTC) #9
tfarina
Bo, thanks a lot for helping! Please, take a look at the code I put ...
5 years, 10 months ago (2015-02-24 17:02:34 UTC) #10
boliu
https://codereview.chromium.org/920443003/diff/80001/android_webview/browser/deferred_gpu_command_service.cc File android_webview/browser/deferred_gpu_command_service.cc (right): https://codereview.chromium.org/920443003/diff/80001/android_webview/browser/deferred_gpu_command_service.cc#newcode30 android_webview/browser/deferred_gpu_command_service.cc:30: bool need_share_group_with_parent, On 2015/02/24 17:02:34, tfarina wrote: > What ...
5 years, 10 months ago (2015-02-24 21:52:57 UTC) #11
tfarina
https://codereview.chromium.org/920443003/diff/80001/android_webview/browser/deferred_gpu_command_service.cc File android_webview/browser/deferred_gpu_command_service.cc (right): https://codereview.chromium.org/920443003/diff/80001/android_webview/browser/deferred_gpu_command_service.cc#newcode30 android_webview/browser/deferred_gpu_command_service.cc:30: bool need_share_group_with_parent, On 2015/02/24 21:52:57, boliu wrote: > On ...
5 years, 10 months ago (2015-02-24 22:10:12 UTC) #12
boliu
https://codereview.chromium.org/920443003/diff/100001/content/browser/android/in_process/synchronous_compositor_impl.cc File content/browser/android/in_process/synchronous_compositor_impl.cc (right): https://codereview.chromium.org/920443003/diff/100001/content/browser/android/in_process/synchronous_compositor_impl.cc#newcode107 content/browser/android/in_process/synchronous_compositor_impl.cc:107: CreateContextCallback callback) { Next step is implement this. Put ...
5 years, 10 months ago (2015-02-26 01:32:54 UTC) #13
tfarina
Bo, please take another look. I was able to run content_unittests and android_webview_test on my ...
5 years, 9 months ago (2015-02-28 18:56:57 UTC) #14
boliu
If you have an android device, you can build and install the android_webview_apk to test ...
5 years, 9 months ago (2015-03-02 22:19:56 UTC) #15
tfarina
Not very good yet because I have doubts in the changes I need to do ...
5 years, 9 months ago (2015-03-07 21:51:00 UTC) #16
boliu
5 years, 9 months ago (2015-03-09 02:17:54 UTC) #17
https://codereview.chromium.org/920443003/diff/120001/content/browser/android...
File content/browser/android/in_process/synchronous_compositor_factory_impl.cc
(right):

https://codereview.chromium.org/920443003/diff/120001/content/browser/android...
content/browser/android/in_process/synchronous_compositor_factory_impl.cc:190:
attributes).release();
On 2015/03/07 21:51:00, tfarina wrote:
> On 2015/03/02 22:19:56, boliu wrote:
> > Hmm, there is no way to pass the ownership of a
> > WebGraphicsContext3DInProcessCommandBufferImpl object right now.
> > 
> > I wonder if we should update RendererBlinkPlatformImpl methods to return
> > WebGraphicsContext3DProvider instead of WebGraphicsContext3D. That might be
a
> > big-ish change though.
> > 
> > (On the other hand, I don't understand the advantage of
> > WebGraphicsContext3DProvider over WebGraphicsContext3D, except to workaround
> > chromium layering issues like this.)
> > 
> > The other option is have the callback return gg (instead of
> > ContextProvider, and then do the ContextProvider wrapping in this class
where
> > necessary.
> > 
> What we would do instead of:
> 
> holder.context_provider = webkit::gpu::ContextProviderInProcess::Create(  
>
gpu_blink::WebGraphicsContext3DInProcessCommandBufferImpl::WrapContext(context.Pass(),
> attributes), std::string());
> 
> ?
> 

Let me try to re-state the problem:

ContextProviderInProcess (CPIP) wraps
WebGraphicsContext3DInProcessCommandBufferImpl (WGC3D) which wraps
GLInProcessContext (IPC)

Currently the callback returns a scoped_refptr<CPIP> which owns the object, and
a non-owning pointer to the internal IPC object.

The problem in this method is we need to return an owning WGC3D pointer. This is
not possible because it's not possible to "unwrap" or "detach" a WGC3D once it's
wrapped in CPIP.

So I was proposing the callback should return an scoped_ptr<WGC3D> object and a
IPC pointer. Then wrapping a CPIP can happen here, instead of in the callback.

This mean that CPIP won't be moved to android_webview/, but to
content/browser/android/in_process/, which I think makes sense.

Let me know if this is not clear. And sorry I didn't see this problem earlier :/

https://codereview.chromium.org/920443003/diff/160001/content/browser/android...
File content/browser/android/in_process/synchronous_compositor_factory_impl.cc
(right):

https://codereview.chromium.org/920443003/diff/160001/content/browser/android...
content/browser/android/in_process/synchronous_compositor_factory_impl.cc:94:
scoped_refptr<ContextProviderWebContext> context_provider_;
nit: This doesn't need to change

Powered by Google App Engine
This is Rietveld 408576698