commit b3a3ef3688f3c196210d2004961fe2f8c5dba83b
Author: Arthur Edelstein <arthuredelstein(a)gmail.com>
Date: Mon Nov 14 10:22:09 2016 -0800
Bug 16622: Pref to spoof time zone as UTC
---
toolkit/xre/nsAppRunner.cpp | 9 +++++++++
toolkit/xre/nsAppRunner.h | 3 +++
2 files changed, 12 insertions(+)
diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp
index f0cdd41..81f949a 100644
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -4680,6 +4680,8 @@ XREMain::XRE_mainRun()
OverrideDefaultLocaleIfNeeded();
+ UseUTCTimeZoneIfNeeded();
+
#ifdef MOZ_CRASHREPORTER
nsCString userAgentLocale;
// Try a localized string first. This pref is always a localized string in
@@ -5385,3 +5387,10 @@ OverrideDefaultLocaleIfNeeded() {
setlocale(LC_ALL, "C.UTF-8") || setlocale(LC_ALL, "C");
}
}
+
+void
+UseUTCTimeZoneIfNeeded() {
+ if (mozilla::Preferences::GetBool("privacy.use_utc_timezone", false)) {
+ SaveToEnv("TZ=UTC");
+ }
+}
diff --git a/toolkit/xre/nsAppRunner.h b/toolkit/xre/nsAppRunner.h
index c7048e0..cab42a4 100644
--- a/toolkit/xre/nsAppRunner.h
+++ b/toolkit/xre/nsAppRunner.h
@@ -96,6 +96,9 @@ WriteConsoleLog();
void
OverrideDefaultLocaleIfNeeded();
+void
+UseUTCTimeZoneIfNeeded();
+
#ifdef XP_WIN
void
UseParentConsole();