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

Issue 2560473005: [wrapper-tracing] WebGLRenderingContextBase: Fix wrapper tracing (Closed)

Created:
4 years ago by Michael Lippautz
Modified:
4 years ago
CC:
chromium-reviews, blink-reviews
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[wrapper-tracing] WebGLRenderingContextBase: Fix wrapper tracing BUG=671942 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/7737c8e7d1f6cbf4fdae1fd319709b311254d0e3 Cr-Commit-Position: refs/heads/master@{#436919}

Patch Set 1 #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+1 line, -3 lines) Patch
M third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp View 1 chunk +1 line, -3 lines 4 comments Download

Messages

Total messages: 22 (11 generated)
Michael Lippautz
The bug indicates that we miss a write barrier *or* don't trace an object. Presumably ...
4 years ago (2016-12-07 08:36:11 UTC) #4
haraken
https://codereview.chromium.org/2560473005/diff/1/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp File third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp (right): https://codereview.chromium.org/2560473005/diff/1/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp#newcode7679 third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp:7679: visitor->traceWrappers(m_contextGroup); On 2016/12/07 08:36:11, Michael Lippautz wrote: > The ...
4 years ago (2016-12-07 09:06:29 UTC) #5
Ken Russell (switch to Gerrit)
LGTM++ with whatever fix will make the test stop crashing. https://codereview.chromium.org/2560473005/diff/1/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp File third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp (right): https://codereview.chromium.org/2560473005/diff/1/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp#newcode7679 ...
4 years ago (2016-12-07 09:22:37 UTC) #6
haraken
On 2016/12/07 09:22:37, Ken Russell wrote: > LGTM++ with whatever fix will make the test ...
4 years ago (2016-12-07 09:26:27 UTC) #7
Michael Lippautz
On 2016/12/07 09:26:27, haraken wrote: > On 2016/12/07 09:22:37, Ken Russell wrote: > > LGTM++ ...
4 years ago (2016-12-07 11:49:51 UTC) #12
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/2560473005/1
4 years ago (2016-12-07 11:50:29 UTC) #14
commit-bot: I haz the power
Committed patchset #1 (id:1)
4 years ago (2016-12-07 11:55:42 UTC) #17
commit-bot: I haz the power
Patchset 1 (id:??) landed as https://crrev.com/7737c8e7d1f6cbf4fdae1fd319709b311254d0e3 Cr-Commit-Position: refs/heads/master@{#436919}
4 years ago (2016-12-07 11:58:14 UTC) #19
haraken
This CL LGTM. kbr@: I have a question on #7.
4 years ago (2016-12-07 12:14:06 UTC) #20
Ken Russell (switch to Gerrit)
On 2016/12/07 09:26:27, haraken wrote: > On 2016/12/07 09:22:37, Ken Russell wrote: > > LGTM++ ...
4 years ago (2016-12-08 01:42:17 UTC) #21
haraken
4 years ago (2016-12-08 01:52:06 UTC) #22
Message was sent while issue was closed.
On 2016/12/08 01:42:17, Ken Russell wrote:
> On 2016/12/07 09:26:27, haraken wrote:
> > On 2016/12/07 09:22:37, Ken Russell wrote:
> > > LGTM++ with whatever fix will make the test stop crashing.
> > > 
> > >
> >
>
https://codereview.chromium.org/2560473005/diff/1/third_party/WebKit/Source/m...
> > > File third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
> > > (right):
> > > 
> > >
> >
>
https://codereview.chromium.org/2560473005/diff/1/third_party/WebKit/Source/m...
> > >
third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp:7679:
> > > visitor->traceWrappers(m_contextGroup);
> > > On 2016/12/07 09:06:29, haraken wrote:
> > > > On 2016/12/07 08:36:11, Michael Lippautz wrote:
> > > > > The context group is TraceWrapperBase which indicates we should trace
> > > wrappers
> > > > > through its contexts.
> > > > > 
> > > > > However, I don't see an IDL file and m_contextGroup is also not part
of
> > > > > WebGLRenderingContextBase::visitChildDOMWrappers, so I am not sure
what
> > the
> > > > > expected behavior is.
> > > > 
> > > > kbr@: Would you help me understand why we need to trace m_contextGroup?
> This
> > > is
> > > > doing something strange because  WebGLContextGroup::m_contexts is a hash
> map
> > > of
> > > > weak members. We're tracing the members weakly in oilpan but strongly in
> V8.
> > > > 
> > > > (We're doing the strange thing in Document::m_nodeLists but that's a
very
> > > > special case.)
> > > > 
> > > 
> > > WebGLRenderingContextBase strongly owns WebGLContextGroup.
WebGLContextGroup
> > > maintains weak references back to the WebGLContextBases. (Right now there
is
> > > only a 1:1 mapping. We will probably get rid of WebGLContextGroup, at
which
> > > point the lifetimes will be a lot simpler)
> > 
> > Why do the back references need to be weak? If the mapping is 1:1, can they
be
> > strong members?
> 
> (Appreciate it if you could use the inline code review comments. It's more
> difficult to follow the conversation otherwise)
> 
> It's not mandatory that the back references be weak, but that better models
the
> lifetimes of the OpenGL contexts according to my understanding of that API.
> 
> We could change them to strong references. Would that change the behavior in
any
> significant way?

I don't think so, and that's why I prefer just using strong members.

A weak member should be used only when an object X may outlives an object Y (to
represent a reference from X to Y). Otherwise, we should use a strong member.

It's very strange that you're tracing the hash set weakly in oilpan but strongly
in V8. If you use a strong member, you can just use TraceWrapperMember and won't
need the manual write barrier.

> 
> > > WebGLObjects maintain strong references to *either* their allocating
> > > WebGLRenderingContextBase, or WebGLContextGroup, depending on whether they
> > > conceptually are per-context or per-share-group objects.
> > > 
> > > WebGLContextGroup isn't a concept publicly visible to JS. However, we must
> > trace
> > > from WebGLSharedObject to its WebGLContextGroup, and from there to any
> > > WebGLRenderingContextBase objects in that WebGLContextGroup.
> > 
> > It's not common that a pointer is traced weakly in oilpan but strongly in
V8.
> > Would you add a comment after Michael lands this CL?
> 
> Let's continue to work on that rather than simply add a comment.

Powered by Google App Engine
This is Rietveld 408576698