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

Unified Diff: patches/tzdetect2.patch

Issue 1058353002: Fix the tz detection code. (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/icu.git@master
Patch Set: add upstream bug ref Created 5 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 | « README.chromium ('k') | source/common/putil.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: patches/tzdetect2.patch
diff --git a/patches/tzdetect2.patch b/patches/tzdetect2.patch
new file mode 100644
index 0000000000000000000000000000000000000000..6b9189fc50660f54e9542823df9cba6038c96693
--- /dev/null
+++ b/patches/tzdetect2.patch
@@ -0,0 +1,50 @@
+diff --git a/source/common/putil.cpp b/source/common/putil.cpp
+index 599dad9..0f5090c 100644
+--- a/source/common/putil.cpp
++++ b/source/common/putil.cpp
+@@ -970,6 +970,15 @@ static char* searchForTZFile(const char* path, DefaultTZInfo* tzInfo) {
+ return result;
+ }
+ #endif
++
++U_CAPI void U_EXPORT2
++uprv_tzname_clear_cache()
++{
++#if defined(CHECK_LOCALTIME_LINK) && !defined(DEBUG_SKIP_LOCALTIME_LINK)
++ gTimeZoneBufferPtr = NULL;
++#endif
++}
++
+ U_CAPI const char* U_EXPORT2
+ uprv_tzname(int n)
+ {
+diff --git a/source/common/putilimp.h b/source/common/putilimp.h
+index d2c1c66..e3da340 100644
+--- a/source/common/putilimp.h
++++ b/source/common/putilimp.h
+@@ -483,6 +483,12 @@ U_INTERNAL int32_t U_EXPORT2 uprv_timezone(void);
+ U_INTERNAL const char* U_EXPORT2 uprv_tzname(int n);
+
+ /**
++ * Reset the global tzname cache.
++ * @internal
++ */
++U_INTERNAL void uprv_tzname_clear_cache();
++
++/**
+ * Get UTC (GMT) time measured in milliseconds since 0:00 on 1/1/1970.
+ * This function is affected by 'faketime' and should be the bottleneck for all user-visible ICU time functions.
+ * @return the UTC time measured in milliseconds
+diff --git a/source/i18n/timezone.cpp b/source/i18n/timezone.cpp
+index 6b3f8d2..a80fdda 100644
+--- a/source/i18n/timezone.cpp
++++ b/source/i18n/timezone.cpp
+@@ -453,6 +453,8 @@ TimeZone::detectHostTimeZone()
+
+ uprv_tzset(); // Initialize tz... system data
+
++ uprv_tzname_clear_cache();
++
+ // Get the timezone ID from the host. This function should do
+ // any required host-specific remapping; e.g., on Windows this
+ // function maps the Date and Time control panel setting to an
« no previous file with comments | « README.chromium ('k') | source/common/putil.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698