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

Issue 1830033003: Make lost context callback a base::Closure thru the WGC3DProvider. (Closed)

Created:
4 years, 9 months ago by danakj
Modified:
4 years, 9 months ago
CC:
bajones, blink-reviews, blink-reviews-api_chromium.org, blink-reviews-platform-graphics_chromium.org, Rik, chrishtr, chromium-reviews, danakj+watch_chromium.org, darin-cc_chromium.org, dglazkov+blink, dshwang, drott+blinkwatch_chromium.org, krit, f(malita), jam, jbroman, Justin Novosad, kinuko+watch, mkwst+moarreviews-renderer_chromium.org, mlamouri+watch-content_chromium.org, pdr+graphicswatchlist_chromium.org, piman, piman+watch_chromium.org, rwlbuis, Stephen Chennney, no sievers, sigbjornf, Zhenyao Mo
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Make lost context callback a base::Closure thru the WGC3DProvider. This makes the WebGraphicsContext3DProvider have a method to set a lost context callback, and has that method take a SameThreadClosure, wrapped inside a WebClosure. The SameThreadClosure is converted to a base::Closure and passed thru by the WebGraphicsContext3DProviderImpl (which lives in content/) to the actual ContextProvider::SetLostContextCallback() method. This skips going through WebGraphicsContext3D in blink for the callback, though internally the provider does call the same method on WebGraphicsContext3DImpl, which blink used to hijack from it later. This removes the setter method from the WebGraphicsContext3D public API exposed to blink. It introduces a new public/platform/callback/ directory for the WebClosure in order to make separate DEPS rules for this class. It makes use of base::Bind/Callback which has previously not been allowed in blink, though only to wrap a WTF::SameThreadClosure. It also makes use of base/logging.h directly (previously we were unable to use DCHECK in public/platform since the files there build both with and without BLINK_IMPLEMENTATION and in the without case wtf/ is not available to be included. It also uses scoped_ptr since that is nicer than raw pointers and base::Callback understands it but doesn't understand OwnPtr. R=kbr@chromium.org, kinuko@chromium.org, piman@chromium.org BUG=584497 CQ_INCLUDE_TRYBOTS=tryserver.chromium.win:win_optional_gpu_tests_rel Committed: https://crrev.com/6d1bfc385d5f190c3b37e8df0793ae75af5ae6f5 Cr-Commit-Position: refs/heads/master@{#383233}

Patch Set 1 #

Total comments: 11

Patch Set 2 : lostcontext-webclosure: depscomment #

Patch Set 3 : lostcontext-webclosure: closuremove #

Patch Set 4 : lostcontext-webclosure: 80 #

Total comments: 7

Patch Set 5 : lostcontext-webclosure: no-lambdas-sadface #

Total comments: 1

Patch Set 6 : lostcontext-webclosure: createWeakThisPointer #

Patch Set 7 : lostcontext-webclosure: nocomment #

Total comments: 6

Patch Set 8 : lostcontext-webclosure: public-review #

Unified diffs Side-by-side diffs Delta from patch set Stats (+116 lines, -33 lines) Patch
M content/renderer/webgraphicscontext3d_provider_impl.h View 1 chunk +1 line, -0 lines 0 comments Download
M content/renderer/webgraphicscontext3d_provider_impl.cc View 1 2 3 4 5 6 7 2 chunks +6 lines, -0 lines 0 comments Download
M gpu/blink/webgraphicscontext3d_impl.h View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h View 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp View 1 2 3 4 5 6 5 chunks +4 lines, -27 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridgeTest.cpp View 1 2 2 chunks +3 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp View 1 chunk +5 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/gpu/DrawingBufferTest.cpp View 1 2 2 chunks +2 lines, -0 lines 0 comments Download
M third_party/WebKit/public/blink_headers.gypi View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/public/platform/WebGraphicsContext3D.h View 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/public/platform/WebGraphicsContext3DProvider.h View 3 chunks +3 lines, -3 lines 0 comments Download
A third_party/WebKit/public/platform/callback/DEPS View 1 1 chunk +11 lines, -0 lines 0 comments Download
A third_party/WebKit/public/platform/callback/WebClosure.h View 1 2 3 4 5 6 7 1 chunk +78 lines, -0 lines 0 comments Download

Messages

Total messages: 44 (12 generated)
danakj
piman/kbr: please review. what do you think? This makes it a function on the provider ...
4 years, 9 months ago (2016-03-24 02:35:30 UTC) #4
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1830033003/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1830033003/1
4 years, 9 months ago (2016-03-24 02:35:56 UTC) #6
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_chromium_gn_chromeos_rel on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_gn_chromeos_rel/builds/161576)
4 years, 9 months ago (2016-03-24 02:51:04 UTC) #8
piman
LGTM for content/ and gpu/
4 years, 9 months ago (2016-03-24 03:41:43 UTC) #9
kinuko
yup, the deps and bind usage lgtm https://codereview.chromium.org/1830033003/diff/1/third_party/WebKit/public/platform/callback/DEPS File third_party/WebKit/public/platform/callback/DEPS (right): https://codereview.chromium.org/1830033003/diff/1/third_party/WebKit/public/platform/callback/DEPS#newcode2 third_party/WebKit/public/platform/callback/DEPS:2: "+base/bind.h", nit: ...
4 years, 9 months ago (2016-03-24 05:55:56 UTC) #10
chrishtr
+esprehn for review of WebClosure.
4 years, 9 months ago (2016-03-24 15:10:06 UTC) #12
dcheng
https://codereview.chromium.org/1830033003/diff/1/third_party/WebKit/public/platform/callback/WebClosure.h File third_party/WebKit/public/platform/callback/WebClosure.h (right): https://codereview.chromium.org/1830033003/diff/1/third_party/WebKit/public/platform/callback/WebClosure.h#newcode45 third_party/WebKit/public/platform/callback/WebClosure.h:45: m_haveClosure = other.m_haveClosure; Should m_have closure be set to ...
4 years, 9 months ago (2016-03-24 15:53:57 UTC) #14
danakj
https://codereview.chromium.org/1830033003/diff/1/third_party/WebKit/public/platform/callback/WebClosure.h File third_party/WebKit/public/platform/callback/WebClosure.h (right): https://codereview.chromium.org/1830033003/diff/1/third_party/WebKit/public/platform/callback/WebClosure.h#newcode45 third_party/WebKit/public/platform/callback/WebClosure.h:45: m_haveClosure = other.m_haveClosure; On 2016/03/24 15:53:56, dcheng wrote: > ...
4 years, 9 months ago (2016-03-24 17:53:51 UTC) #15
danakj
https://codereview.chromium.org/1830033003/diff/1/third_party/WebKit/public/platform/callback/DEPS File third_party/WebKit/public/platform/callback/DEPS (right): https://codereview.chromium.org/1830033003/diff/1/third_party/WebKit/public/platform/callback/DEPS#newcode2 third_party/WebKit/public/platform/callback/DEPS:2: "+base/bind.h", On 2016/03/24 05:55:56, kinuko wrote: > nit: maybe ...
4 years, 9 months ago (2016-03-24 17:59:21 UTC) #16
dcheng
https://codereview.chromium.org/1830033003/diff/1/third_party/WebKit/public/platform/callback/WebClosure.h File third_party/WebKit/public/platform/callback/WebClosure.h (right): https://codereview.chromium.org/1830033003/diff/1/third_party/WebKit/public/platform/callback/WebClosure.h#newcode45 third_party/WebKit/public/platform/callback/WebClosure.h:45: m_haveClosure = other.m_haveClosure; On 2016/03/24 at 17:53:51, danakj wrote: ...
4 years, 9 months ago (2016-03-24 18:00:18 UTC) #17
danakj
https://codereview.chromium.org/1830033003/diff/1/third_party/WebKit/public/platform/callback/WebClosure.h File third_party/WebKit/public/platform/callback/WebClosure.h (right): https://codereview.chromium.org/1830033003/diff/1/third_party/WebKit/public/platform/callback/WebClosure.h#newcode45 third_party/WebKit/public/platform/callback/WebClosure.h:45: m_haveClosure = other.m_haveClosure; On 2016/03/24 18:00:18, dcheng wrote: > ...
4 years, 9 months ago (2016-03-24 18:03:16 UTC) #18
danakj
https://codereview.chromium.org/1830033003/diff/1/third_party/WebKit/public/platform/callback/WebClosure.h File third_party/WebKit/public/platform/callback/WebClosure.h (right): https://codereview.chromium.org/1830033003/diff/1/third_party/WebKit/public/platform/callback/WebClosure.h#newcode46 third_party/WebKit/public/platform/callback/WebClosure.h:46: m_closure = base::ResetAndReturn(&other.m_closure); On 2016/03/24 18:03:16, danakj wrote: > ...
4 years, 9 months ago (2016-03-24 18:06:05 UTC) #19
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1830033003/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1830033003/40001
4 years, 9 months ago (2016-03-24 18:07:14 UTC) #21
Ken Russell (switch to Gerrit)
LGTM. Thanks for thinking this through so carefully. A few minor questions. https://codereview.chromium.org/1830033003/diff/60001/content/renderer/webgraphicscontext3d_provider_impl.cc File content/renderer/webgraphicscontext3d_provider_impl.cc ...
4 years, 9 months ago (2016-03-24 18:29:04 UTC) #22
danakj
https://codereview.chromium.org/1830033003/diff/60001/content/renderer/webgraphicscontext3d_provider_impl.cc File content/renderer/webgraphicscontext3d_provider_impl.cc (right): https://codereview.chromium.org/1830033003/diff/60001/content/renderer/webgraphicscontext3d_provider_impl.cc#newcode32 content/renderer/webgraphicscontext3d_provider_impl.cc:32: blink::WebClosure c) { On 2016/03/24 18:29:04, Ken Russell wrote: ...
4 years, 9 months ago (2016-03-24 18:36:50 UTC) #23
danakj
https://codereview.chromium.org/1830033003/diff/60001/third_party/WebKit/public/platform/callback/WebClosure.h File third_party/WebKit/public/platform/callback/WebClosure.h (right): https://codereview.chromium.org/1830033003/diff/60001/third_party/WebKit/public/platform/callback/WebClosure.h#newcode34 third_party/WebKit/public/platform/callback/WebClosure.h:34: auto run_and_delete = +[](scoped_ptr<SameThreadClosure> c) On 2016/03/24 18:36:50, danakj ...
4 years, 9 months ago (2016-03-24 18:38:09 UTC) #24
danakj
Updated without lambda, and deleted the dead class.
4 years, 9 months ago (2016-03-24 18:40:39 UTC) #25
Ken Russell (switch to Gerrit)
Awesome, still LGTM.
4 years, 9 months ago (2016-03-24 18:59:02 UTC) #26
danakj
So.. I'm pretty confused by the new ContextLost.WebGLContextLostFromQuantity failure. Here's what I see happening: 1. ...
4 years, 9 months ago (2016-03-24 22:59:53 UTC) #27
danakj
Before this patch, when willDestroyContext happens, the activeContexts set is empty. It appears that OilPan ...
4 years, 9 months ago (2016-03-24 23:09:46 UTC) #28
danakj
https://codereview.chromium.org/1830033003/diff/80001/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp File third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp (right): https://codereview.chromium.org/1830033003/diff/80001/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp#newcode978 third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp:978: drawingBuffer()->contextProvider()->setLostContextCallback(WebClosure(WTF::bind(&WebGLRenderingContextBase::forceLostContext, this, WebGLRenderingContextBase::RealLostContext, WebGLRenderingContextBase::Auto))); Maybe this bind is keeping ...
4 years, 9 months ago (2016-03-24 23:12:56 UTC) #29
dcheng
On 2016/03/24 at 23:09:46, danakj wrote: > Before this patch, when willDestroyContext happens, the activeContexts ...
4 years, 9 months ago (2016-03-24 23:19:47 UTC) #30
danakj
using createWeakThisPointer() does in fact allow oilpan to destroy the active contexts before they are ...
4 years, 9 months ago (2016-03-24 23:35:05 UTC) #31
Ken Russell (switch to Gerrit)
On 2016/03/24 23:35:05, danakj wrote: > using createWeakThisPointer() does in fact allow oilpan to destroy ...
4 years, 9 months ago (2016-03-24 23:42:35 UTC) #32
Ken Russell (switch to Gerrit)
+haraken and sigbjornf in case either has ideas about this strange behavior.
4 years, 9 months ago (2016-03-24 23:43:13 UTC) #33
danakj
On 2016/03/24 23:43:13, Ken Russell wrote: > +haraken and sigbjornf in case either has ideas ...
4 years, 9 months ago (2016-03-24 23:48:39 UTC) #34
esprehn
lgtm w/ nits fixed. https://codereview.chromium.org/1830033003/diff/120001/content/renderer/webgraphicscontext3d_provider_impl.cc File content/renderer/webgraphicscontext3d_provider_impl.cc (right): https://codereview.chromium.org/1830033003/diff/120001/content/renderer/webgraphicscontext3d_provider_impl.cc#newcode33 content/renderer/webgraphicscontext3d_provider_impl.cc:33: provider_->SetLostContextCallback(c.ToBaseClosure()); TakeBaseClosure() ? It has ...
4 years, 9 months ago (2016-03-25 01:05:06 UTC) #35
danakj
Thanks! https://codereview.chromium.org/1830033003/diff/120001/content/renderer/webgraphicscontext3d_provider_impl.cc File content/renderer/webgraphicscontext3d_provider_impl.cc (right): https://codereview.chromium.org/1830033003/diff/120001/content/renderer/webgraphicscontext3d_provider_impl.cc#newcode33 content/renderer/webgraphicscontext3d_provider_impl.cc:33: provider_->SetLostContextCallback(c.ToBaseClosure()); On 2016/03/25 01:05:05, esprehn wrote: > TakeBaseClosure() ...
4 years, 9 months ago (2016-03-25 01:41:54 UTC) #36
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1830033003/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1830033003/140001
4 years, 9 months ago (2016-03-25 01:42:47 UTC) #39
haraken
LGTM
4 years, 9 months ago (2016-03-25 02:14:02 UTC) #40
commit-bot: I haz the power
Committed patchset #8 (id:140001)
4 years, 9 months ago (2016-03-25 03:12:16 UTC) #42
commit-bot: I haz the power
4 years, 9 months ago (2016-03-25 03:13:52 UTC) #44
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/6d1bfc385d5f190c3b37e8df0793ae75af5ae6f5
Cr-Commit-Position: refs/heads/master@{#383233}

Powered by Google App Engine
This is Rietveld 408576698