bug 1249738 - make sSystemTimezoneChangeObservers a function static r=dhylands
authorTrevor Saunders <tbsaunde@tbsaunde.org>
Fri, 19 Feb 2016 12:00:10 -0500
changeset 285730 a871b30278aaa722bb5b8990c21850d597610b22
parent 285729 53d07f5c025bc332fd2f7e189a34065162e22013
child 285731 be199e2f9e395d870a48d6e5bdc20bb12372e6a5
push id72500
push usertsaunders@mozilla.com
push dateFri, 26 Feb 2016 16:06:18 +0000
treeherdermozilla-inbound@a871b30278aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdhylands
bugs1249738
milestone47.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 1249738 - make sSystemTimezoneChangeObservers a function static r=dhylands
hal/Hal.cpp
--- a/hal/Hal.cpp
+++ b/hal/Hal.cpp
@@ -496,37 +496,42 @@ protected:
     PROXY_IF_SANDBOXED(EnableSystemTimezoneChangeNotifications());
   }
 
   void DisableNotifications() {
     PROXY_IF_SANDBOXED(DisableSystemTimezoneChangeNotifications());
   }
 };
 
-static SystemTimezoneChangeObserversManager sSystemTimezoneChangeObservers;
+static SystemTimezoneChangeObserversManager&
+SystemTimezoneChangeObservers()
+{
+  static SystemTimezoneChangeObserversManager sSystemTimezoneChangeObservers;
+  return sSystemTimezoneChangeObservers;
+}
 
 void
 RegisterSystemTimezoneChangeObserver(SystemTimezoneChangeObserver* aObserver)
 {
   AssertMainThread();
-  sSystemTimezoneChangeObservers.AddObserver(aObserver);
+  SystemTimezoneChangeObservers().AddObserver(aObserver);
 }
 
 void
 UnregisterSystemTimezoneChangeObserver(SystemTimezoneChangeObserver* aObserver)
 {
   AssertMainThread();
-  sSystemTimezoneChangeObservers.RemoveObserver(aObserver);
+  SystemTimezoneChangeObservers().RemoveObserver(aObserver);
 }
 
 void
 NotifySystemTimezoneChange(const SystemTimezoneChangeInformation& aSystemTimezoneChangeInfo)
 {
   nsJSUtils::ResetTimeZone();
-  sSystemTimezoneChangeObservers.BroadcastInformation(aSystemTimezoneChangeInfo);
+  SystemTimezoneChangeObservers().BroadcastInformation(aSystemTimezoneChangeInfo);
 }
 
 void
 AdjustSystemClock(int64_t aDeltaMilliseconds)
 {
   AssertMainThread();
   PROXY_IF_SANDBOXED(AdjustSystemClock(aDeltaMilliseconds));
 }