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.
|
} |