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

Unified Diff: content/browser/frame_host/render_frame_host_manager.cc

Issue 1403343002: Don't grant WebUI bindings during non-WebUI subframe navigations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Check if is_active agrees Created 5 years, 2 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 | « no previous file | content/browser/frame_host/render_frame_host_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/render_frame_host_manager.cc
diff --git a/content/browser/frame_host/render_frame_host_manager.cc b/content/browser/frame_host/render_frame_host_manager.cc
index 1899fbee890a2ea4184ec1b8e50a16579b2c0171..39a4c3fb734e31edbcc8366a338015256fe1a288 100644
--- a/content/browser/frame_host/render_frame_host_manager.cc
+++ b/content/browser/frame_host/render_frame_host_manager.cc
@@ -2001,16 +2001,21 @@ bool RenderFrameHostManager::InitRenderView(
if (render_view_host->IsRenderViewLive())
return true;
- // If the ongoing navigation is to a WebUI and the RenderView is not in a
- // guest process, tell the RenderViewHost about any bindings it will need
- // enabled.
+ // If |render_view_host| is not for a proxy and the navigation is to a WebUI,
+ // and if the RenderView is not in a guest process, tell |render_view_host|
+ // about any bindings it will need enabled.
+ // TODO(carlosk): Move WebUI to RenderFrameHost in https://crbug.com/508850.
WebUIImpl* dest_web_ui = nullptr;
- if (base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableBrowserSideNavigation)) {
- dest_web_ui =
- should_reuse_web_ui_ ? web_ui_.get() : speculative_web_ui_.get();
- } else {
- dest_web_ui = pending_web_ui();
+ DCHECK_EQ(render_view_host->is_active(),
+ proxy_routing_id == MSG_ROUTING_NONE);
+ if (proxy_routing_id == MSG_ROUTING_NONE) {
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableBrowserSideNavigation)) {
+ dest_web_ui =
+ should_reuse_web_ui_ ? web_ui_.get() : speculative_web_ui_.get();
+ } else {
+ dest_web_ui = pending_web_ui();
+ }
}
if (dest_web_ui && !render_view_host->GetProcess()->IsForGuestsOnly()) {
render_view_host->AllowBindings(dest_web_ui->GetBindings());
« no previous file with comments | « no previous file | content/browser/frame_host/render_frame_host_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698