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

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: 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..654afdcbda90e830e34dbfb0461ee6b54fb16625 100644
--- a/content/browser/frame_host/render_frame_host_manager.cc
+++ b/content/browser/frame_host/render_frame_host_manager.cc
@@ -2001,16 +2001,19 @@ 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();
+ if (proxy_routing_id == MSG_ROUTING_NONE) {
alexmos 2015/10/15 23:11:41 Just curious, would the proxy check be equivalent
Charlie Reis 2015/10/16 06:06:51 Good question. I added a DCHECK that they're equi
+ 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