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

Issue 1363243003: Manage WebGLRenderingContextBase's weak refs manually without Oilpan. (Closed)

Created:
5 years, 3 months ago by sof
Modified:
5 years, 3 months ago
CC:
blink-reviews, bajones, Zhenyao Mo
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Manage WebGLRenderingContextBase's weak refs manually without Oilpan. WebGLRenderingContextBase keeps a set of registered on-heap WebGLContextObjects, ensuring that these are detached if it is finalized first -- it being unsafe to make any reverse access of the *Base object from those after that point. These references must however be weak as the *Base object mustn't keep WebGL objects alive if they're not otherwise used & referenced. Without Oilpan enabled by default, *Base isn't on the heap, that set of weak WebGLContextObject references must be managed manually rather than relying on HeapHashSet<WeakMember<T>>. If we were to do so, a GC might identify a WebGLContextObject as only being weakly referenced from the *Base object and clear out the entry for it in the set. Should the *Base object then be finalized and destructed before that WebGLContextObject is lazily swept, it would attempt to access an already freed object. With sorry consequences. To address, we keep an off-heap set of untraced raw WebGLContextObject pointers, which are effectively weak. Like now/before, it is the responsibility of either the WebGLContextObject to detach itself when finalized or have the *Base object do that and detach the whole set. R=kbr,haraken BUG=534524 Committed: https://crrev.com/ec0092e045dffb6df9ba3df114724e4dd421ca83 Cr-Commit-Position: refs/heads/master@{#350775}

Patch Set 1 #

Patch Set 2 : strongify m_contextObjects #

Patch Set 3 : weakify using a HashSet #

Patch Set 4 : reinstate WebGLContextObject dtor (non-Oilpan) #

Unified diffs Side-by-side diffs Delta from patch set Stats (+30 lines, -1 line) Patch
M third_party/WebKit/Source/modules/webgl/WebGLContextObject.cpp View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h View 1 2 1 chunk +10 lines, -1 line 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/heap/ThreadState.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/heap/ThreadState.cpp View 1 3 chunks +13 lines, -0 lines 0 comments Download

Messages

Total messages: 25 (6 generated)
sof
please take a look. The ThreadState changes are included here for testing purposes on the ...
5 years, 3 months ago (2015-09-24 14:30:50 UTC) #2
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1363243003/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1363243003/40001
5 years, 3 months ago (2015-09-24 14:34:21 UTC) #4
haraken
> If we were to do so, a GC might identify a > WebGLContextObject as ...
5 years, 3 months ago (2015-09-24 15:20:33 UTC) #5
sof
On 2015/09/24 15:20:33, haraken wrote: > > If we were to do so, a GC ...
5 years, 3 months ago (2015-09-24 15:23:19 UTC) #6
haraken
On 2015/09/24 15:23:19, sof wrote: > On 2015/09/24 15:20:33, haraken wrote: > > > If ...
5 years, 3 months ago (2015-09-24 15:34:21 UTC) #7
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: win_chromium_rel_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/111762)
5 years, 3 months ago (2015-09-24 15:59:02 UTC) #9
Ken Russell (switch to Gerrit)
On 2015/09/24 15:34:21, haraken wrote: > On 2015/09/24 15:23:19, sof wrote: > > On 2015/09/24 ...
5 years, 3 months ago (2015-09-24 16:47:35 UTC) #10
Ken Russell (switch to Gerrit)
+bajones, zmo as FYI
5 years, 3 months ago (2015-09-24 16:47:50 UTC) #11
sof
On 2015/09/24 15:34:21, haraken wrote: > On 2015/09/24 15:23:19, sof wrote: > > On 2015/09/24 ...
5 years, 3 months ago (2015-09-24 17:19:51 UTC) #12
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1363243003/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1363243003/60001
5 years, 3 months ago (2015-09-24 19:48:09 UTC) #14
sof
On 2015/09/24 17:19:51, sof wrote: > On 2015/09/24 15:34:21, haraken wrote: > > On 2015/09/24 ...
5 years, 3 months ago (2015-09-24 20:39:52 UTC) #15
sof
One meta comment re: this bug is that it is due to having to support ...
5 years, 3 months ago (2015-09-24 20:45:44 UTC) #16
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 3 months ago (2015-09-24 21:20:10 UTC) #18
Ken Russell (switch to Gerrit)
Thanks for putting this together and so clearly thinking through the issues. If you're confident ...
5 years, 3 months ago (2015-09-25 01:55:57 UTC) #19
haraken
LGTM 2
5 years, 3 months ago (2015-09-25 02:25:38 UTC) #20
sof
On 2015/09/25 01:55:57, Ken Russell wrote: > Thanks for putting this together and so clearly ...
5 years, 3 months ago (2015-09-25 05:13:58 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1363243003/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1363243003/60001
5 years, 3 months ago (2015-09-25 05:14:09 UTC) #23
commit-bot: I haz the power
Committed patchset #4 (id:60001)
5 years, 3 months ago (2015-09-25 05:19:05 UTC) #24
commit-bot: I haz the power
5 years, 3 months ago (2015-09-25 05:20:00 UTC) #25
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/ec0092e045dffb6df9ba3df114724e4dd421ca83
Cr-Commit-Position: refs/heads/master@{#350775}

Powered by Google App Engine
This is Rietveld 408576698