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

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: Rebase Created 5 years, 9 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
« no previous file with comments | « content/public/renderer/render_frame_observer.h ('k') | content/renderer/render_frame_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 79658a7d1ce869c56cb10490de315c2251502025..05999a29e09c6cd630e3e50bc804e0936daa6bcc 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -2126,10 +2126,19 @@ void RenderFrameImpl::willClose(blink::WebFrame* frame) {
void RenderFrameImpl::didChangeName(blink::WebLocalFrame* frame,
const blink::WebString& name) {
DCHECK(!frame_ || frame_ == frame);
- if (!render_view_->renderer_preferences_.report_frame_name_changes)
- return;
- FOR_EACH_OBSERVER(RenderFrameObserver, observers_, DidChangeName(name));
+ // 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 frame proxies, and when
+ // |report_frame_name_changes| is set (used by WebView). This can be
nasko 2015/03/09 21:43:40 nit: "WebView" here has a very ambiguous meaning.
alexmos 2015/03/09 21:53:00 Done. Also updated comment slightly to mention an
+ // optimized further by only sending the update if there are any remote
+ // frames in the frame tree.
+ bool is_site_per_process = base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kSitePerProcess);
+ if (is_site_per_process ||
+ render_view_->renderer_preferences_.report_frame_name_changes)
nasko 2015/03/09 21:43:40 nit: This is a two line if statement, {} need to b
alexmos 2015/03/09 21:53:00 Done.
+ Send(new FrameHostMsg_DidChangeName(routing_id_, base::UTF16ToUTF8(name)));
}
void RenderFrameImpl::didChangeSandboxFlags(blink::WebFrame* child_frame,
« no previous file with comments | « content/public/renderer/render_frame_observer.h ('k') | content/renderer/render_frame_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698