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

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: Fixed Nasko's nits 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..ebc42b1dc4aa30341b2ec87d98ee813fb198728e 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -2126,10 +2126,21 @@ 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>). If needed, this
+ // can be optimized further by only sending the update if there are any
+ // remote frames in the frame tree, or delaying and batching up IPCs if
+ // updates are happening too frequently.
+ bool is_site_per_process = base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kSitePerProcess);
+ if (is_site_per_process ||
+ render_view_->renderer_preferences_.report_frame_name_changes) {
+ 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