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

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

Issue 1145353002: Ensure WebUI bindings are properly set (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 | no next file » | 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 4588e078817987e52eacf623bf3c61fc82ef3238..73a82785072d1a0d3ecc6d67adc62b847ae163dc 100644
--- a/content/browser/frame_host/render_frame_host_manager.cc
+++ b/content/browser/frame_host/render_frame_host_manager.cc
@@ -1486,20 +1486,6 @@ scoped_ptr<RenderFrameHostImpl> RenderFrameHostManager::CreateRenderFrame(
proxy_hosts_.erase(instance->GetId());
delete proxy;
-
- // When a new render view is created by the renderer, the new WebContents
- // gets a RenderViewHost in the SiteInstance of its opener WebContents.
- // If not used in the first navigation, this RVH is swapped out and is not
- // granted bindings, so we may need to grant them when swapping it in.
- if (web_ui && !new_render_frame_host->GetProcess()->IsIsolatedGuest()) {
- int required_bindings = web_ui->GetBindings();
- RenderViewHost* render_view_host =
- new_render_frame_host->render_view_host();
- if ((render_view_host->GetEnabledBindings() & required_bindings) !=
- required_bindings) {
- render_view_host->AllowBindings(required_bindings);
- }
- }
}
} else {
// Create a new RenderFrameHost if we don't find an existing one.
@@ -1548,6 +1534,21 @@ scoped_ptr<RenderFrameHostImpl> RenderFrameHostManager::CreateRenderFrame(
}
}
+ // When a new RenderView is created by the renderer process, the new
+ // WebContents gets a RenderViewHost in the SiteInstance of its opener
+ // WebContents. If not used in the first navigation, this RVH is swapped out
+ // and is not granted bindings, so we may need to grant them when swapping it
+ // in.
+ if (web_ui && !new_render_frame_host->GetProcess()->IsIsolatedGuest()) {
+ int required_bindings = web_ui->GetBindings();
+ RenderViewHost* render_view_host =
+ new_render_frame_host->render_view_host();
+ if ((render_view_host->GetEnabledBindings() & required_bindings) !=
+ required_bindings) {
+ render_view_host->AllowBindings(required_bindings);
+ }
+ }
+
// Returns the new RFH if it isn't swapped out.
if (success && !swapped_out) {
DCHECK(new_render_frame_host->GetSiteInstance() == instance);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698