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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 974723002: OOPIF: Replicate dynamic window.name updates. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 1e3667ff83565f31db7f86e44e961680febabb36..a6791c22bec4b216f30bf87c542346e6dc1290cf 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -2120,9 +2120,24 @@ void RenderFrameImpl::willClose(blink::WebFrame* frame) {
void RenderFrameImpl::didChangeName(blink::WebLocalFrame* frame,
const blink::WebString& name) {
DCHECK(!frame_ || frame_ == frame);
+
+ // TODO(alexmos): According to https://crbug.com/169110, sending window.name
+ // updates may have performance implications for benchmarks like SunSpider.
+ // For now, send these updates only for --site-per-process, which needs to
+ // replicate frame names to all of this frame's proxies. This can also be
+ // optimized by only sending the update if there are any remote frames in the
+ // frame tree.
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kSitePerProcess)) {
+ Send(new FrameHostMsg_DidChangeName(routing_id_, base::UTF16ToUTF8(name)));
+ }
+
if (!render_view_->renderer_preferences_.report_frame_name_changes)
return;
+ // TODO(alexmos): ExtensionsRenderFrameObserver sends another message to the
+ // browser process to keep the <webview> tag's name attribute updated. It
+ // should be refactored to use the FrameHostMsg_DidChangeName above.
FOR_EACH_OBSERVER(RenderFrameObserver, observers_, DidChangeName(name));
alexmos 2015/03/04 01:04:21 I'm still finalizing what this should be, and it'd
nasko 2015/03/05 18:09:28 We don't have such a way and this type of direct c
alexmos 2015/03/09 18:47:58 Done. Refactored WebViewGuest to use WebContentsO
}

Powered by Google App Engine
This is Rietveld 408576698