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

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: Update comments. 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
« no previous file with comments | « content/browser/tab_contents/navigation_controller_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 84167d19ba997f92ba57c1b095f1f6a8994e5197..db5db15ab9f24780ab3d58492e24352c12383e28 100644
--- a/content/browser/tab_contents/tab_contents.cc
+++ b/content/browser/tab_contents/tab_contents.cc
@@ -853,14 +853,17 @@ 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). We do not verify that the URL
+ // being canceled matches the pending entry's URL because they will not
+ // match if a redirect occurred (in which case we do not want to leave a
+ // stale redirect URL showing). This means that we also cancel the pending
+ // entry if the user started a new navigation. As a result, the navigation
+ // controller may not remember that a load is in progress, but the
+ // navigation will still 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());
}
« no previous file with comments | « content/browser/tab_contents/navigation_controller_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698