Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Issue 251613002: Broadcast NotifyTimezoneChange to all RenderProcessHosts when the system time zone changes (Closed)

Created:
6 years, 8 months ago by Mark Mentovai
Modified:
6 years, 7 months ago
CC:
chromium-reviews, darin-cc_chromium.org, jam
Visibility:
Public.

Description

Broadcast NotifyTimezoneChange to all RenderProcessHosts when the system time zone changes. On Mac, this listens for NSSystemTimeZoneDidChangeNotification notifications. The Mac implementation also contains a sandbox hole to allow time zone information (/etc/localtime and /usr/share/zoneinfo) to be read from within sandboxed renderer processes. On Windows, this listens for WM_TIMECHANGE messages. On Linux (but not Chrome OS or Android), this watches for changes to /etc/localtime, /etc/timezone, and /etc/TZ. There isn't a better standard for watching for time zone changes on Linux. The actual mechanism is libc-specific, but this should work with common libc implementations. Time zone watching is suppressed if the TZ environment variable is set. Linux (including Chrome OS and Android) already contains a sandbox workaround (ProxyLocaltimeCallToBrowser) that allows renderer processes to get time zone information from the browser. On Android, this uses a Java bridge to listen for Intent.ACTION_TIMEZONE_CHANGED. This unifies the existing time zone change notification from Chrome OS with the other platform implementations. On Mac, Linux, Chrome OS, and Android renderers should pick up the new time zone name and UTC offset. On Windows, renderers may only be able to pick up the new UTC offset only, and the sandbox may blocks them from picking up the new time zone name, although in my test on Windows Server 2012, they were able to pick up both the UTC offset and the time zone name upon change. This is a continuation of https://codereview.chromium.org/183763041/ (Mac) and https://codereview.chromium.org/193763002/ (Windows). BUG=288697 TEST=http://crbug.com/288697#c12: load the page, change the system time zone, and then click "recheck" to ensure that the renderer picks up the new time zone. Don't reload the page, which is likely to give you a new renderer process, use the "recheck" link on the page. R=bulach@chromium.org, cpu@chromium.org, jeremy@chromium.org, jln@chromium.org, jochen@chromium.org, pastarmovj@chromium.org, rsesek@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=267226

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : rebase (266233) #

Patch Set 6 : #

Patch Set 7 : #

Patch Set 8 : #

Total comments: 5

Patch Set 9 : #

Patch Set 10 : #

Total comments: 2

Patch Set 11 : #

Total comments: 11

Patch Set 12 : #

Total comments: 4

Patch Set 13 : #

Patch Set 14 : rebase (267223) #

Unified diffs Side-by-side diffs Delta from patch set Stats (+571 lines, -33 lines) Patch
M chrome/browser/chromeos/settings/system_settings_provider.cc View 1 2 1 chunk +0 lines, -8 lines 0 comments Download
M content/browser/android/browser_jni_registrar.cc View 1 2 3 4 5 6 4 chunks +7 lines, -4 lines 0 comments Download
M content/browser/browser_main_loop.h View 1 2 3 4 2 chunks +4 lines, -1 line 0 comments Download
M content/browser/browser_main_loop.cc View 1 2 3 4 5 6 7 8 11 chunks +28 lines, -20 lines 0 comments Download
A content/browser/time_zone_monitor.h View 1 2 3 4 5 6 7 8 9 1 chunk +51 lines, -0 lines 0 comments Download
A content/browser/time_zone_monitor.cc View 1 2 3 4 5 6 1 chunk +31 lines, -0 lines 0 comments Download
A content/browser/time_zone_monitor_android.h View 1 2 3 4 5 6 1 chunk +37 lines, -0 lines 0 comments Download
A content/browser/time_zone_monitor_android.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +38 lines, -0 lines 0 comments Download
A content/browser/time_zone_monitor_chromeos.cc View 1 2 3 4 5 6 7 8 1 chunk +37 lines, -0 lines 0 comments Download
A content/browser/time_zone_monitor_linux.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +166 lines, -0 lines 0 comments Download
A content/browser/time_zone_monitor_mac.mm View 1 2 3 4 5 6 7 8 1 chunk +40 lines, -0 lines 0 comments Download
A content/browser/time_zone_monitor_win.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +46 lines, -0 lines 0 comments Download
M content/content_browser.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +8 lines, -0 lines 0 comments Download
M content/content_jni.gypi View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
A content/public/android/java/src/org/chromium/content/browser/TimeZoneMonitor.java View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +68 lines, -0 lines 0 comments Download
M content/renderer/renderer.sb View 1 chunk +9 lines, -0 lines 0 comments Download

Messages

