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

Side by Side Diff: content/browser/frame_host/navigation_controller_impl.cc

Issue 1114403002: Fix mis-classification of navigations when there is a pending page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/frame_host/navigation_controller_impl.h" 5 #include "content/browser/frame_host/navigation_controller_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 1015 matching lines...) Expand 10 before | Expand all | Expand 10 after
1026 DCHECK(GetLastCommittedEntry()); 1026 DCHECK(GetLastCommittedEntry());
1027 return NAVIGATION_TYPE_AUTO_SUBFRAME; 1027 return NAVIGATION_TYPE_AUTO_SUBFRAME;
1028 } 1028 }
1029 1029
1030 // Anything below here we know is a main frame navigation. 1030 // Anything below here we know is a main frame navigation.
1031 if (pending_entry_ && 1031 if (pending_entry_ &&
1032 !pending_entry_->is_renderer_initiated() && 1032 !pending_entry_->is_renderer_initiated() &&
1033 existing_entry != pending_entry_ && 1033 existing_entry != pending_entry_ &&
1034 pending_entry_->GetPageID() == -1 && 1034 pending_entry_->GetPageID() == -1 &&
1035 existing_entry == GetLastCommittedEntry()) { 1035 existing_entry == GetLastCommittedEntry()) {
1036 const std::vector<GURL>& existing_redirect_chain = 1036 if (params.url == pending_entry_->GetURL() ||
Charlie Reis 2015/05/01 19:40:48 I think we should be comparing params.url to exist
Avi (use Gerrit) 2015/05/01 20:30:57 Yeah, that sounds right. Let me update the patch a
1037 existing_entry->GetRedirectChain(); 1037 (params.redirects.size() &&
1038 1038 params.redirects[0] == pending_entry_->GetURL())) {
1039 if (existing_entry->GetURL() == pending_entry_->GetURL() ||
1040 (existing_redirect_chain.size() &&
1041 existing_redirect_chain[0] == pending_entry_->GetURL())) {
1042 // In this case, we have a pending entry for a URL but WebCore didn't do a 1039 // In this case, we have a pending entry for a URL but WebCore didn't do a
1043 // new navigation. This happens when you press enter in the URL bar to 1040 // new navigation. This happens when you press enter in the URL bar to
1044 // reload. We will create a pending entry, but WebKit will convert it to 1041 // reload. We will create a pending entry, but WebKit will convert it to
1045 // a reload since it's the same page and not create a new entry for it 1042 // a reload since it's the same page and not create a new entry for it
1046 // (the user doesn't want to have a new back/forward entry when they do 1043 // (the user doesn't want to have a new back/forward entry when they do
1047 // this). If this matches the last committed entry, we want to just ignore 1044 // this). If this matches the last committed entry, we want to just ignore
1048 // the pending entry and go back to where we were (the "existing entry"). 1045 // the pending entry and go back to where we were (the "existing entry").
1049 return NAVIGATION_TYPE_SAME_PAGE; 1046 return NAVIGATION_TYPE_SAME_PAGE;
1050 } 1047 }
1051 } 1048 }
(...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after
1869 } 1866 }
1870 } 1867 }
1871 } 1868 }
1872 1869
1873 void NavigationControllerImpl::SetGetTimestampCallbackForTest( 1870 void NavigationControllerImpl::SetGetTimestampCallbackForTest(
1874 const base::Callback<base::Time()>& get_timestamp_callback) { 1871 const base::Callback<base::Time()>& get_timestamp_callback) {
1875 get_timestamp_callback_ = get_timestamp_callback; 1872 get_timestamp_callback_ = get_timestamp_callback;
1876 } 1873 }
1877 1874
1878 } // namespace content 1875 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698