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

Side by Side Diff: patches/tzdetect.patch

Issue 2442923002: ICU update to 58 part 2 (Closed)
Patch Set: apply more patches and updates; almost ready to roll Created 4 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « patches/scriptset.patch ('k') | patches/utext.patch » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 diff --git a/source/common/putil.cpp b/source/common/putil.cpp
2 index 5f09288..c87b60e 100644
3 --- a/source/common/putil.cpp
4 +++ b/source/common/putil.cpp
5 @@ -970,6 +970,15 @@ static char* searchForTZFile(const char* path, DefaultTZInf o* tzInfo) {
6 return result;
7 }
8 #endif
9 +
10 +U_CAPI void U_EXPORT2
11 +uprv_tzname_clear_cache()
12 +{
13 +#if defined(CHECK_LOCALTIME_LINK) && !defined(DEBUG_SKIP_LOCALTIME_LINK)
14 + gTimeZoneBufferPtr = NULL;
15 +#endif
16 +}
17 +
18 U_CAPI const char* U_EXPORT2
19 uprv_tzname(int n)
20 {
21 diff --git a/source/common/putilimp.h b/source/common/putilimp.h
22 index 5de801f..55ec0ae 100644
23 --- a/source/common/putilimp.h
24 +++ b/source/common/putilimp.h
25 @@ -479,6 +479,12 @@ U_INTERNAL int32_t U_EXPORT2 uprv_timezone(void);
26 U_INTERNAL const char* U_EXPORT2 uprv_tzname(int n);
27
28 /**
29 + * Reset the global tzname cache.
30 + * @internal
31 + */
32 +U_INTERNAL void uprv_tzname_clear_cache();
33 +
34 +/**
35 * Get UTC (GMT) time measured in milliseconds since 0:00 on 1/1/1970.
36 * This function is affected by 'faketime' and should be the bottleneck for all user-visible ICU time functions.
37 * @return the UTC time measured in milliseconds
38 diff --git a/source/i18n/timezone.cpp b/source/i18n/timezone.cpp
39 index 59c3891..00eca38 100644
40 --- a/source/i18n/timezone.cpp
41 +++ b/source/i18n/timezone.cpp
42 @@ -458,6 +458,8 @@ TimeZone::detectHostTimeZone()
43
44 uprv_tzset(); // Initialize tz... system data
45
46 + uprv_tzname_clear_cache();
47 +
48 // Get the timezone ID from the host. This function should do
49 // any required host-specific remapping; e.g., on Windows this
50 // function maps the Date and Time control panel setting to an
OLDNEW
« no previous file with comments | « patches/scriptset.patch ('k') | patches/utext.patch » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698