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

Unified Diff: src/i18n.h

Issue 2724373002: [date] Add ICU backend for timezone info behind a flag (Closed)
Patch Set: or {} Created 3 years, 8 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/flag-definitions.h ('k') | src/i18n.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/i18n.h
diff --git a/src/i18n.h b/src/i18n.h
index f1c160f6049607849ff4f432f7d949492f7e5e14..5b5aca4d5f1d3a9ba372676150db9ba0871c2778 100644
--- a/src/i18n.h
+++ b/src/i18n.h
@@ -6,6 +6,7 @@
#ifndef V8_I18N_H_
#define V8_I18N_H_
+#include "src/base/timezone-cache.h"
#include "src/objects.h"
#include "unicode/uversion.h"
@@ -14,6 +15,7 @@ class BreakIterator;
class Collator;
class DecimalFormat;
class SimpleDateFormat;
+class TimeZone;
}
namespace v8 {
@@ -138,6 +140,34 @@ MUST_USE_RESULT Object* ConvertToUpper(Handle<String> s, Isolate* isolate);
MUST_USE_RESULT Object* ConvertCase(Handle<String> s, bool is_upper,
Isolate* isolate);
+// ICUTimezoneCache calls out to ICU for TimezoneCache
+// functionality in a straightforward way.
+class ICUTimezoneCache : public base::TimezoneCache {
+ public:
+ ICUTimezoneCache();
+
+ ~ICUTimezoneCache() override;
+
+ const char* LocalTimezone(double time_ms) override;
+
+ double DaylightSavingsOffset(double time_ms) override;
+
+ double LocalTimeOffset() override;
+
+ void Clear() override;
+
+ private:
+ icu::TimeZone* GetTimeZone();
+
+ bool GetOffsets(double time_ms, int32_t* raw_offset, int32_t* dst_offset);
+
+ icu::TimeZone* timezone_;
+
+ static const int32_t kMaxTimezoneChars = 100;
+ char timezone_name_[kMaxTimezoneChars];
+ char dst_timezone_name_[kMaxTimezoneChars];
+};
+
} // namespace internal
} // namespace v8
« no previous file with comments | « src/flag-definitions.h ('k') | src/i18n.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698