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

Unified Diff: content/browser/tab_contents/tab_contents.cc

Issue 6993037: Ensure address bar is reset after a redirect turns into a download. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix test failure on Windows. Created 9 years, 6 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
Index: content/browser/tab_contents/tab_contents.cc
diff --git a/content/browser/tab_contents/tab_contents.cc b/content/browser/tab_contents/tab_contents.cc
index cff43e55ad4e0b8c09178d2585f99411f75fe37c..9511f47c3945afba875f644df3a65102629c807a 100644
--- a/content/browser/tab_contents/tab_contents.cc
+++ b/content/browser/tab_contents/tab_contents.cc
@@ -855,14 +855,15 @@ void TabContents::OnDidFailProvisionalLoadWithError(
return;
}
- // This will discard our pending entry if we cancelled the load (e.g., if we
- // decided to download the file instead of load it). Only discard the
- // pending entry if the URLs match, otherwise the user initiated a navigate
- // before the page loaded so that the discard would discard the wrong entry.
+ // Discard our pending entry if the load canceled (e.g. if we decided to
+ // download the file instead of load it). The URL may not match the pending
+ // entry's URL if a redirect occurred, or if the user started a new
+ // navigation. It's safer to clear the pending entry in both cases than
brettw 2011/06/12 12:44:56 Can you make more clear how this is wrong in the c
Charlie Reis 2011/06/13 17:46:48 Good idea. I've tried to clarify it-- does it loo
+ // possibly leave a stale redirect URL showing. (In the latter case, the
+ // navigation will commit even if there is no pending entry.)
NavigationEntry* pending_entry = controller_.pending_entry();
- if (pending_entry && pending_entry->url() == validated_url) {
+ if (pending_entry)
DidCancelLoading();
- }
render_manager_.RendererAbortedProvisionalLoad(render_view_host());
}

Powered by Google App Engine
This is Rietveld 408576698