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

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

Issue 2239273002: Don't use SSLStatus from FrameHostMsg_DidCommitProvisionalLoad and instead cache it on the browser … (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge and comments Created 4 years, 4 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 /* 5 /*
6 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 6 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
7 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 7 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
9 * (http://www.torchmobile.com/) 9 * (http://www.torchmobile.com/)
10 * 10 *
(...skipping 1082 matching lines...) Expand 10 before | Expand all | Expand 10 after
1093 NavigationHandleImpl* handle = rfh->navigation_handle(); 1093 NavigationHandleImpl* handle = rfh->navigation_handle();
1094 DCHECK(handle); 1094 DCHECK(handle);
1095 1095
1096 if (!new_entry && 1096 if (!new_entry &&
1097 PendingEntryMatchesHandle(handle) && pending_entry_index_ == -1 && 1097 PendingEntryMatchesHandle(handle) && pending_entry_index_ == -1 &&
1098 (!pending_entry_->site_instance() || 1098 (!pending_entry_->site_instance() ||
1099 pending_entry_->site_instance() == rfh->GetSiteInstance())) { 1099 pending_entry_->site_instance() == rfh->GetSiteInstance())) {
1100 new_entry = pending_entry_->Clone(); 1100 new_entry = pending_entry_->Clone();
1101 1101
1102 update_virtual_url = new_entry->update_virtual_url_with_url(); 1102 update_virtual_url = new_entry->update_virtual_url_with_url();
1103
1104 SSLStatus ssl_status;
1105 if (params.url != new_entry->GetURL()) {
1106 if (rfh->GetSSLStatusForPendingNavigate(params.url, &ssl_status)) {
1107 new_entry->GetSSL() = ssl_status;
1108 } else {
1109 new_entry->GetSSL() = SSLStatus();
1110 }
1111 }
1103 } 1112 }
1104 1113
1105 // For non-in-page commits with no matching pending entry, create a new entry. 1114 // For non-in-page commits with no matching pending entry, create a new entry.
1106 if (!new_entry) { 1115 if (!new_entry) {
1107 new_entry = base::WrapUnique(new NavigationEntryImpl); 1116 new_entry = base::WrapUnique(new NavigationEntryImpl);
1108 1117
1109 // Find out whether the new entry needs to update its virtual URL on URL 1118 // Find out whether the new entry needs to update its virtual URL on URL
1110 // change and set up the entry accordingly. This is needed to correctly 1119 // change and set up the entry accordingly. This is needed to correctly
1111 // update the virtual URL when replaceState is called after a pushState. 1120 // update the virtual URL when replaceState is called after a pushState.
1112 GURL url = params.url; 1121 GURL url = params.url;
1113 bool needs_update = false; 1122 bool needs_update = false;
1114 BrowserURLHandlerImpl::GetInstance()->RewriteURLIfNecessary( 1123 BrowserURLHandlerImpl::GetInstance()->RewriteURLIfNecessary(
1115 &url, browser_context_, &needs_update); 1124 &url, browser_context_, &needs_update);
1116 new_entry->set_update_virtual_url_with_url(needs_update); 1125 new_entry->set_update_virtual_url_with_url(needs_update);
1117 1126
1118 // When navigating to a new page, give the browser URL handler a chance to 1127 // When navigating to a new page, give the browser URL handler a chance to
1119 // update the virtual URL based on the new URL. For example, this is needed 1128 // update the virtual URL based on the new URL. For example, this is needed
1120 // to show chrome://bookmarks/#1 when the bookmarks webui extension changes 1129 // to show chrome://bookmarks/#1 when the bookmarks webui extension changes
1121 // the URL. 1130 // the URL.
1122 update_virtual_url = needs_update; 1131 update_virtual_url = needs_update;
1132
1133 SSLStatus ssl_status;
1134 if (rfh->GetSSLStatusForPendingNavigate(params.url, &ssl_status))
1135 new_entry->GetSSL() = ssl_status;
nasko 2016/08/15 22:18:22 I think if we go that route, we need to also put t
jam 2016/08/22 22:01:30 Can you explain some more? How would SamePage or E
1123 } 1136 }
1124 1137
1125 // Don't use the page type from the pending entry. Some interstitial page 1138 // Don't use the page type from the pending entry. Some interstitial page
1126 // may have set the type to interstitial. Once we commit, however, the page 1139 // may have set the type to interstitial. Once we commit, however, the page
1127 // type must always be normal or error. 1140 // type must always be normal or error.
1128 new_entry->set_page_type(params.url_is_unreachable ? PAGE_TYPE_ERROR 1141 new_entry->set_page_type(params.url_is_unreachable ? PAGE_TYPE_ERROR
1129 : PAGE_TYPE_NORMAL); 1142 : PAGE_TYPE_NORMAL);
1130 new_entry->SetURL(params.url); 1143 new_entry->SetURL(params.url);
1131 if (update_virtual_url) 1144 if (update_virtual_url)
1132 UpdateVirtualURLToURL(new_entry.get(), params.url); 1145 UpdateVirtualURLToURL(new_entry.get(), params.url);
(...skipping 968 matching lines...) Expand 10 before | Expand all | Expand 10 after
2101 } 2114 }
2102 } 2115 }
2103 } 2116 }
2104 2117
2105 void NavigationControllerImpl::SetGetTimestampCallbackForTest( 2118 void NavigationControllerImpl::SetGetTimestampCallbackForTest(
2106 const base::Callback<base::Time()>& get_timestamp_callback) { 2119 const base::Callback<base::Time()>& get_timestamp_callback) {
2107 get_timestamp_callback_ = get_timestamp_callback; 2120 get_timestamp_callback_ = get_timestamp_callback;
2108 } 2121 }
2109 2122
2110 } // namespace content 2123 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698