Total messages: 20 (0 generated)
Mark Mentovai
Reviewer selection: - jochen for content and overall non-platform-specific stuff - rsesek for Mac and ...
6 years, 7 months ago (2014-04-28 20:48:40 UTC) #1
Robert Sesek
https://codereview.chromium.org/251613002/diff/220001/content/browser/time_zone_monitor.h File content/browser/time_zone_monitor.h (right): https://codereview.chromium.org/251613002/diff/220001/content/browser/time_zone_monitor.h#newcode33 content/browser/time_zone_monitor.h:33: static TimeZoneMonitor* Create(); I think the preference now is ...
6 years, 7 months ago (2014-04-28 20:53:38 UTC) #2
Mark Mentovai
I made the other two changes. https://codereview.chromium.org/251613002/diff/220001/content/browser/time_zone_monitor.h File content/browser/time_zone_monitor.h (right): https://codereview.chromium.org/251613002/diff/220001/content/browser/time_zone_monitor.h#newcode35 content/browser/time_zone_monitor.h:35: TimeZoneMonitor(); rsesek wrote: ...
6 years, 7 months ago (2014-04-28 21:08:37 UTC) #3
Robert Sesek
time_zone_monitor_mac.mm lgtm https://codereview.chromium.org/251613002/diff/220001/content/browser/time_zone_monitor.h File content/browser/time_zone_monitor.h (right): https://codereview.chromium.org/251613002/diff/220001/content/browser/time_zone_monitor.h#newcode35 content/browser/time_zone_monitor.h:35: TimeZoneMonitor(); On 2014/04/28 21:08:38, Mark Mentovai wrote: ...
6 years, 7 months ago (2014-04-28 21:14:48 UTC) #4
Mark Mentovai
The base class constructor is protected now, but the subclass constructors need to remain public. ...
6 years, 7 months ago (2014-04-28 21:20:48 UTC) #5
Robert Sesek
LGTM
6 years, 7 months ago (2014-04-28 21:28:09 UTC) #6
cpu_(ooo_6.6-7.5)
lgtm nit below. https://codereview.chromium.org/251613002/diff/260001/content/browser/time_zone_monitor_win.cc File content/browser/time_zone_monitor_win.cc (right): https://codereview.chromium.org/251613002/diff/260001/content/browser/time_zone_monitor_win.cc#newcode31 content/browser/time_zone_monitor_win.cc:31: DCHECK_EQ(hwnd, gfx::SingletonHwnd::GetInstance()->hwnd()); If it was me ...
6 years, 7 months ago (2014-04-29 01:15:10 UTC) #7
Mark Mentovai
Thanks for the review! https://codereview.chromium.org/251613002/diff/260001/content/browser/time_zone_monitor_win.cc File content/browser/time_zone_monitor_win.cc (right): https://codereview.chromium.org/251613002/diff/260001/content/browser/time_zone_monitor_win.cc#newcode31 content/browser/time_zone_monitor_win.cc:31: DCHECK_EQ(hwnd, gfx::SingletonHwnd::GetInstance()->hwnd()); cpu wrote: > ...
6 years, 7 months ago (2014-04-29 01:58:45 UTC) #8
jochen (gone - plz use gerrit)
lgtm
6 years, 7 months ago (2014-04-29 07:54:47 UTC) #9
pastarmovj
lgtm
6 years, 7 months ago (2014-04-29 08:09:18 UTC) #10
bulach
lgtm for android, with some small suggestions. thanks for the detailed explanation, and apologies in ...
6 years, 7 months ago (2014-04-29 08:33:43 UTC) #11
jeremy
https://codereview.chromium.org/251613002/diff/270001/content/renderer/renderer.sb File content/renderer/renderer.sb (right): https://codereview.chromium.org/251613002/diff/270001/content/renderer/renderer.sb#newcode33 content/renderer/renderer.sb:33: ; http://crbug.com/288697 I assume there is no way to ...
6 years, 7 months ago (2014-04-29 11:50:51 UTC) #12
Mark Mentovai
https://codereview.chromium.org/251613002/diff/270001/content/renderer/renderer.sb File content/renderer/renderer.sb (right): https://codereview.chromium.org/251613002/diff/270001/content/renderer/renderer.sb#newcode33 content/renderer/renderer.sb:33: ; http://crbug.com/288697 jeremy wrote: > I assume there is ...
6 years, 7 months ago (2014-04-29 13:00:39 UTC) #13
jeremy
LGTM Thanks for the explanation!
6 years, 7 months ago (2014-04-29 13:02:36 UTC) #14
Mark Mentovai
https://codereview.chromium.org/251613002/diff/270001/content/browser/time_zone_monitor.h File content/browser/time_zone_monitor.h (right): https://codereview.chromium.org/251613002/diff/270001/content/browser/time_zone_monitor.h#newcode20 content/browser/time_zone_monitor.h:20: // Sandboxing also may prevent renderer processes from reading ...
6 years, 7 months ago (2014-04-29 16:01:05 UTC) #15
jln (very slow on Chromium)
lgtm I really wish we could get things plumbed between the render and the browser ...
6 years, 7 months ago (2014-04-29 22:57:47 UTC) #16
Mark Mentovai
jln wrote: > I really wish we could get things plumbed between the render and ...
6 years, 7 months ago (2014-04-30 03:52:23 UTC) #17
Mark Mentovai
https://codereview.chromium.org/251613002/diff/290001/content/browser/time_zone_monitor_linux.cc File content/browser/time_zone_monitor_linux.cc (right): https://codereview.chromium.org/251613002/diff/290001/content/browser/time_zone_monitor_linux.cc#newcode53 content/browser/time_zone_monitor_linux.cc:53: owner_(owner) { jln wrote: > Do you want to ...
6 years, 7 months ago (2014-04-30 03:55:41 UTC) #18
jln (DO NOT USE THIS)
https://codereview.chromium.org/251613002/diff/290001/content/browser/time_zone_monitor_linux.cc File content/browser/time_zone_monitor_linux.cc (right): https://codereview.chromium.org/251613002/diff/290001/content/browser/time_zone_monitor_linux.cc#newcode53 content/browser/time_zone_monitor_linux.cc:53: owner_(owner) { On 2014/04/30 03:55:41, Mark Mentovai wrote: > ...
6 years, 7 months ago (2014-04-30 05:46:35 UTC) #19
Mark Mentovai
6 years, 7 months ago (2014-04-30 15:49:29 UTC) #20
Message was sent while issue was closed.
Committed patchset #14 manually as r267226 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698