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

Issue 104613003: Use Begin/End semantics for synthetic delays (Closed)

Created:
7 years ago by Sami
Modified:
6 years, 11 months ago
Reviewers:
nduca, brianderson
CC:
chromium-reviews, dsinclair+watch_chromium.org, erikwright+watch_chromium.org
Visibility:
Public.

Description

Use Begin/End semantics for synthetic delays Currently synthetic delays use an Activate/Apply scheme were Activate can be called several times and a single call to Apply will execute the delay. Both calls need to happen on the same thread. This patch changes this to a Begin/End model where the delay start point is designated with Begin and executed with End. Both calls can happen on any thread for a given delay. Calls can also be nested so that the inner Begin/End pairs do nothing and only the outermost End will apply the delay. This change is primarily to make it easier to integrate synthetic delays to asynchronous tasks such as texture uploads. One only needs to call Begin for every queued task and then End in each individual tasks to apply the delay automatically to a "burst" of work. This patch also introduces parallel versions of Begin and End. They are useful for several applying independent instances of the same delay. We also add a function for resetting all registered synthetic delays. This is needed for telemetry tests to reset delays to a clean slate between pages. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=243409

Patch Set 1 #

Patch Set 2 : Add parallel Begin/End and reset. #

Total comments: 4

Patch Set 3 : Allow several scoped delays to run in parallel. #

Patch Set 4 : Rebased. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+156 lines, -111 lines) Patch
M base/debug/trace_event_synthetic_delay.h View 1 2 3 5 chunks +44 lines, -29 lines 0 comments Download
M base/debug/trace_event_synthetic_delay.cc View 1 2 3 7 chunks +63 lines, -68 lines 0 comments Download
M base/debug/trace_event_synthetic_delay_unittest.cc View 1 2 3 2 chunks +49 lines, -14 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
Sami
7 years ago (2013-12-17 12:16:05 UTC) #1
brianderson
https://codereview.chromium.org/104613003/diff/20001/base/debug/trace_event_synthetic_delay.cc File base/debug/trace_event_synthetic_delay.cc (left): https://codereview.chromium.org/104613003/diff/20001/base/debug/trace_event_synthetic_delay.cc#oldcode22 base/debug/trace_event_synthetic_delay.cc:22: struct ThreadState { Since you are removing the thread-local ...
7 years ago (2013-12-19 00:16:58 UTC) #2
Sami
https://codereview.chromium.org/104613003/diff/20001/base/debug/trace_event_synthetic_delay.cc File base/debug/trace_event_synthetic_delay.cc (left): https://codereview.chromium.org/104613003/diff/20001/base/debug/trace_event_synthetic_delay.cc#oldcode22 base/debug/trace_event_synthetic_delay.cc:22: struct ThreadState { On 2013/12/19 00:16:59, Brian Anderson wrote: ...
7 years ago (2013-12-19 11:14:59 UTC) #3
nduca
lgtm
6 years, 11 months ago (2014-01-07 19:13:53 UTC) #4
brianderson
lgtm too
6 years, 11 months ago (2014-01-07 19:15:10 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/skyostil@chromium.org/104613003/80001
6 years, 11 months ago (2014-01-07 19:53:54 UTC) #6
commit-bot: I haz the power
6 years, 11 months ago (2014-01-07 22:28:45 UTC) #7
Message was sent while issue was closed.
Change committed as 243409

Powered by Google App Engine
This is Rietveld 408576698