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

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 1233453003: Allow asynchronous tab creation when opener_suppressed is true. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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/browser/web_contents/web_contents_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/web_contents/web_contents_impl.cc
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index cb891ec95c3cb8e8685faf0e5193d3ba5178e1f1..a1c3c53364c912c798931a00a6b34a7130cff366 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -1756,7 +1756,15 @@ void WebContentsImpl::CreateNewWindow(
ui::PAGE_TRANSITION_LINK,
true /* is_renderer_initiated */);
open_params.user_gesture = params.user_gesture;
- new_contents->OpenURL(open_params);
+
+ if (delegate_ && !is_guest &&
+ !delegate_->ShouldResumeRequestsForCreatedWindow()) {
+ // We are in asynchronous add new contents path, delay opening url
+ new_contents->delayed_open_url_params_.reset(
+ new OpenURLParams(open_params));
+ } else {
+ new_contents->OpenURL(open_params);
+ }
}
}
}
@@ -2669,6 +2677,12 @@ void WebContentsImpl::ExitFullscreen() {
}
void WebContentsImpl::ResumeLoadingCreatedWebContents() {
+ if (delayed_open_url_params_.get()) {
+ OpenURL(*delayed_open_url_params_.get());
+ delayed_open_url_params_.reset(nullptr);
+ return;
nasko 2015/07/10 07:42:20 Why is there a return here? Skipping the initializ
Maria 2015/07/10 16:26:25 This function is not called in the initialization
+ }
+
// Resume blocked requests for both the RenderViewHost and RenderFrameHost.
// TODO(brettw): It seems bogus to reach into here and initialize the host.
GetRenderViewHost()->Init();
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698