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..207bcc0edc112d60dc4a22ac91e05fcf1e571c27 100644 |
--- a/content/browser/frame_host/render_frame_host_manager.cc |
+++ b/content/browser/frame_host/render_frame_host_manager.cc |
@@ -460,9 +460,14 @@ 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_); |
+ // TODO(carlosk): this code might not handle interwoven navigation |
clamy
2015/03/31 11:40:42
Could you add a comment explaining that even if th
carlosk
2015/03/31 14:19:39
Done.
|
+ // requests properly. |
carlosk
2015/03/27 17:11:29
Due to the possibility of having multiple ongoing
clamy
2015/03/31 11:40:42
Yes we should maybe think about pausing a navigati
carlosk
2015/03/31 14:19:39
Let's talk offline about this as I don't understan
|
+ 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 +1642,14 @@ 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_) { |
clamy
2015/03/31 11:40:42
At which point is should_reuse_web_ui_ reset?
carlosk
2015/03/31 14:19:39
You are right to bring this up: this is the place.
|
+ CHECK(web_ui_); |
clamy
2015/03/31 11:40:42
I wonder if this should be a DCHECK seeing that al
carlosk
2015/03/31 14:19:39
Done.
|
+ } else { |
+ web_ui_.reset(); |
+ } |
carlosk
2015/03/27 17:11:30
This code does basically the same as the previous
|
DCHECK(!speculative_web_ui_); |
} |