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

Unified Diff: base/time/time_posix.cc

Issue 2392873002: Use largest supported date for cookies if timegm overflows
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/time/time.h ('k') | net/cookies/cookie_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/time/time_posix.cc
diff --git a/base/time/time_posix.cc b/base/time/time_posix.cc
index ac0e99f7eb61b30de3eb16556f77869a8ee4704b..89a896ae4e8926433358181fab81c178c19f0b40 100644
--- a/base/time/time_posix.cc
+++ b/base/time/time_posix.cc
@@ -338,6 +338,16 @@ bool Time::FromExploded(bool is_local, const Exploded& exploded, Time* time) {
return false;
}
+Time Time::GetMaxPlatformTime() {
+ const int64_t max_seconds = (sizeof(SysTime) < sizeof(int64_t))
+ ? std::numeric_limits<SysTime>::max()
+ : std::numeric_limits<int32_t>::max();
+ int64_t milliseconds = max_seconds * kMillisecondsPerSecond;
+ milliseconds += (kMillisecondsPerSecond - 1);
+ return Time((milliseconds * kMicrosecondsPerMillisecond) +
+ kWindowsEpochDeltaMicroseconds);
+}
+
// TimeTicks ------------------------------------------------------------------
// static
TimeTicks TimeTicks::Now() {
« no previous file with comments | « base/time/time.h ('k') | net/cookies/cookie_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698