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

Issue 364873002: Introduce a basic Blink Scheduler (Closed)

Created:
6 years, 5 months ago by Sami
Modified:
6 years, 4 months ago
Project:
blink
Visibility:
Public.

Description

Introduce a basic Blink Scheduler This patch adds a bare-bones scheduler for prioritizing tasks that run on the Blink main thread. The initial scheduling policy is to simply run all tasks in their posted order. The shared timer, WTF::callOnMainThread and by extension WebCore::MainThreadTaskRunner are modified to route their tasks through the Scheduler for eventual prioritization. A proxy for the scheduler is also exposed in public/platform so that modules in content will be able to post high priority (e.g., input and compositor-related) tasks. Design document: https://docs.google.com/a/chromium.org/document/d/11N2WTV3M0IkZ-kQlKWlBcwkOkKTCuLXGVNylK5E2zvc/edit#heading=h.3ay9sj44f0zd BUG=391005 TEST=SchedulerTest.* Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=178267

Patch Set 1 #

Patch Set 2 : Link fix. #

Patch Set 3 : Basic prioritized task dispatch. #

Patch Set 4 : Basic timer scheduling. #

Patch Set 5 : Compositor tasks. #

Patch Set 6 : Rebased. #

Total comments: 2

Patch Set 7 : Blink scheduler phase 0. #

Patch Set 8 : Build fix for old gcc. #

Total comments: 11

Patch Set 9 : Rebased. #

Patch Set 10 : Review feedback. #

Total comments: 2

Patch Set 11 : Cleaned up includes + build fix. #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+476 lines, -6 lines) Patch
M Source/platform/SharedTimer.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +4 lines, -3 lines 0 comments Download
M Source/platform/ThreadTimers.cpp View 1 2 3 4 5 6 7 8 9 2 chunks +3 lines, -2 lines 0 comments Download
M Source/platform/blink_platform.gypi View 1 2 3 4 5 6 3 chunks +4 lines, -0 lines 0 comments Download
A Source/platform/exported/WebSchedulerProxy.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +48 lines, -0 lines 0 comments Download
A Source/platform/scheduler/Scheduler.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +64 lines, -0 lines 0 comments Download
A Source/platform/scheduler/Scheduler.cpp View 1 2 3 4 5 6 7 8 9 10 1 chunk +117 lines, -0 lines 1 comment Download
A Source/platform/scheduler/SchedulerTest.cpp View 1 2 3 4 5 6 7 8 9 10 1 chunk +194 lines, -0 lines 0 comments Download
M Source/web/WebKit.cpp View 1 2 3 4 5 6 7 8 9 10 4 chunks +4 lines, -1 line 0 comments Download
A public/platform/WebSchedulerProxy.h View 1 2 3 4 5 6 7 8 9 1 chunk +38 lines, -0 lines 0 comments Download

Messages

Total messages: 13 (0 generated)
mithro-old
Hi Sami, I know you mentioned this wasn't for review yet, but wanted to better ...
6 years, 5 months ago (2014-07-08 10:38:11 UTC) #1
Sami
Hi Tim, Have a look here: https://codereview.chromium.org/363383002 :)
6 years, 5 months ago (2014-07-08 11:08:05 UTC) #2
Sami
https://codereview.chromium.org/364873002/diff/100001/Source/platform/ThreadTimers.cpp File Source/platform/ThreadTimers.cpp (right): https://codereview.chromium.org/364873002/diff/100001/Source/platform/ThreadTimers.cpp#newcode142 Source/platform/ThreadTimers.cpp:142: if (!m_firingTimers || timeToQuit < monotonicallyIncreasingTime() || Scheduler::current()->shouldYieldForHighPriorityWork()) Note ...
6 years, 5 months ago (2014-07-08 15:58:29 UTC) #3
eseidel
Very interesting. At first glance it's not clear to me why WebScheduler straddles the web ...
6 years, 5 months ago (2014-07-08 19:00:05 UTC) #4
Sami
Hi all, I think we can now turn this into a proper review. To keep ...
6 years, 5 months ago (2014-07-11 16:05:29 UTC) #5
eseidel
looks good. Lets talk more at our meeting. This looks like it has no functional ...
6 years, 5 months ago (2014-07-15 15:59:11 UTC) #6
Sami
Thanks Eric. Another look please? https://codereview.chromium.org/364873002/diff/140001/Source/platform/ThreadTimers.cpp File Source/platform/ThreadTimers.cpp (right): https://codereview.chromium.org/364873002/diff/140001/Source/platform/ThreadTimers.cpp#newcode142 Source/platform/ThreadTimers.cpp:142: if (!m_firingTimers || timeToQuit ...
6 years, 5 months ago (2014-07-15 19:20:06 UTC) #7
eseidel
lgtm https://codereview.chromium.org/364873002/diff/180001/Source/platform/scheduler/Scheduler.h File Source/platform/scheduler/Scheduler.h (right): https://codereview.chromium.org/364873002/diff/180001/Source/platform/scheduler/Scheduler.h#newcode13 Source/platform/scheduler/Scheduler.h:13: #include <deque> Why is this needed?
6 years, 5 months ago (2014-07-15 19:32:37 UTC) #8
Sami
https://codereview.chromium.org/364873002/diff/180001/Source/platform/scheduler/Scheduler.h File Source/platform/scheduler/Scheduler.h (right): https://codereview.chromium.org/364873002/diff/180001/Source/platform/scheduler/Scheduler.h#newcode13 Source/platform/scheduler/Scheduler.h:13: #include <deque> On 2014/07/15 19:32:37, eseidel wrote: > Why ...
6 years, 5 months ago (2014-07-16 10:28:07 UTC) #9
Sami
The CQ bit was checked by skyostil@chromium.org
6 years, 5 months ago (2014-07-16 10:28:12 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/skyostil@chromium.org/364873002/200001
6 years, 5 months ago (2014-07-16 10:29:17 UTC) #11
commit-bot: I haz the power
Change committed as 178267
6 years, 5 months ago (2014-07-16 11:41:57 UTC) #12
picksi1
6 years, 4 months ago (2014-08-01 10:36:12 UTC) #13
Message was sent while issue was closed.
https://codereview.chromium.org/364873002/diff/200001/Source/platform/schedul...
File Source/platform/scheduler/Scheduler.cpp (right):

https://codereview.chromium.org/364873002/diff/200001/Source/platform/schedul...
Source/platform/scheduler/Scheduler.cpp:41: s_sharedScheduler = new Scheduler();
nit: Is it worth checking that s_sharedScheduler is null (or call shutdown?)
before this allocation in case we get multiple initialize calls and this leaks?

Powered by Google App Engine
This is Rietveld 408576698