Revision: 19808
Author: [email protected]
Date: Tue Mar 11 15:46:56 2014 UTC
Log: Invalidate OS-specific datetime cache on configuration change
notification
When V8 is informed that the system's date time configuration has changed,
it should also drop its OS-specific caches of time zone information
[email protected]
Review URL: https://codereview.chromium.org/193933002
Patch from James Robinson <[email protected]>.
http://code.google.com/p/v8/source/detail?r=19808
Modified:
/branches/bleeding_edge/src/date.cc
/branches/bleeding_edge/src/platform-posix.cc
/branches/bleeding_edge/src/platform-win32.cc
/branches/bleeding_edge/src/platform.h
=======================================
--- /branches/bleeding_edge/src/date.cc Fri Dec 6 11:45:26 2013 UTC
+++ /branches/bleeding_edge/src/date.cc Tue Mar 11 15:46:56 2014 UTC
@@ -62,6 +62,7 @@
after_ = &dst_[1];
local_offset_ms_ = kInvalidLocalOffsetInMs;
ymd_valid_ = false;
+ OS::TimeZoneChanged();
}
=======================================
--- /branches/bleeding_edge/src/platform-posix.cc Tue Feb 25 13:53:06 2014
UTC
+++ /branches/bleeding_edge/src/platform-posix.cc Tue Mar 11 15:46:56 2014
UTC
@@ -361,6 +361,9 @@
if (NULL == t) return nan_value();
return t->tm_isdst > 0 ? 3600 * msPerSecond : 0;
}
+
+
+void OS::TimeZoneChanged() {}
int OS::GetLastError() {
=======================================
--- /branches/bleeding_edge/src/platform-win32.cc Thu Mar 6 11:55:47 2014
UTC
+++ /branches/bleeding_edge/src/platform-win32.cc Tue Mar 11 15:46:56 2014
UTC
@@ -250,6 +250,8 @@
// Returns a string identifying the current timezone for the
// timestamp taking into account daylight saving.
char* LocalTimezone();
+
+ static void TimeZoneChanged() { tz_initialized_ = false; }
private:
// Constants for time conversion.
@@ -609,6 +611,11 @@
int64_t offset = Win32Time(time).DaylightSavingsOffset();
return static_cast<double>(offset);
}
+
+
+void OS::TimeZoneChanged() {
+ Win32Time::TimeZoneChanged();
+}
int OS::GetLastError() {
=======================================
--- /branches/bleeding_edge/src/platform.h Tue Jan 28 19:11:13 2014 UTC
+++ /branches/bleeding_edge/src/platform.h Tue Mar 11 15:46:56 2014 UTC
@@ -193,6 +193,8 @@
// Returns the daylight savings offset for the given time.
static double DaylightSavingsOffset(double time);
+ static void TimeZoneChanged();
+
// Returns last OS error.
static int GetLastError();
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.