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

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: add url check for transfer case Created 4 years, 3 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 905 matching lines...) Expand 10 before | Expand all | Expand 10 after
916 916
917 // Remember the bindings the renderer process has at this point, so that 917 // Remember the bindings the renderer process has at this point, so that
918 // we do not grant this entry additional bindings if we come back to it. 918 // we do not grant this entry additional bindings if we come back to it.
919 active_entry->SetBindings(rfh->GetEnabledBindings()); 919 active_entry->SetBindings(rfh->GetEnabledBindings());
920 920
921 // Now prep the rest of the details for the notification and broadcast. 921 // Now prep the rest of the details for the notification and broadcast.
922 details->entry = active_entry; 922 details->entry = active_entry;
923 details->is_main_frame = !rfh->GetParent(); 923 details->is_main_frame = !rfh->GetParent();
924 details->http_status_code = params.http_status_code; 924 details->http_status_code = params.http_status_code;
925 925
926 // Deserialize the security info and kill the renderer if
927 // deserialization fails. The navigation will continue with default
928 // SSLStatus values.
929 if (!DeserializeSecurityInfo(params.security_info, &details->ssl_status)) {
930 bad_message::ReceivedBadMessage(
931 rfh->GetProcess(),
932 bad_message::WC_RENDERER_DID_NAVIGATE_BAD_SECURITY_INFO);
933 }
934
935 NotifyNavigationEntryCommitted(details); 926 NotifyNavigationEntryCommitted(details);
936 927
937 // Update the nav_entry_id for each RenderFrameHost in the tree, so that each 928 // Update the nav_entry_id for each RenderFrameHost in the tree, so that each
938 // one knows the latest NavigationEntry it is showing (whether it has 929 // one knows the latest NavigationEntry it is showing (whether it has
939 // committed anything in this navigation or not). This allows things like 930 // committed anything in this navigation or not). This allows things like
940 // state and title updates from RenderFrames to apply to the latest relevant 931 // state and title updates from RenderFrames to apply to the latest relevant
941 // NavigationEntry. 932 // NavigationEntry.
942 int nav_entry_id = active_entry->GetUniqueID(); 933 int nav_entry_id = active_entry->GetUniqueID();
943 for (FrameTreeNode* node : delegate_->GetFrameTree()->Nodes()) 934 for (FrameTreeNode* node : delegate_->GetFrameTree()->Nodes())
944 node->current_frame_host()->set_nav_entry_id(nav_entry_id); 935 node->current_frame_host()->set_nav_entry_id(nav_entry_id);
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
1100 NavigationHandleImpl* handle = rfh->navigation_handle(); 1091 NavigationHandleImpl* handle = rfh->navigation_handle();
1101 DCHECK(handle); 1092 DCHECK(handle);
1102 1093
1103 if (!new_entry && 1094 if (!new_entry &&
1104 PendingEntryMatchesHandle(handle) && pending_entry_index_ == -1 && 1095 PendingEntryMatchesHandle(handle) && pending_entry_index_ == -1 &&
1105 (!pending_entry_->site_instance() || 1096 (!pending_entry_->site_instance() ||
1106 pending_entry_->site_instance() == rfh->GetSiteInstance())) { 1097 pending_entry_->site_instance() == rfh->GetSiteInstance())) {
1107 new_entry = pending_entry_->Clone(); 1098 new_entry = pending_entry_->Clone();
1108 1099
1109 update_virtual_url = new_entry->update_virtual_url_with_url(); 1100 update_virtual_url = new_entry->update_virtual_url_with_url();
1101 new_entry->GetSSL() = handle->ssl_status();
clamy 2016/08/26 00:06:57 nit: wouldn't using a setter for the ssl status be
jam 2016/08/26 03:36:43 yes most definitely (it's against the google style
1110 } 1102 }
1111 1103
1112 // For non-in-page commits with no matching pending entry, create a new entry. 1104 // For non-in-page commits with no matching pending entry, create a new entry.
1113 if (!new_entry) { 1105 if (!new_entry) {
1114 new_entry = base::WrapUnique(new NavigationEntryImpl); 1106 new_entry = base::WrapUnique(new NavigationEntryImpl);
1115 1107
1116 // Find out whether the new entry needs to update its virtual URL on URL 1108 // Find out whether the new entry needs to update its virtual URL on URL
1117 // change and set up the entry accordingly. This is needed to correctly 1109 // change and set up the entry accordingly. This is needed to correctly
1118 // update the virtual URL when replaceState is called after a pushState. 1110 // update the virtual URL when replaceState is called after a pushState.
1119 GURL url = params.url; 1111 GURL url = params.url;
1120 bool needs_update = false; 1112 bool needs_update = false;
1121 BrowserURLHandlerImpl::GetInstance()->RewriteURLIfNecessary( 1113 BrowserURLHandlerImpl::GetInstance()->RewriteURLIfNecessary(
1122 &url, browser_context_, &needs_update); 1114 &url, browser_context_, &needs_update);
1123 new_entry->set_update_virtual_url_with_url(needs_update); 1115 new_entry->set_update_virtual_url_with_url(needs_update);
1124 1116
1125 // When navigating to a new page, give the browser URL handler a chance to 1117 // When navigating to a new page, give the browser URL handler a chance to
1126 // update the virtual URL based on the new URL. For example, this is needed 1118 // update the virtual URL based on the new URL. For example, this is needed
1127 // to show chrome://bookmarks/#1 when the bookmarks webui extension changes 1119 // to show chrome://bookmarks/#1 when the bookmarks webui extension changes
1128 // the URL. 1120 // the URL.
1129 update_virtual_url = needs_update; 1121 update_virtual_url = needs_update;
1122 new_entry->GetSSL() = handle->ssl_status();
1130 } 1123 }
1131 1124
1132 // Don't use the page type from the pending entry. Some interstitial page 1125 // Don't use the page type from the pending entry. Some interstitial page
1133 // may have set the type to interstitial. Once we commit, however, the page 1126 // may have set the type to interstitial. Once we commit, however, the page
1134 // type must always be normal or error. 1127 // type must always be normal or error.
1135 new_entry->set_page_type(params.url_is_unreachable ? PAGE_TYPE_ERROR 1128 new_entry->set_page_type(params.url_is_unreachable ? PAGE_TYPE_ERROR
1136 : PAGE_TYPE_NORMAL); 1129 : PAGE_TYPE_NORMAL);
1137 new_entry->SetURL(params.url); 1130 new_entry->SetURL(params.url);
1138 if (update_virtual_url) 1131 if (update_virtual_url)
1139 UpdateVirtualURLToURL(new_entry.get(), params.url); 1132 UpdateVirtualURLToURL(new_entry.get(), params.url);
(...skipping 968 matching lines...) Expand 10 before | Expand all | Expand 10 after
2108 } 2101 }
2109 } 2102 }
2110 } 2103 }
2111 2104
2112 void NavigationControllerImpl::SetGetTimestampCallbackForTest( 2105 void NavigationControllerImpl::SetGetTimestampCallbackForTest(
2113 const base::Callback<base::Time()>& get_timestamp_callback) { 2106 const base::Callback<base::Time()>& get_timestamp_callback) {
2114 get_timestamp_callback_ = get_timestamp_callback; 2107 get_timestamp_callback_ = get_timestamp_callback;
2115 } 2108 }
2116 2109
2117 } // namespace content 2110 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698