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

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

Issue 746993003: Only cancel navigation on user gesture (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Try2 : Only cancel when it is caused by user action Created 6 years 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
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 06ab825123e4b1fd294dd577e6aee18ab9ff94fe..e9f9c151b85b5620cabfc02ecb4341a6f91f25d6 100644
--- a/content/browser/frame_host/render_frame_host_manager.cc
+++ b/content/browser/frame_host/render_frame_host_manager.cc
@@ -418,7 +418,8 @@ void RenderFrameHostManager::ClearNavigationTransitionData() {
}
void RenderFrameHostManager::DidNavigateFrame(
- RenderFrameHostImpl* render_frame_host) {
+ RenderFrameHostImpl* render_frame_host,
+ bool was_caused_by_user_gesture) {
if (!cross_navigation_pending_) {
DCHECK(!pending_render_frame_host_);
@@ -435,14 +436,15 @@ void RenderFrameHostManager::DidNavigateFrame(
// The pending cross-site navigation completed, so show the renderer.
CommitPending();
cross_navigation_pending_ = false;
- } else if (render_frame_host == render_frame_host_) {
+ } else if (render_frame_host == render_frame_host_ &&
+ was_caused_by_user_gesture) {
// A navigation in the original page has taken place. Cancel the pending
// one.
Charlie Reis 2014/12/03 21:32:19 Let's update this comment: "Cancel the pending one
CancelPending();
cross_navigation_pending_ = false;
} else {
// No one else should be sending us DidNavigate in this state.
- DCHECK(false);
+ DCHECK(!was_caused_by_user_gesture);
Charlie Reis 2014/12/03 21:32:19 This is confusing, since the DCHECK and comment ar
}
}

Powered by Google App Engine
This is Rietveld 408576698