summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/zygote_main_linux.cc9
-rw-r--r--chrome/renderer/renderer_main_platform_delegate_win.cc14
2 files changed, 22 insertions, 1 deletions
diff --git a/chrome/browser/zygote_main_linux.cc b/chrome/browser/zygote_main_linux.cc
index fd365ab..eb0ef42 100644
--- a/chrome/browser/zygote_main_linux.cc
+++ b/chrome/browser/zygote_main_linux.cc
@@ -18,6 +18,7 @@
#include "base/path_service.h"
#include "base/pickle.h"
#include "base/rand_util.h"
+#include "base/scoped_ptr.h"
#include "base/sys_info.h"
#include "base/unix_domain_socket_posix.h"
@@ -37,6 +38,8 @@
#include <selinux/context.h>
#endif
+#include "unicode/timezone.h"
+
// http://code.google.com/p/chromium/wiki/LinuxZygote
static const int kMagicSandboxIPCDescriptor = 5;
@@ -377,6 +380,12 @@ static void PreSandboxInit() {
const char* locale = setlocale(LC_ALL, "");
LOG_IF(WARNING, locale == NULL) << "setlocale failed.";
+ // ICU DateFormat class (used in base/time_format.cc) needs to get the
+ // Olson timezone ID by accessing the zoneinfo files on disk. After
+ // TimeZone::createDefault is called once here, the timezone ID is
+ // cached and there's no more need to access the file system.
+ scoped_ptr<icu::TimeZone> zone(icu::TimeZone::createDefault());
+
FilePath module_path;
if (PathService::Get(base::DIR_MODULE, &module_path))
media::InitializeMediaLibrary(module_path);
diff --git a/chrome/renderer/renderer_main_platform_delegate_win.cc b/chrome/renderer/renderer_main_platform_delegate_win.cc
index 8d725e7..12f8242 100644
--- a/chrome/renderer/renderer_main_platform_delegate_win.cc
+++ b/chrome/renderer/renderer_main_platform_delegate_win.cc
@@ -6,10 +6,12 @@
#include "base/command_line.h"
#include "base/gfx/native_theme.h"
+#include "base/scoped_ptr.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/test/injection_test_dll.h"
#include "sandbox/src/sandbox.h"
+#include "unicode/timezone.h"
namespace {
@@ -33,7 +35,7 @@ void EnableThemeSupportForRenderer(bool no_sandbox) {
}
HWND window = ::CreateWindowExW(0, L"Static", L"", WS_POPUP | WS_DISABLED,
- CW_USEDEFAULT, 0, 0, 0, HWND_MESSAGE, NULL,
+ CW_USEDEFAULT, 0, 0, 0, HWND_MESSAGE, NULL,
::GetModuleHandleA(NULL), NULL);
if (!window) {
DLOG(WARNING) << "failed to enable theme support";
@@ -75,6 +77,16 @@ void RendererMainPlatformDelegate::PlatformInitialize() {
const CommandLine& command_line = parameters_.command_line_;
bool no_sandbox = command_line.HasSwitch(switches::kNoSandbox);
EnableThemeSupportForRenderer(no_sandbox);
+
+ if (!no_sandbox) {
+ // ICU DateFormat class (used in base/time_format.cc) needs to get the
+ // Olson timezone ID by accessing the registry keys under
+ // HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones.
+ // After TimeZone::createDefault is called once here, the timezone ID is
+ // cached and there's no more need to access the registry. If the sandbox
+ // is disabled, we don't have to make this dummy call.
+ scoped_ptr<icu::TimeZone> zone(icu::TimeZone::createDefault());
+ }
}
void RendererMainPlatformDelegate::PlatformUninitialize() {