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

Issue 1312843009: Improve CancellableTaskFactory handling and Oilpan usage. (Closed)

Created:
5 years, 3 months ago by sof
Modified:
5 years, 3 months ago
Reviewers:
oilpan-reviews, haraken
CC:
blink-reviews, blink-reviews-html_chromium.org, oilpan-reviews, Mads Ager (chromium), kouhei+heap_chromium.org, eae+blinkwatch, blink-reviews-dom_chromium.org, dglazkov+blink, haraken, kinuko+watch, scheduler-bugs_chromium.org, rwlbuis
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Improve CancellableTaskFactory handling and Oilpan usage. If a CancellableTaskFactory is used by an Oilpan heap object, the closure that the factory works with/over, cannot embed a reference back to that object by way of an off-heap Persistent<> (WTF::Closure is not on the heap.) If it does, such a reference will keep the heap object alive, without it ever being released. Memory leaks are very likely. This is too easy a slip-up to make with the current CancellableTaskFactory constructor, so rephrase the constructor so as to make leaks no longer (easily) possible. For Oilpan heap objects baked into the closure, the persistent reference now held will be weak. At the same time, take the opportunity to have this object no longer be a part object, but a separate (off-heap) allocation. This lets us drop the ad-hoc ASan unpoisoning support that was previously needed if CancellableTaskFactory was a part object of an Oilpan heap object. Less magic. R=haraken BUG= Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=201787

Patch Set 1 #

Patch Set 2 : tweaks #

Patch Set 3 : add explanatory comment #

Patch Set 4 : rebased #

Total comments: 4

Patch Set 5 : add unwrap() clarification #

Unified diffs Side-by-side diffs Delta from patch set Stats (+75 lines, -73 lines) Patch
M Source/core/dom/Document.h View 1 2 3 chunks +2 lines, -2 lines 0 comments Download
M Source/core/dom/Document.cpp View 1 2 3 4 chunks +3 lines, -21 lines 0 comments Download
M Source/core/dom/ScriptRunner.h View 1 2 3 chunks +2 lines, -2 lines 0 comments Download
M Source/core/dom/ScriptRunner.cpp View 1 2 3 4 chunks +6 lines, -16 lines 0 comments Download
M Source/core/dom/ScriptRunnerTest.cpp View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/html/parser/HTMLParserScheduler.h View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/html/parser/HTMLParserScheduler.cpp View 1 2 3 3 chunks +8 lines, -8 lines 0 comments Download
M Source/platform/heap/Handle.h View 1 2 3 4 2 chunks +22 lines, -0 lines 0 comments Download
M Source/platform/scheduler/CancellableTaskFactory.h View 1 2 3 3 chunks +29 lines, -17 lines 0 comments Download
M Source/platform/scheduler/CancellableTaskFactory.cpp View 1 2 3 1 chunk +0 lines, -5 lines 0 comments Download

Messages

Total messages: 12 (4 generated)
sof
please take a look. Still checking with the bots + verifying w/ ASan locally, but ...
5 years, 3 months ago (2015-09-03 13:49:15 UTC) #2
sof
On 2015/09/03 13:49:15, sof wrote: > please take a look. > > Still checking with ...
5 years, 3 months ago (2015-09-03 20:28:01 UTC) #3
haraken
LGTM https://codereview.chromium.org/1312843009/diff/60001/Source/platform/heap/Handle.h File Source/platform/heap/Handle.h (right): https://codereview.chromium.org/1312843009/diff/60001/Source/platform/heap/Handle.h#newcode999 Source/platform/heap/Handle.h:999: CrossThreadWeakPersistent<T> value() const { return m_value; } Just ...
5 years, 3 months ago (2015-09-03 23:39:33 UTC) #5
sof
https://codereview.chromium.org/1312843009/diff/60001/Source/platform/heap/Handle.h File Source/platform/heap/Handle.h (right): https://codereview.chromium.org/1312843009/diff/60001/Source/platform/heap/Handle.h#newcode999 Source/platform/heap/Handle.h:999: CrossThreadWeakPersistent<T> value() const { return m_value; } On 2015/09/03 ...
5 years, 3 months ago (2015-09-04 05:21:04 UTC) #6
haraken
https://codereview.chromium.org/1312843009/diff/60001/Source/platform/heap/Handle.h File Source/platform/heap/Handle.h (right): https://codereview.chromium.org/1312843009/diff/60001/Source/platform/heap/Handle.h#newcode999 Source/platform/heap/Handle.h:999: CrossThreadWeakPersistent<T> value() const { return m_value; } On 2015/09/04 ...
5 years, 3 months ago (2015-09-04 05:23:39 UTC) #7
sof
Thanks for the review; I'm glad this wrinkle has been smoothed out somewhat. https://codereview.chromium.org/1312843009/diff/60001/Source/platform/heap/Handle.h File ...
5 years, 3 months ago (2015-09-04 06:50:21 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1312843009/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1312843009/80001
5 years, 3 months ago (2015-09-04 07:09:11 UTC) #11
commit-bot: I haz the power
5 years, 3 months ago (2015-09-04 09:35:40 UTC) #12
Message was sent while issue was closed.
Committed patchset #5 (id:80001) as
https://src.chromium.org/viewvc/blink?view=rev&revision=201787

Powered by Google App Engine
This is Rietveld 408576698