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

Unified Diff: content/renderer/render_thread_impl.cc

Issue 697203006: Update the ICU's default timezone in render (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add logs Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/render_thread_impl.cc
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc
index 3d713e06ac3cd17331275ad4d832264e3a09c043..3a87450e835546cc2121e5cc648d92e58df48645 100644
--- a/content/renderer/render_thread_impl.cc
+++ b/content/renderer/render_thread_impl.cc
@@ -137,6 +137,7 @@
#include "third_party/WebKit/public/web/WebScriptController.h"
#include "third_party/WebKit/public/web/WebSecurityPolicy.h"
#include "third_party/WebKit/public/web/WebView.h"
+#include "third_party/icu/source/i18n/unicode/timezone.h"
#include "third_party/skia/include/core/SkGraphics.h"
#include "ui/base/layout.h"
#include "ui/base/ui_base_switches.h"
@@ -1695,9 +1696,15 @@ void RenderThreadImpl::OnTempCrashWithData(const GURL& data) {
CHECK(false);
}
-void RenderThreadImpl::OnUpdateTimezone() {
+void RenderThreadImpl::OnUpdateTimezone(const std::string& zone_id) {
if (!blink_platform_impl_)
return;
+ if (!zone_id.empty()) {
+ icu::TimeZone *defaultZone = icu::TimeZone::createTimeZone(
+ icu::UnicodeString::fromUTF8(zone_id));
+ icu::TimeZone::adoptDefault(defaultZone);
jungshik at Google 2015/04/10 00:23:44 adoptDefault() is not thread-safe. If this is call
jochen (gone - plz use gerrit) 2015/04/10 12:17:24 can we make it thread safe?
jungshik at Google 2015/04/24 22:40:53 It turned out that I was mistaken about this part.
+ VLOG(0) << "ICU dflt timezone is set to " << zone_id;
+ }
NotifyTimezoneChange();
}
« content/browser/time_zone_monitor.cc ('K') | « content/renderer/render_thread_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698