blob: fed177f9ae6dab6d3f48199d01189be48b4aea3a [file] [log] [blame]
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
namespace content {
// TimeZoneMonitor watches the system time zone, and notifies renderers
// when it changes. Some renderer code caches the system time zone, so
// this notification is necessary to inform such code that cached
// timezone data may have become invalid. Due to sandboxing, it is not
// possible for renderer processes to monitor for system time zone
// changes themselves, so this must happen in the browser process.
// Sandboxing also may prevent renderer processes from reading the time
// zone when it does change, so platforms may have to deal with this in
// platform-specific ways:
// - Mac uses a sandbox hole defined in content/renderer/
// - Linux-based platforms use ProxyLocaltimeCallToBrowser in
// content/zygote/ and HandleLocaltime in
// content/browser/renderer_host/ to override
// localtime in renderer processes with custom code that calls
// localtime in the browser process via Chrome IPC.
class TimeZoneMonitor {
// Returns a new TimeZoneMonitor object (likely a subclass) specific to the
// platform.
static scoped_ptr<TimeZoneMonitor> Create();
virtual ~TimeZoneMonitor();
// Loop over all renderers and notify them that the system time zone may
// have changed.
void NotifyRenderers();
} // namespace content