diff options
author | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-10 14:05:10 +0000 |
---|---|---|
committer | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-10 14:05:10 +0000 |
commit | b063c24c68efc138679a4becb3d521125fd27cd2 (patch) | |
tree | 1a5e9ca5acda2614ca6a0e47a68fbddbd8bcf7a4 /content | |
parent | 74e3ee71ccfc07628bc35de7c467e6e8b3cd6f4f (diff) | |
download | chromium_src-b063c24c68efc138679a4becb3d521125fd27cd2.zip chromium_src-b063c24c68efc138679a4becb3d521125fd27cd2.tar.gz chromium_src-b063c24c68efc138679a4becb3d521125fd27cd2.tar.bz2 |
Revert 255928 "Only notify V8 once per timezone change"
> Only notify V8 once per timezone change
>
> The timezone is a global property. No need to notify V8 for every single
> frame.
>
> As a side-effect, we don't have a race with context creation.
>
> BUG=348856
> R=marja@chromium.org, kalman@chromium.org
>
> Review URL: https://codereview.chromium.org/190763008
TBR=jochen@chromium.org
Review URL: https://codereview.chromium.org/190953007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@255939 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r-- | content/renderer/render_frame_impl.cc | 2 | ||||
-rw-r--r-- | content/renderer/render_view_impl.cc | 10 | ||||
-rw-r--r-- | content/renderer/render_view_impl.h | 2 |
3 files changed, 10 insertions, 4 deletions
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc index 5412929..3a30087 100644 --- a/content/renderer/render_frame_impl.cc +++ b/content/renderer/render_frame_impl.cc @@ -592,7 +592,7 @@ void RenderFrameImpl::OnNavigate(const FrameMsg_Navigate_Params& params) { // We refresh timezone when a view is swapped in since timezone // can get out of sync when the system timezone is updated while // the view is swapped out. - RenderViewImpl::NotifyTimezoneChange(); + RenderViewImpl::NotifyTimezoneChange(render_view_->webview()->mainFrame()); render_view_->SetSwappedOut(false); is_swapped_out_ = false; diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc index d12b0ee..296fce9 100644 --- a/content/renderer/render_view_impl.cc +++ b/content/renderer/render_view_impl.cc @@ -379,8 +379,13 @@ Referrer RenderViewImpl::GetReferrerFromRequest( } // static -void RenderViewImpl::NotifyTimezoneChange() { +void RenderViewImpl::NotifyTimezoneChange(blink::WebFrame* frame) { + v8::HandleScope handle_scope(v8::Isolate::GetCurrent()); + v8::Context::Scope context_scope(frame->mainWorldScriptContext()); v8::Date::DateTimeConfigurationChangeNotification(v8::Isolate::GetCurrent()); + blink::WebFrame* child = frame->firstChild(); + for (; child; child = child->nextSibling()) + NotifyTimezoneChange(child); } // static @@ -3773,7 +3778,8 @@ void RenderViewImpl::OnUpdateWebPreferences(const WebPreferences& prefs) { } void RenderViewImpl::OnUpdateTimezone() { - NotifyTimezoneChange(); + if (webview()) + NotifyTimezoneChange(webview()->mainFrame()); } void RenderViewImpl::OnEnumerateDirectoryResponse( diff --git a/content/renderer/render_view_impl.h b/content/renderer/render_view_impl.h index 540c91f..edae802 100644 --- a/content/renderer/render_view_impl.h +++ b/content/renderer/render_view_impl.h @@ -798,7 +798,7 @@ class CONTENT_EXPORT RenderViewImpl blink::WebFrame* frame, const blink::WebURLRequest& request); - static void NotifyTimezoneChange(); + static void NotifyTimezoneChange(blink::WebFrame* frame); static WindowOpenDisposition NavigationPolicyToDisposition( blink::WebNavigationPolicy policy); |