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

Issue 1121463005: Fixit: Split base::TimeTicks --> TimeTicks + ThreadTicks + TraceTicks (Closed)

Created:
5 years, 7 months ago by miu
Modified:
5 years, 7 months ago
Reviewers:
Lei Zhang
CC:
chromium-reviews, mlamouri+watch-content_chromium.org, aandrey+blink_chromium.org, sadrul, tdresser+watch_chromium.org, wfh+watch_chromium.org, jam, yurys, mkwst+moarreviews-renderer_chromium.org, darin-cc_chromium.org, devtools-reviews_chromium.org, tracing+reviews_chromium.org, piman+watch_chromium.org, cc-bugs_chromium.org, erikwright+watch_chromium.org, jdduke+watch_chromium.org, pfeldman
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fixit: Split base::TimeTicks --> TimeTicks + ThreadTicks + TraceTicks TimeTicks was being overused for time values from three different clock sources. This change splits the class into three separate classes: The general-purpose monotonic time (TimeTicks), the thread-local run time (ThreadTicks), and the global system trace time (TraceTicks). Before this change, base::Time and base::TimeTicks had identical comparison and math operator overloads. This change creates an internal templated base class which all of Time, TimeTicks, ThreadTicks, and TraceTicks subclass from; in order to de-dupe this common functionality. Updated base/trace_event/* and a few outside-of-base uses of ThreadNow() and NowFromSystemTraceTime() to use the new classes. Thankfully, the compiler is now able to use type-checking to guarantee values from different clocks are not being mixed when doing time math. BUG=467417

Patch Set 1 : #

Patch Set 2 : Fix Windows compile errors, and rebase. #

Patch Set 3 : More Windows compile fixes. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+478 lines, -454 lines) Patch
M base/message_loop/message_pump_perftest.cc View 3 chunks +6 lines, -6 lines 0 comments Download
M base/threading/thread_perftest.cc View 4 chunks +8 lines, -8 lines 0 comments Download
M base/time/time.h View 1 16 chunks +208 lines, -242 lines 0 comments Download
M base/time/time.cc View 4 chunks +21 lines, -11 lines 0 comments Download
M base/time/time_mac.cc View 4 chunks +11 lines, -7 lines 0 comments Download
M base/time/time_posix.cc View 3 chunks +16 lines, -14 lines 0 comments Download
M base/time/time_unittest.cc View 3 chunks +10 lines, -9 lines 0 comments Download
M base/time/time_win.cc View 9 chunks +21 lines, -19 lines 0 comments Download
M base/time/time_win_unittest.cc View 1 2 chunks +4 lines, -3 lines 0 comments Download
M base/trace_event/trace_event.h View 1 14 chunks +28 lines, -14 lines 0 comments Download
M base/trace_event/trace_event_android.cc View 1 2 1 chunk +1 line, -2 lines 0 comments Download
M base/trace_event/trace_event_impl.h View 10 chunks +16 lines, -16 lines 0 comments Download
M base/trace_event/trace_event_impl.cc View 12 chunks +24 lines, -24 lines 0 comments Download
M base/trace_event/trace_event_unittest.cc View 4 chunks +8 lines, -12 lines 0 comments Download
M cc/debug/lap_timer.h View 1 chunk +1 line, -1 line 0 comments Download
M cc/debug/lap_timer.cc View 2 chunks +8 lines, -4 lines 0 comments Download
M cc/debug/rendering_stats_instrumentation.h View 1 chunk +2 lines, -2 lines 0 comments Download
M cc/debug/rendering_stats_instrumentation.cc View 1 chunk +10 lines, -10 lines 0 comments Download
M components/tracing/child_trace_message_filter.h View 1 chunk +2 lines, -2 lines 0 comments Download
M components/tracing/child_trace_message_filter.cc View 2 chunks +3 lines, -4 lines 0 comments Download
M components/tracing/tracing_messages.h View 2 chunks +2 lines, -2 lines 0 comments Download
M content/browser/tracing/etw_system_event_consumer_win.cc View 1 chunk +1 line, -1 line 0 comments Download
M content/browser/tracing/trace_message_filter.cc View 2 chunks +3 lines, -3 lines 0 comments Download
M content/child/blink_platform_impl.cc View 1 2 3 chunks +5 lines, -6 lines 0 comments Download
M content/renderer/devtools/v8_sampling_profiler.cc View 4 chunks +6 lines, -6 lines 0 comments Download
M gpu/perftests/measurements.h View 1 chunk +2 lines, -2 lines 0 comments Download
M gpu/perftests/measurements.cc View 3 chunks +8 lines, -8 lines 0 comments Download
M ipc/ipc_message_utils.h View 2 chunks +9 lines, -0 lines 0 comments Download
M ipc/ipc_message_utils.cc View 1 chunk +19 lines, -0 lines 0 comments Download
M ppapi/shared_impl/ppb_trace_event_impl.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.h View 1 chunk +1 line, -1 line 0 comments Download
M sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc View 1 chunk +1 line, -1 line 0 comments Download
M sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions_unittests.cc View 2 chunks +3 lines, -3 lines 0 comments Download
M ui/events/latency_info.cc View 1 chunk +4 lines, -4 lines 0 comments Download
M ui/gl/angle_platform_impl.cc View 1 2 2 chunks +3 lines, -4 lines 0 comments Download
M ui/gl/gpu_timing.cc View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 5 (2 generated)
miu
thestig: PTAL at base/time/*. If this approach looks good, I'll proceed with rest of the ...
5 years, 7 months ago (2015-05-04 20:57:19 UTC) #3
Lei Zhang
Generally sounds good. Would you consider doing the common functionality de-duping as one CL, and ...
5 years, 7 months ago (2015-05-04 22:13:30 UTC) #4
miu
5 years, 7 months ago (2015-05-05 01:22:55 UTC) #5
Message was sent while issue was closed.
On 2015/05/04 22:13:30, Lei Zhang wrote:
> Generally sounds good. Would you consider doing the common functionality
> de-duping as one CL, and adding the new time types as a second CL?

Will do.  I'll send them out shortly...

Powered by Google App Engine
This is Rietveld 408576698