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

Unified Diff: src/date.cc

Issue 2724373002: [date] Add ICU backend for timezone info behind a flag (Closed)
Patch Set: Don't leak the icu::TimeZone* 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/date.h ('k') | src/flag-definitions.h » ('j') | src/flag-definitions.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/date.cc
diff --git a/src/date.cc b/src/date.cc
index d0ff192b6ad16b05f6bf9e5b652aef17f173f1da..d7eb2d3dccdc8b526794b9979320c11268cb1790 100644
--- a/src/date.cc
+++ b/src/date.cc
@@ -7,6 +7,10 @@
#include "src/objects.h"
#include "src/objects-inl.h"
+#ifdef V8_I18N_SUPPORT
+#include "src/i18n.h"
+#endif
+
namespace v8 {
namespace internal {
@@ -21,6 +25,15 @@ static const int kYearsOffset = 400000;
static const char kDaysInMonths[] =
{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
+DateCache::DateCache()
+ : stamp_(0),
+ tz_cache_(
+#ifdef V8_I18N_SUPPORT
+ FLAG_icu_timezone_data ? new ICUOSTimezoneCache() :
ulan 2017/03/03 13:20:27 nit: let's keep the conditionals properly nested.
Dan Ehrenberg 2017/03/03 15:06:54 Done.
+#endif
+ base::OS::CreateTimezoneCache()) {
+ ResetDateCache();
+}
void DateCache::ResetDateCache() {
static const int kMaxStamp = Smi::kMaxValue;
« no previous file with comments | « src/date.h ('k') | src/flag-definitions.h » ('j') | src/flag-definitions.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698