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

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

Issue 1036243003: PlzNavigate: Improvements to RFHM commit logic. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updates from CR comments. Created 5 years, 9 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 29771b2ab65da73c748a60643a0634acce2ec5a2..0871632ba34d4e5c12b77abef334bbb868d35c8c 100644
--- a/content/browser/frame_host/render_frame_host_manager.cc
+++ b/content/browser/frame_host/render_frame_host_manager.cc
@@ -460,9 +460,18 @@ void RenderFrameHostManager::CommitPendingIfNecessary(
if (render_frame_host == speculative_render_frame_host_.get()) {
CommitPending();
} else if (render_frame_host == render_frame_host_.get()) {
- // TODO(carlosk): this code doesn't properly handle in-page navigation or
- // interwoven navigation requests.
- DCHECK(!speculative_render_frame_host_);
+ DCHECK(!should_reuse_web_ui_ || web_ui_);
+ // When the current RenderFrameHost is committing there's still the
+ // possibility that there is a speculative WebUI to be made active.
+ // But if there's also a speculative RenderFrameHost set it means the
+ // WebUI was not meant for the current one.
clamy 2015/03/31 15:54:10 The last sentence is not true. The speculative web
carlosk 2015/04/01 14:54:07 If both the speculative RFH *and* WebUI are set th
+ // TODO(carlosk): this code might not handle interwoven navigation
+ // requests properly.
+ if (speculative_web_ui_ && !speculative_render_frame_host_) {
+ CommitPending();
+ } else {
+ CleanUpNavigation();
+ }
} else {
// No one else should be sending us a DidNavigate in this state.
DCHECK(false);
@@ -1637,8 +1646,15 @@ void RenderFrameHostManager::CommitPending() {
}
} else {
// PlzNavigate
- if (!should_reuse_web_ui_)
+ if (speculative_web_ui_) {
+ DCHECK(!should_reuse_web_ui_);
web_ui_.reset(speculative_web_ui_.release());
+ } else if (should_reuse_web_ui_) {
+ DCHECK(web_ui_);
+ should_reuse_web_ui_ = false;
+ } else {
+ web_ui_.reset();
+ }
DCHECK(!speculative_web_ui_);
clamy 2015/03/31 15:54:10 Could you also add a DCHECK(!should_reuse_web_ui_)
carlosk 2015/04/01 14:54:07 Done.
}
« 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