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

Issue 866273005: Teach ScriptRunner how to yield and post on loading task queue (Closed)

Created:
5 years, 10 months ago by alex clarke (OOO till 29th)
Modified:
5 years, 9 months ago
Reviewers:
tkent, haraken, sof, Sami, marja
CC:
blink-reviews, blink-reviews-dom_chromium.org, dglazkov+blink, eae+blinkwatch, rwlbuis, oilpan-reviews
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Teach ScriptRunner how to yield Previously ScriptRunner could execute an arbitrary number of scripts leading to janks. Now ScriptRunner polls shouldYieldForHighPriorityWork before running each script. In addition the task to execute the scripts is now posted on the loading task queue. BUG=456777 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=190648 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=190766

Patch Set 1 #

Patch Set 2 : Post on loading task queue #

Patch Set 3 : Dont run scripts that are not ready #

Total comments: 10

Patch Set 4 : Unit tests! #

Patch Set 5 : Needed to shutdown the sheduler owned by MockPlatform in TearDown() #

Total comments: 11

Patch Set 6 : Sami's comments #

Patch Set 7 : Fix spelling mistake #

Total comments: 19

Patch Set 8 : Responding to feedback re task cancellation #

Total comments: 4

Patch Set 9 : Make executeScripts() always run at least one script #

Patch Set 10 : Really fix assert on windows #

Total comments: 1

Patch Set 11 : Oilpan leak fix #

Patch Set 12 : Rebase #

Patch Set 13 : Rebase try 2 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+538 lines, -28 lines) Patch
M Source/core/core.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/dom/ScriptLoader.h View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +5 lines, -4 lines 0 comments Download
M Source/core/dom/ScriptRunner.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +10 lines, -6 lines 0 comments Download
M Source/core/dom/ScriptRunner.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +54 lines, -18 lines 0 comments Download
A Source/core/dom/ScriptRunnerTest.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +468 lines, -0 lines 0 comments Download

Messages

