Reviewers: ulan,

Description:
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]

Please review this at https://codereview.chromium.org/193933002/

SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/

Affected files (+13, -0 lines):
  M     src/date.cc
  M     src/platform-posix.cc
  M     src/platform-win32.cc
  M     src/platform.h


Index: src/date.cc
===================================================================
--- src/date.cc (revision 19774)
+++ src/date.cc (working copy)
@@ -62,6 +62,7 @@
   after_ = &dst_[1];
   local_offset_ms_ = kInvalidLocalOffsetInMs;
   ymd_valid_ = false;
+  OS::TimeZoneChanged();
 }


Index: src/platform-posix.cc
===================================================================
--- src/platform-posix.cc       (revision 19774)
+++ src/platform-posix.cc       (working copy)
@@ -363,6 +363,9 @@
 }


+void OS::TimeZoneChanged() {}
+
+
 int OS::GetLastError() {
   return errno;
 }
Index: src/platform-win32.cc
===================================================================
--- src/platform-win32.cc       (revision 19774)
+++ src/platform-win32.cc       (working copy)
@@ -251,6 +251,8 @@
   // 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 @@
 }


+void OS::TimeZoneChanged() {
+  Win32Time::TimeZoneChanged();
+}
+
+
 int OS::GetLastError() {
   return ::GetLastError();
 }
Index: src/platform.h
===================================================================
--- src/platform.h      (revision 19774)
+++ src/platform.h      (working copy)
@@ -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.

Reply via email to