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

Side by Side Diff: content/browser/time_zone_monitor.h

Issue 251613002: Broadcast NotifyTimezoneChange to all RenderProcessHosts when the system time zone changes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_BROWSER_TIME_ZONE_MONITOR_H_
6 #define CONTENT_BROWSER_TIME_ZONE_MONITOR_H_
7
8 #include "base/basictypes.h"
9
10 namespace content {
11
12 // TimeZoneMonitor watches the system time zone, and notifies renderers
13 // when it changes. Some renderer code caches the system time zone, so
14 // this notification is necessary to inform such code that cached
15 // timezone data may have become invalid. Due to sandboxing, it is not
16 // possible for renderer processes to monitor for system time zone
17 // changes themselves, so this must happen in the browser process.
18 //
19 // Sandboxing also may prevent renderer processes from reading the time
20 // zone when it does change, so platforms may have to deal with this in
21 // platform-specific ways:
22 // - Mac uses a sandbox hole defined in content/renderer/renderer.sb.
23 // - Linux-based platforms use ProxyLocaltimeCallToBrowser in
24 // content/zygote/zygote_main_linux.cc and HandleLocaltime in
25 // content/browser/renderer_host/sandbox_ipc_linux.cc to override
26 // localtime in renderer processes with custom code that calls
27 // localtime in the browser process via Chrome IPC.
28
29 class TimeZoneMonitor {
30 public:
31 // Returns a new TimeZoneMonitor object (likely a subclass) specific to the
32 // platform.
33 static TimeZoneMonitor* Create();
Robert Sesek 2014/04/28 20:53:39 I think the preference now is to return a scoped_p
34
35 TimeZoneMonitor();
Robert Sesek 2014/04/28 20:53:39 Should the ctor be public if you have a Create met
Mark Mentovai 2014/04/28 21:08:38 rsesek wrote:
Robert Sesek 2014/04/28 21:14:48 Right, but is it meaningful to actually construct
36 virtual ~TimeZoneMonitor();
37
38 protected:
39 // Loop over all renderers and notify them that the system time zone may
40 // have changed.
41 void NotifyRenderers();
42
43 private:
44 DISALLOW_COPY_AND_ASSIGN(TimeZoneMonitor);
45 };
46
47 } // namespace content
48
49 #endif // CONTENT_BROWSER_TIME_ZONE_MONITOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698