Line data Source code
1 : // Copyright 2017 the V8 project authors. All rights reserved.
2 : // Use of this source code is governed by a BSD-style license that can be
3 : // found in the LICENSE file.
4 :
5 : #ifndef V8_BASE_TIMEZONE_CACHE_H_
6 : #define V8_BASE_TIMEZONE_CACHE_H_
7 :
8 : namespace v8 {
9 : namespace base {
10 :
11 60789 : class TimezoneCache {
12 : public:
13 : // Short name of the local timezone (e.g., EST)
14 : virtual const char* LocalTimezone(double time_ms) = 0;
15 :
16 : // ES #sec-daylight-saving-time-adjustment
17 : // Daylight Saving Time Adjustment
18 : virtual double DaylightSavingsOffset(double time_ms) = 0;
19 :
20 : // ES #sec-local-time-zone-adjustment
21 : // Local Time Zone Adjustment
22 : //
23 : // TODO(littledan): Make more accurate with another parameter along the
24 : // lines of this spec change:
25 : // https://github.com/tc39/ecma262/pull/778
26 : virtual double LocalTimeOffset() = 0;
27 :
28 : // Called when the local timezone changes
29 : virtual void Clear() = 0;
30 :
31 : // Called when tearing down the isolate
32 59292 : virtual ~TimezoneCache() {}
33 : };
34 :
35 : } // namespace base
36 : } // namespace v8
37 :
38 : #endif // V8_BASE_TIMEZONE_CACHE_H_
|