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

Unified Diff: src/date.h

Issue 2731463003: [date] Refactor TimezoneCache to be separate from the OS (Closed)
Patch Set: Properly reference windows function Created 3 years, 10 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 | « src/base/timezone-cache.h ('k') | src/date.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/date.h
diff --git a/src/date.h b/src/date.h
index 0a3e91beb26589e1b5078e420bfe07a8b18ada25..1a3b65638ce951909429613a1f4fd46345f46a80 100644
--- a/src/date.h
+++ b/src/date.h
@@ -7,9 +7,9 @@
#include "src/allocation.h"
#include "src/base/platform/platform.h"
+#include "src/base/timezone-cache.h"
#include "src/globals.h"
-
namespace v8 {
namespace internal {
@@ -44,7 +44,7 @@ class DateCache {
}
virtual ~DateCache() {
- base::OS::DisposeTimezoneCache(tz_cache_);
+ delete tz_cache_;
tz_cache_ = NULL;
}
@@ -93,7 +93,7 @@ class DateCache {
if (time_ms < 0 || time_ms > kMaxEpochTimeInMs) {
time_ms = EquivalentTime(time_ms);
}
- return base::OS::LocalTimezone(static_cast<double>(time_ms), tz_cache_);
+ return tz_cache_->LocalTimezone(static_cast<double>(time_ms));
}
// ECMA 262 - 15.9.5.26
@@ -204,12 +204,11 @@ class DateCache {
// These functions are virtual so that we can override them when testing.
virtual int GetDaylightSavingsOffsetFromOS(int64_t time_sec) {
double time_ms = static_cast<double>(time_sec * 1000);
- return static_cast<int>(
- base::OS::DaylightSavingsOffset(time_ms, tz_cache_));
+ return static_cast<int>(tz_cache_->DaylightSavingsOffset(time_ms));
}
virtual int GetLocalOffsetFromOS() {
- double offset = base::OS::LocalTimeOffset(tz_cache_);
+ double offset = tz_cache_->LocalTimeOffset();
DCHECK(offset < kInvalidLocalOffsetInMs);
return static_cast<int>(offset);
}
« no previous file with comments | « src/base/timezone-cache.h ('k') | src/date.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698