From 1831acf00bbfad84ffe7492dee9fe87550bfae32 Mon Sep 17 00:00:00 2001 From: "jshin@chromium.org" Date: Mon, 5 Oct 2009 16:38:41 +0000 Subject: Add a dummy call to icu::TimeZone.createDefault() before the sandbox kicks in. This is necessary to get the datetime formatting work correctly in a renderer process (e.g. FTP directory list that is now done in a renderer process.) BUG=23361,23082 TEST=... Review URL: http://codereview.chromium.org/243060 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27999 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/zygote_main_linux.cc | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'chrome/browser') 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 #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 zone(icu::TimeZone::createDefault()); + FilePath module_path; if (PathService::Get(base::DIR_MODULE, &module_path)) media::InitializeMediaLibrary(module_path); -- cgit v1.1