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

Issue 1122443004: Fixit: Factor out common base::Time* math operator overloads. (Closed)

Created:
5 years, 7 months ago by miu
Modified:
5 years, 7 months ago
Reviewers:
Lei Zhang
CC:
chromium-reviews, erikwright+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fixit: Factor out common base::Time* math operator overloads. This is part 1 of a 2-part change to fork base::TimeTicks into three type-checked time classes (TimeTicks + ThreadTicks + TraceTicks). The forking of TimeTicks will ensure values from different clocks are not erroneously being mixed together when doing time math. In this change, the identical comparison and math operator overloads found in base::Time and base::TimeTicks are being factored-out into a templated base class. In a following change, this base class will also be used to de-dupe this common functionality in the two new time classes. BUG=467417 Committed: https://crrev.com/7ca717095b4758cb76e53e904b775852e46d646d Cr-Commit-Position: refs/heads/master@{#328696}

Patch Set 1 #

Total comments: 9

Patch Set 2 : Added/Fixed comments. Added is_zero(). #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+171 lines, -219 lines) Patch
M base/time/time.h View 1 17 chunks +158 lines, -206 lines 1 comment Download
M base/time/time.cc View 1 3 chunks +11 lines, -11 lines 0 comments Download
M base/time/time_unittest.cc View 2 chunks +2 lines, -2 lines 0 comments Download

Messages

Total messages: 11 (3 generated)
miu
thestig: PTAL. As requested in https://codereview.chromium.org/1121463005, I've split the change into two parts.
5 years, 7 months ago (2015-05-05 01:39:41 UTC) #2
Lei Zhang
https://codereview.chromium.org/1122443004/diff/1/base/time/time.cc File base/time/time.cc (right): https://codereview.chromium.org/1122443004/diff/1/base/time/time.cc#newcode315 base/time/time.cc:315: if (interval_offset != base::TimeDelta() && tick_phase < *this) There's ...
5 years, 7 months ago (2015-05-05 21:52:42 UTC) #3
miu
https://codereview.chromium.org/1122443004/diff/1/base/time/time.cc File base/time/time.cc (right): https://codereview.chromium.org/1122443004/diff/1/base/time/time.cc#newcode315 base/time/time.cc:315: if (interval_offset != base::TimeDelta() && tick_phase < *this) On ...
5 years, 7 months ago (2015-05-06 18:29:17 UTC) #5
Lei Zhang
lgtm https://codereview.chromium.org/1122443004/diff/1/base/time/time.h File base/time/time.h (right): https://codereview.chromium.org/1122443004/diff/1/base/time/time.h#newcode197 base/time/time.h:197: TimeDelta operator%(TimeDelta a) const { On 2015/05/06 18:29:17, ...
5 years, 7 months ago (2015-05-06 21:41:31 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1122443004/40001
5 years, 7 months ago (2015-05-07 02:03:54 UTC) #8
commit-bot: I haz the power
Committed patchset #2 (id:40001)
5 years, 7 months ago (2015-05-07 03:45:03 UTC) #9
commit-bot: I haz the power
Patchset 2 (id:??) landed as https://crrev.com/7ca717095b4758cb76e53e904b775852e46d646d Cr-Commit-Position: refs/heads/master@{#328696}
5 years, 7 months ago (2015-05-07 03:46:30 UTC) #10
Kunihiko Sakamoto
5 years, 7 months ago (2015-05-07 04:32:36 UTC) #11
Message was sent while issue was closed.
A revert of this CL (patchset #2 id:40001) has been created in
https://codereview.chromium.org/1130953002/ by ksakamoto@chromium.org.

The reason for reverting is: Broke iOS build.

http://build.chromium.org/p/chromium.mac/builders/iOS_Device/builds/5621/step...
.

Powered by Google App Engine
This is Rietveld 408576698