Chromium Code Reviews| 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()); |
| } |