Total messages: 64 (21 generated)
alex clarke (OOO till 29th)
5 years, 10 months ago (2015-02-09 17:59:14 UTC) #2
Sami
Added some comments and kicked off some blink tryjobs. https://codereview.chromium.org/866273005/diff/40001/Source/core/dom/ScriptRunner.cpp File Source/core/dom/ScriptRunner.cpp (left): https://codereview.chromium.org/866273005/diff/40001/Source/core/dom/ScriptRunner.cpp#oldcode137 Source/core/dom/ScriptRunner.cpp:137: ...
5 years, 10 months ago (2015-02-10 18:40:01 UTC) #3
alex clarke (OOO till 29th)
PTAL https://codereview.chromium.org/866273005/diff/40001/Source/core/dom/ScriptRunner.cpp File Source/core/dom/ScriptRunner.cpp (left): https://codereview.chromium.org/866273005/diff/40001/Source/core/dom/ScriptRunner.cpp#oldcode137 Source/core/dom/ScriptRunner.cpp:137: scriptLoaders.swap(m_scriptsToExecuteSoon); On 2015/02/10 18:40:01, Sami wrote: > Should ...
5 years, 10 months ago (2015-02-18 18:28:20 UTC) #6
alex clarke (OOO till 29th)
PTAL
5 years, 10 months ago (2015-02-18 18:28:21 UTC) #7
Sami
Looks great. Thanks for adding the really comprehensive tests. Is it easy to check the ...
5 years, 10 months ago (2015-02-19 12:52:14 UTC) #8
Sami
https://codereview.chromium.org/866273005/diff/120001/Source/core/dom/ScriptRunner.cpp File Source/core/dom/ScriptRunner.cpp (right): https://codereview.chromium.org/866273005/diff/120001/Source/core/dom/ScriptRunner.cpp#newcode168 Source/core/dom/ScriptRunner.cpp:168: if (Scheduler::shared()->shouldYieldForHighPriorityWork()) { On 2015/02/19 12:52:13, Sami wrote: > ...
5 years, 10 months ago (2015-02-19 13:40:00 UTC) #9
alex clarke (OOO till 29th)
PTAL https://codereview.chromium.org/866273005/diff/120001/Source/core/dom/ScriptRunner.cpp File Source/core/dom/ScriptRunner.cpp (right): https://codereview.chromium.org/866273005/diff/120001/Source/core/dom/ScriptRunner.cpp#newcode104 Source/core/dom/ScriptRunner.cpp:104: Scheduler::shared()->postLoadingTask(FROM_HERE, m_executeScriptsTaskFactory.task()); On 2015/02/19 12:52:13, Sami wrote: > ...
5 years, 10 months ago (2015-02-19 15:11:33 UTC) #10
Sami
lgtm. https://codereview.chromium.org/866273005/diff/120001/Source/core/dom/ScriptRunnerTest.cpp File Source/core/dom/ScriptRunnerTest.cpp (right): https://codereview.chromium.org/866273005/diff/120001/Source/core/dom/ScriptRunnerTest.cpp#newcode205 Source/core/dom/ScriptRunnerTest.cpp:205: // Make sure the async scripts where run ...
5 years, 10 months ago (2015-02-19 16:25:53 UTC) #11
alex clarke (OOO till 29th)
+marja & sof since you seem the most knowledgeable reviewers for this class. The motivation ...
5 years, 10 months ago (2015-02-19 16:37:06 UTC) #14
sof
Good work, just some details noticed. https://codereview.chromium.org/866273005/diff/160001/Source/core/dom/ScriptRunner.cpp File Source/core/dom/ScriptRunner.cpp (right): https://codereview.chromium.org/866273005/diff/160001/Source/core/dom/ScriptRunner.cpp#newcode171 Source/core/dom/ScriptRunner.cpp:171: if (Scheduler::shared()->shouldYieldForHighPriorityWork()) { ...
5 years, 10 months ago (2015-02-20 07:48:50 UTC) #15
marja
https://codereview.chromium.org/866273005/diff/160001/Source/core/dom/ScriptRunner.cpp File Source/core/dom/ScriptRunner.cpp (right): https://codereview.chromium.org/866273005/diff/160001/Source/core/dom/ScriptRunner.cpp#newcode105 Source/core/dom/ScriptRunner.cpp:105: Scheduler::shared()->postLoadingTask(FROM_HERE, m_executeScriptsTaskFactory.task()); Hmm, so, does this mean that if ...
5 years, 10 months ago (2015-02-20 09:34:37 UTC) #16
marja
lgtm though, after you address sof's comments. I'm not sure about the task cancelling behavior ...
5 years, 10 months ago (2015-02-20 09:37:44 UTC) #17
alex clarke (OOO till 29th)
I added a helper postTaskIfOneIsNotAlreadyInFlight() which addresses marja@'s concern. PTAL https://codereview.chromium.org/866273005/diff/160001/Source/core/dom/ScriptRunner.cpp File Source/core/dom/ScriptRunner.cpp (right): https://codereview.chromium.org/866273005/diff/160001/Source/core/dom/ScriptRunner.cpp#newcode105 ...
5 years, 10 months ago (2015-02-20 11:59:35 UTC) #19
marja
still lgtm w/ nits + comment https://codereview.chromium.org/866273005/diff/180001/Source/core/dom/ScriptRunner.cpp File Source/core/dom/ScriptRunner.cpp (right): https://codereview.chromium.org/866273005/diff/180001/Source/core/dom/ScriptRunner.cpp#newcode170 Source/core/dom/ScriptRunner.cpp:170: if (shouldYieldForHighPriorityWork()) Another ...
5 years, 10 months ago (2015-02-20 12:06:52 UTC) #20
sof
lgtm
5 years, 10 months ago (2015-02-20 12:13:07 UTC) #21
alex clarke (OOO till 29th)
https://codereview.chromium.org/866273005/diff/180001/Source/core/dom/ScriptRunner.cpp File Source/core/dom/ScriptRunner.cpp (right): https://codereview.chromium.org/866273005/diff/180001/Source/core/dom/ScriptRunner.cpp#newcode170 Source/core/dom/ScriptRunner.cpp:170: if (shouldYieldForHighPriorityWork()) On 2015/02/20 12:06:52, marja wrote: > Another ...
5 years, 10 months ago (2015-02-20 13:40:17 UTC) #23
Sami
Still lgtm.
5 years, 10 months ago (2015-02-20 14:42:24 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/866273005/200001
5 years, 10 months ago (2015-02-20 14:59:29 UTC) #26
commit-bot: I haz the power
Try jobs failed on following builders: linux_blink_dbg on tryserver.blink (JOB_FAILED, http://build.chromium.org/p/tryserver.blink/builders/linux_blink_dbg/builds/46177)
5 years, 10 months ago (2015-02-20 16:14:54 UTC) #28
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/866273005/220001
5 years, 10 months ago (2015-02-20 16:44:07 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/866273005/240001
5 years, 10 months ago (2015-02-20 18:19:12 UTC) #34
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/866273005/240001
5 years, 10 months ago (2015-02-20 18:19:57 UTC) #37
commit-bot: I haz the power
Try jobs failed on following builders: win_blink_rel on tryserver.blink (JOB_FAILED, http://build.chromium.org/p/tryserver.blink/builders/win_blink_rel/builds/51723)
5 years, 10 months ago (2015-02-20 21:13:47 UTC) #39
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/866273005/260001
5 years, 10 months ago (2015-02-23 10:05:14 UTC) #42
commit-bot: I haz the power
Committed patchset #10 (id:260001) as https://src.chromium.org/viewvc/blink?view=rev&revision=190648
5 years, 10 months ago (2015-02-23 11:20:48 UTC) #43
sof
Causes some leaks on the Oilpan leak bots (5k of them) + webkit unit tests ...
5 years, 10 months ago (2015-02-23 14:18:31 UTC) #44
alex clarke (OOO till 29th)
A revert of this CL (patchset #10 id:260001) has been created in https://codereview.chromium.org/936493003/ by alexclarke@chromium.org. ...
5 years, 10 months ago (2015-02-23 14:24:33 UTC) #45
sof
https://codereview.chromium.org/866273005/diff/260001/Source/core/dom/ScriptRunner.cpp File Source/core/dom/ScriptRunner.cpp (right): https://codereview.chromium.org/866273005/diff/260001/Source/core/dom/ScriptRunner.cpp#newcode40 Source/core/dom/ScriptRunner.cpp:40: , m_executeScriptsTaskFactory(WTF::bind(&ScriptRunner::executeScripts, this)) This creates a Persistent back reference ...
5 years, 10 months ago (2015-02-23 14:49:09 UTC) #46
sof
On 2015/02/23 14:49:09, sof wrote: > https://codereview.chromium.org/866273005/diff/260001/Source/core/dom/ScriptRunner.cpp > File Source/core/dom/ScriptRunner.cpp (right): > > https://codereview.chromium.org/866273005/diff/260001/Source/core/dom/ScriptRunner.cpp#newcode40 > ...
5 years, 10 months ago (2015-02-23 15:20:41 UTC) #47
haraken
tkent-san might have an idea since he designed cross-thread tasks in oilpan.
5 years, 10 months ago (2015-02-23 17:22:44 UTC) #49
tkent
We shouldn't revert a CL for Oilpan-only failures. You may re-land this as is. Oilpan-team ...
5 years, 10 months ago (2015-02-24 03:38:20 UTC) #50
sof
On 2015/02/24 03:38:20, tkent wrote: > We shouldn't revert a CL for Oilpan-only failures. You ...
5 years, 10 months ago (2015-02-24 08:27:43 UTC) #51
marja
Re: Oilpan, I'm slightly worried about Oilpan-compatible programming patterns and their understandability. It seems that ...
5 years, 10 months ago (2015-02-24 08:31:50 UTC) #52
haraken
On 2015/02/24 08:31:50, marja wrote: > Re: Oilpan, I'm slightly worried about Oilpan-compatible programming patterns ...
5 years, 10 months ago (2015-02-24 08:40:59 UTC) #53
sof
On 2015/02/24 08:40:59, haraken wrote: > On 2015/02/24 08:31:50, marja wrote: > > Re: Oilpan, ...
5 years, 10 months ago (2015-02-24 08:46:53 UTC) #54
marja
Yes - in addition, Oilpan is supposed to make it easier. Equally hard is not ...
5 years, 10 months ago (2015-02-24 08:48:58 UTC) #55
alex clarke (OOO till 29th)
On 2015/02/24 03:38:20, tkent wrote: > We shouldn't revert a CL for Oilpan-only failures. You ...
5 years, 10 months ago (2015-02-24 14:20:02 UTC) #56
sof
On 2015/02/24 14:20:02, alexclarke1 wrote: > On 2015/02/24 03:38:20, tkent wrote: > > We shouldn't ...
5 years, 10 months ago (2015-02-24 14:28:45 UTC) #57
alex clarke (OOO till 29th)
On 2015/02/24 14:28:45, sof wrote: > On 2015/02/24 14:20:02, alexclarke1 wrote: > > On 2015/02/24 ...
5 years, 10 months ago (2015-02-24 15:00:04 UTC) #58
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/866273005/320001
5 years, 10 months ago (2015-02-24 15:37:21 UTC) #61
sof
On 2015/02/24 15:00:04, alexclarke1 wrote: > On 2015/02/24 14:28:45, sof wrote: > > On 2015/02/24 ...
5 years, 10 months ago (2015-02-24 16:31:15 UTC) #62
commit-bot: I haz the power
Committed patchset #13 (id:320001) as https://src.chromium.org/viewvc/blink?view=rev&revision=190766
5 years, 10 months ago (2015-02-24 18:00:12 UTC) #63
hiroshige
5 years, 9 months ago (2015-03-04 06:49:14 UTC) #64
Message was sent while issue was closed.
The newly-added test ScriptRunnerTest.QueueSingleScript_Async fails on the first
run (and succeeds on retry).
https://crbug.com/463807
Could you take a look?

Powered by Google App Engine
This is Rietveld 408576698