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

Issue 483: Eliminate the TimerManager by pulling its priority queue into MessageLoop.... (Closed)

Created:
12 years, 3 months ago by darin (slow to review)
Modified:
9 years, 7 months ago
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

Eliminate the TimerManager by pulling its priority queue into MessageLoop. This CL also eliminates TaskBase by creating a simple PendingTask struct that is allocated inline within a std::queue used to implement the queues in the MessageLoop class. R=jar Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=1825

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Patch Set 5 : '' #

Patch Set 6 : '' #

Patch Set 7 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+392 lines, -1163 lines) Patch
M base/message_loop.h View 1 2 3 4 5 10 chunks +57 lines, -115 lines 0 comments Download
M base/message_loop.cc View 1 2 3 4 5 9 chunks +139 lines, -199 lines 0 comments Download
M base/message_loop_unittest.cc View 1 2 3 4 5 6 4 chunks +186 lines, -6 lines 0 comments Download
M base/task.h View 1 2 3 4 5 3 chunks +1 line, -77 lines 0 comments Download
M base/timer.h View 1 2 3 4 5 2 chunks +0 lines, -197 lines 0 comments Download
M base/timer.cc View 1 2 3 4 5 1 chunk +0 lines, -207 lines 0 comments Download
M base/timer_unittest.cc View 1 2 3 4 5 3 chunks +0 lines, -356 lines 0 comments Download
M base/tracked.h View 1 2 3 4 5 2 chunks +4 lines, -0 lines 0 comments Download
M base/tracked_objects_unittest.cc View 1 2 3 4 5 2 chunks +4 lines, -6 lines 0 comments Download
M base/worker_pool.cc View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 2 (0 generated)
darin (slow to review)
12 years, 3 months ago (2008-09-06 01:23:19 UTC) #1
jar (doing other things)
12 years, 3 months ago (2008-09-06 07:56:36 UTC) #2
Nice job.  LGTM (with suggestions for test improvements below).

http://codereview.chromium.org/483/diff/72/216
File base/message_loop_unittest.cc (right):

http://codereview.chromium.org/483/diff/72/216#newcode164
Line 164: PlatformThread::Sleep(pause_ms_);
I personally like this sort of testing... but I've found it creates flaky tests
no matter how long I set the delays for :-/

http://codereview.chromium.org/483/diff/72/216#newcode204
Line 204: loop.PostDelayedTask(
This is an example of a soon-to-be flaky test :-(.
If line 204 pauses for 50ms before running, this test will fail.
That sort of delay will happen now an then.

http://codereview.chromium.org/483/diff/72/216#newcode219
Line 219: // NOTE: This is actually a pretty lame test since the API only takes
a
I actually like this test.  Note that if you got the sequence number comparison
backwards, then this test will (often) fail.  This is a nice test :-)

http://codereview.chromium.org/483/diff/72/216#newcode268
Line 268: // Test that a delayed task still runs after a pile of normal tasks. 
The key
I think this is trying to check that you really fixed the non-FIFO bug where a
delayed task may run sooner than it could run if it had no delay.

Some day, with faster and faster CPUs, this test will run the 2001 initial tasks
in under 1ms all the time.

A better test may be running 3 slow tasks (with something like a 10ms sleep),
followed by one delayed task (delayed a mere 1ms).

Powered by Google App Engine
This is Rietveld 408576698