Index: extensions/browser/guest_view/web_view/web_view_guest.cc |
diff --git a/extensions/browser/guest_view/web_view/web_view_guest.cc b/extensions/browser/guest_view/web_view/web_view_guest.cc |
index 9ed24fff867795a48af4dcc90fc3a834cd0bffb1..7a0c6db532dfeaa5283d89eff220d35827d04e6d 100644 |
--- a/extensions/browser/guest_view/web_view/web_view_guest.cc |
+++ b/extensions/browser/guest_view/web_view/web_view_guest.cc |
@@ -322,12 +322,13 @@ void WebViewGuest::DidInitialize(const base::DictionaryValue& create_params) { |
owner_web_contents()->GetRenderProcessHost()->GetID(), |
view_instance_id()); |
- // We must install the mapping from guests to WebViews prior to resuming |
- // suspended resource loads so that the WebRequest API will catch resource |
- // requests. |
- PushWebViewStateToIOThread(); |
+ // NOTE: Calling this prior to attachment breaks OOPIF <webview>. |
+ //// We must install the mapping from guests to WebViews prior to resuming |
+ //// suspended resource loads so that the WebRequest API will catch resource |
+ //// requests. |
+ //PushWebViewStateToIOThread(); |
- ApplyAttributes(create_params); |
+ //ApplyAttributes(create_params); |
} |
void WebViewGuest::AttachWebViewHelpers(WebContents* contents) { |
@@ -800,7 +801,7 @@ void WebViewGuest::FrameNameChanged(RenderFrameHost* render_frame_host, |
if (name_ == name) |
return; |
- ReportFrameNameChange(name); |
+ //ReportFrameNameChange(name); |
} |
void WebViewGuest::ReportFrameNameChange(const std::string& name) { |
@@ -914,7 +915,7 @@ void WebViewGuest::WillAttachToEmbedder() { |
// We must install the mapping from guests to WebViews prior to resuming |
// suspended resource loads so that the WebRequest API will catch resource |
// requests. |
- PushWebViewStateToIOThread(); |
+ //PushWebViewStateToIOThread(); |
} |
content::JavaScriptDialogManager* WebViewGuest::GetJavaScriptDialogManager( |
@@ -987,8 +988,8 @@ void WebViewGuest::ApplyAttributes(const base::DictionaryValue& params) { |
if (name_.empty()) |
SetName(name); |
} |
- if (attached()) |
- ReportFrameNameChange(name_); |
+ //if (attached()) |
+ // ReportFrameNameChange(name_); |
std::string user_agent_override; |
params.GetString(webview::kParameterUserAgentOverride, &user_agent_override); |
@@ -1167,6 +1168,22 @@ content::WebContents* WebViewGuest::OpenURLFromTab( |
// state that assumes an embedder exists, such as RenderWidgetHostViewGuest. |
// Navigation also resumes resource loading which we don't want to allow |
// until attachment. |
+ // site-per-process |
+ printf("source: [%p], web_contents(): [%p]\n", source, web_contents()); |
+ printf("web_contents(): [%p]\n", web_contents()); |
+ //CHECK(0); |
+ content::NavigationController::LoadURLParams load_url_params( |
+ params.url); |
+ load_url_params.referrer = params.referrer; |
+ load_url_params.transition_type = params.transition; |
+ load_url_params.extra_headers = std::string(); |
+ //load_url_params.frame_tree_node_id = params.frame_tree_node_id; |
+ load_url_params.transferred_global_request_id = |
+ params.transferred_global_request_id; |
+ source->GetController().LoadURLWithParams(load_url_params); |
+ return source; |
+ |
+ // Note: IGNORED. |
if (!attached()) { |
WebViewGuest* opener = GetOpener(); |
auto it = opener->pending_new_windows_.find(this); |