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

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: Comment change. 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..5efea93bb82e82f63a796e2205d7249d2a879de6 100644
--- a/content/browser/frame_host/render_frame_host_manager.cc
+++ b/content/browser/frame_host/render_frame_host_manager.cc
@@ -460,9 +460,21 @@ 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_);
Charlie Reis 2015/04/02 03:18:36 DCHECK_IMPLIES(should_reuse_web_ui_, web_ui_); (T
carlosk 2015/04/07 14:42:31 Done.
+ // 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.
+ // TODO(carlosk): this code might not handle interwoven navigation
+ // requests properly. For example, if two navigations to the current
+ // RenderFrameHost are requested closely to each other, one requiring a
+ // new WebUI and the other requiring none, it might happen that a WebUI is
Charlie Reis 2015/04/02 03:18:36 Can there actually be two navigations in the same
carlosk 2015/04/07 14:42:31 I looked through the code and had the impression f
+ // set when it shouldn't or the other way around.
Charlie Reis 2015/04/02 03:18:36 If this is a real issue, what's the plan for fixin
carlosk 2015/04/07 14:42:31 My previous comment covers this.
+ if (speculative_web_ui_ && !speculative_render_frame_host_) {
+ CommitPending();
Charlie Reis 2015/04/02 03:18:36 I'm noticing that this ends up echoing a lot of th
carlosk 2015/04/07 14:42:31 Done. As we plan to eliminate |cross_navigation_pe
+ } else {
+ CleanUpNavigation();
+ }
} else {
// No one else should be sending us a DidNavigate in this state.
DCHECK(false);
@@ -1637,9 +1649,17 @@ void RenderFrameHostManager::CommitPending() {
}
} else {
// PlzNavigate
- if (!should_reuse_web_ui_)
+ if (speculative_web_ui_) {
Charlie Reis 2015/04/02 03:18:36 Again, these new cases look a lot like lines 1642-
carlosk 2015/04/07 14:42:31 Done. No problems just the need for some extra Plz
+ 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_);
+ DCHECK(!should_reuse_web_ui_);
}
// It's possible for the pending_render_frame_host_ to be nullptr when we
« 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