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

Unified Diff: src/base/timezone-cache.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/platform/platform-win32.cc ('k') | src/date.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/base/timezone-cache.h
diff --git a/src/base/timezone-cache.h b/src/base/timezone-cache.h
new file mode 100644
index 0000000000000000000000000000000000000000..ff9fde4d15a0152129abd29e1d3b8a5cbea65152
--- /dev/null
+++ b/src/base/timezone-cache.h
@@ -0,0 +1,38 @@
+// Copyright 2017 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef V8_BASE_TIMEZONE_CACHE_H_
+#define V8_BASE_TIMEZONE_CACHE_H_
+
+namespace v8 {
+namespace base {
+
+class TimezoneCache {
+ public:
+ // Short name of the local timezone (e.g., EST)
+ virtual const char* LocalTimezone(double time_ms) = 0;
+
+ // ES #sec-daylight-saving-time-adjustment
+ // Daylight Saving Time Adjustment
+ virtual double DaylightSavingsOffset(double time_ms) = 0;
+
+ // ES #sec-local-time-zone-adjustment
+ // Local Time Zone Adjustment
+ //
+ // TODO(littledan): Make more accurate with another parameter along the
+ // lines of this spec change:
+ // https://github.com/tc39/ecma262/pull/778
+ virtual double LocalTimeOffset() = 0;
+
+ // Called when the local timezone changes
+ virtual void Clear() = 0;
+
+ // Called when tearing down the isolate
+ virtual ~TimezoneCache() {}
+};
+
+} // namespace base
+} // namespace v8
+
+#endif // V8_BASE_TIMEZONE_CACHE_H_
« no previous file with comments | « src/base/platform/platform-win32.cc ('k') | src/date.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698