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

Issue 10883061: Add 'base::Time::Max()' to explicitly refer to the end of time. (Closed)

Created:
8 years, 3 months ago by Mike West
Modified:
8 years, 3 months ago
Reviewers:
Mark Mentovai
CC:
chromium-reviews, erikwright+watch_chromium.org, brettw-cc_chromium.org, battre
Visibility:
Public.

Description

Add 'base::Time::Max()' to explicitly refer to the end of time. BrowingDataRemover (and, I imagine, other systems) recognized ranges bounded by null Time objects ('base::Time()') as referring to "everything". That introduces easily-forgotten complexity, which leads to avoidable mistakes in logic. This CL provides a mechanism for avoiding this sort of confusion in the future by adding the ability to explicitly refer to the end of time via 'base::Time::Max()'. It simply returns a Time object whose internal counter is set to the maximum int64, which means that simple comparisons like 'time <= end' will do The Right Thing™. BUG=144972 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=153514

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+17 lines, -0 lines) Patch
M base/time.h View 1 chunk +4 lines, -0 lines 0 comments Download
M base/time.cc View 2 chunks +7 lines, -0 lines 0 comments Download
M base/time_unittest.cc View 1 chunk +6 lines, -0 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Mike West
Hi Mark! I picked a name more or less at random from the base/OWNERS file, ...
8 years, 3 months ago (2012-08-27 14:48:51 UTC) #1
Mark Mentovai
LGTM
8 years, 3 months ago (2012-08-27 15:38:08 UTC) #2
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mkwst@chromium.org/10883061/1
8 years, 3 months ago (2012-08-27 16:23:24 UTC) #3
commit-bot: I haz the power
8 years, 3 months ago (2012-08-27 18:44:05 UTC) #4
Change committed as 153514

Powered by Google App Engine
This is Rietveld 408576698