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

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

Issue 1214723012: Track whether a created WebContents has a resume pending. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments 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 57bf80bd366110b2f50b79103ba8fe03775e1ae0..135621fa7cac38ad5fb93fda6c3472be3283c9c6 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -360,6 +360,7 @@ WebContentsImpl::WebContentsImpl(BrowserContext* browser_context)
load_state_(net::LOAD_STATE_IDLE, base::string16()),
upload_size_(0),
upload_position_(0),
+ is_resume_pending_(false),
displayed_insecure_content_(false),
has_accessed_initial_document_(false),
theme_color_(SK_ColorTRANSPARENT),
@@ -1817,6 +1818,7 @@ void WebContentsImpl::ShowCreatedWindow(int route_id,
WebContentsImpl* contents = GetCreatedWindow(route_id);
if (contents) {
WebContentsDelegate* delegate = GetDelegate();
+ contents->is_resume_pending_ = true;
if (!delegate || delegate->ShouldResumeRequestsForCreatedWindow())
contents->ResumeLoadingCreatedWebContents();
@@ -2667,8 +2669,11 @@ void WebContentsImpl::ExitFullscreen() {
void WebContentsImpl::ResumeLoadingCreatedWebContents() {
// Resume blocked requests for both the RenderViewHost and RenderFrameHost.
// TODO(brettw): It seems bogus to reach into here and initialize the host.
- GetRenderViewHost()->Init();
- GetMainFrame()->Init();
+ if (is_resume_pending_) {
+ is_resume_pending_ = false;
+ GetRenderViewHost()->Init();
+ GetMainFrame()->Init();
+ }
}
bool WebContentsImpl::FocusLocationBarByDefault() {
« 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