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

Unified Diff: src/i18n.h

Issue 2724373002: [date] Add ICU backend for timezone info behind a flag (Closed)
Patch Set: Convert to UTF8 rather than check-failing Created 3 years, 9 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') | src/i18n.cc » ('J')
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 f89d005b00c844309d925768f231c0bde94ca514..c87ece803de7e71a3657938e465e6e89e82ee9ed 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 {
@@ -128,6 +130,34 @@ class V8BreakIterator {
V8BreakIterator();
};
+// 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') | src/i18n.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698