Commit 0b7d4778 authored by ulan@chromium.org's avatar ulan@chromium.org

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

R=ulan@chromium.org

Review URL: https://codereview.chromium.org/193933002

Patch from James Robinson <jamesr@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19808 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 7a8ccc0b
......@@ -62,6 +62,7 @@ void DateCache::ResetDateCache() {
after_ = &dst_[1];
local_offset_ms_ = kInvalidLocalOffsetInMs;
ymd_valid_ = false;
OS::TimeZoneChanged();
}
......
......@@ -363,6 +363,9 @@ double OS::DaylightSavingsOffset(double time) {
}
void OS::TimeZoneChanged() {}
int OS::GetLastError() {
return errno;
}
......
......@@ -251,6 +251,8 @@ class Win32Time {
// timestamp taking into account daylight saving.
char* LocalTimezone();
static void TimeZoneChanged() { tz_initialized_ = false; }
private:
// Constants for time conversion.
static const int64_t kTimeEpoc = 116444736000000000LL;
......@@ -611,6 +613,11 @@ double OS::DaylightSavingsOffset(double time) {
}
void OS::TimeZoneChanged() {
Win32Time::TimeZoneChanged();
}
int OS::GetLastError() {
return ::GetLastError();
}
......
......@@ -193,6 +193,8 @@ class OS {
// Returns the daylight savings offset for the given time.
static double DaylightSavingsOffset(double time);
static void TimeZoneChanged();
// Returns last OS error.
static int GetLastError();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment