|
|
Created:
5 years, 6 months ago by sof Modified:
5 years, 6 months ago CC:
blink-reviews Base URL:
svn://svn.chromium.org/blink/trunk Target Ref:
refs/heads/master Project:
blink Visibility:
Public. |
DescriptionOilpan: make SuspendableScriptExecutor safe.
This ActiveDOMObject was missing two pieces:
- remove itself as an Observer upon completion.
- promptly stop itself as a timer upon finalization.
R=haraken
BUG=502858
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=197644
Patch Set 1 #
Total comments: 2
Patch Set 2 : re-intro RefCountedGarbageCollected #
Total comments: 3
Messages
Total messages: 18 (6 generated)
sigbjornf@opera.com changed reviewers: + oilpan-reviews@chromium.org
sigbjornf@opera.com changed reviewers: + oilpan-reviews@chromium.org
please take a look.
please take a look.
haraken@chromium.org changed reviewers: + haraken@chromium.org
https://codereview.chromium.org/1197163003/diff/1/Source/web/SuspendableScrip... File Source/web/SuspendableScriptExecutor.cpp (right): https://codereview.chromium.org/1197163003/diff/1/Source/web/SuspendableScrip... Source/web/SuspendableScriptExecutor.cpp:21: #if !ENABLE(OILPAN) In Oilpan, who keeps the SuspendableScriptExecutor alive? One option to keep the current lifetime relationship would be to use RefCountedGarbageCollected. Then we can use ref/deref.
https://codereview.chromium.org/1197163003/diff/1/Source/web/SuspendableScrip... File Source/web/SuspendableScriptExecutor.cpp (right): https://codereview.chromium.org/1197163003/diff/1/Source/web/SuspendableScrip... Source/web/SuspendableScriptExecutor.cpp:21: #if !ENABLE(OILPAN) On 2015/06/23 08:12:01, haraken wrote: > > In Oilpan, who keeps the SuspendableScriptExecutor alive? > > One option to keep the current lifetime relationship would be to use > RefCountedGarbageCollected. Then we can use ref/deref. Done.
https://codereview.chromium.org/1197163003/diff/20001/Source/web/SuspendableS... File Source/web/SuspendableScriptExecutor.cpp (right): https://codereview.chromium.org/1197163003/diff/20001/Source/web/SuspendableS... Source/web/SuspendableScriptExecutor.cpp:91: ActiveDOMObject::clearContext(); Is this a performance optimization? Or do we need to explicitly remove the observer for correctness? (It seems a bit strange to call clearContext in contextDestroyed.)
https://codereview.chromium.org/1197163003/diff/20001/Source/web/SuspendableS... File Source/web/SuspendableScriptExecutor.cpp (right): https://codereview.chromium.org/1197163003/diff/20001/Source/web/SuspendableS... Source/web/SuspendableScriptExecutor.cpp:91: ActiveDOMObject::clearContext(); On 2015/06/23 09:25:56, haraken wrote: > > Is this a performance optimization? Or do we need to explicitly remove the > observer for correctness? > > (It seems a bit strange to call clearContext in contextDestroyed.) I think it makes sense to remove oneself here, rather than keep a weak reference lingering. We know this observer's lifetime is up.
https://codereview.chromium.org/1197163003/diff/20001/Source/web/SuspendableS... File Source/web/SuspendableScriptExecutor.cpp (right): https://codereview.chromium.org/1197163003/diff/20001/Source/web/SuspendableS... Source/web/SuspendableScriptExecutor.cpp:91: ActiveDOMObject::clearContext(); On 2015/06/23 09:40:59, sof wrote: > On 2015/06/23 09:25:56, haraken wrote: > > > > Is this a performance optimization? Or do we need to explicitly remove the > > observer for correctness? > > > > (It seems a bit strange to call clearContext in contextDestroyed.) > > I think it makes sense to remove oneself here, rather than keep a weak reference > lingering. We know this observer's lifetime is up. Makes sense. (I'd prefer calling ActiveDOMObject::clearContext() only in executeAndDestroySelf() though; it's up to you.)
On 2015/06/23 09:44:55, haraken wrote: > https://codereview.chromium.org/1197163003/diff/20001/Source/web/SuspendableS... > File Source/web/SuspendableScriptExecutor.cpp (right): > > https://codereview.chromium.org/1197163003/diff/20001/Source/web/SuspendableS... > Source/web/SuspendableScriptExecutor.cpp:91: ActiveDOMObject::clearContext(); > On 2015/06/23 09:40:59, sof wrote: > > On 2015/06/23 09:25:56, haraken wrote: > > > > > > Is this a performance optimization? Or do we need to explicitly remove the > > > observer for correctness? > > > > > > (It seems a bit strange to call clearContext in contextDestroyed.) > > > > I think it makes sense to remove oneself here, rather than keep a weak > reference > > lingering. We know this observer's lifetime is up. > > Makes sense. (I'd prefer calling ActiveDOMObject::clearContext() only in > executeAndDestroySelf() though; it's up to you.) LGTM.
The CQ bit was checked by sigbjornf@opera.com
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1197163003/20001
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: mac_blink_rel on tryserver.blink (JOB_FAILED, http://build.chromium.org/p/tryserver.blink/builders/mac_blink_rel/builds/60256)
The CQ bit was checked by sigbjornf@opera.com
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1197163003/20001
Message was sent while issue was closed.
Committed patchset #2 (id:20001) as https://src.chromium.org/viewvc/blink?view=rev&revision=197644 |