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

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

Issue 2719573002: Fix SSL certificate being wrong in the intended_as_new_entry case of NAVIGATION_TYPE_EXISTING_PAGE. (Closed)
Patch Set: Created 3 years, 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1091 matching lines...) Expand 10 before | Expand all | Expand 10 after
1102 // entry instead of looking at the pending entry, because the pending entry 1102 // entry instead of looking at the pending entry, because the pending entry
1103 // does not have any subframe history items. 1103 // does not have any subframe history items.
1104 if (is_in_page && GetLastCommittedEntry()) { 1104 if (is_in_page && GetLastCommittedEntry()) {
1105 FrameNavigationEntry* frame_entry = new FrameNavigationEntry( 1105 FrameNavigationEntry* frame_entry = new FrameNavigationEntry(
1106 params.frame_unique_name, params.item_sequence_number, 1106 params.frame_unique_name, params.item_sequence_number,
1107 params.document_sequence_number, rfh->GetSiteInstance(), nullptr, 1107 params.document_sequence_number, rfh->GetSiteInstance(), nullptr,
1108 params.url, params.referrer, params.method, params.post_id); 1108 params.url, params.referrer, params.method, params.post_id);
1109 new_entry = GetLastCommittedEntry()->CloneAndReplace( 1109 new_entry = GetLastCommittedEntry()->CloneAndReplace(
1110 frame_entry, true, rfh->frame_tree_node(), 1110 frame_entry, true, rfh->frame_tree_node(),
1111 delegate_->GetFrameTree()->root()); 1111 delegate_->GetFrameTree()->root());
1112 if (new_entry->GetURL().GetOrigin() != params.url.GetOrigin()) {
1113 // TODO(jam): we had one report of this with a URL that was redirecting to
1114 // only tildes. Until we understand that better, don't copy the cert in
1115 // this case.
1116 new_entry->GetSSL() = SSLStatus();
1117 }
1112 1118
1113 // We expect |frame_entry| to be owned by |new_entry|. This should never 1119 // We expect |frame_entry| to be owned by |new_entry|. This should never
1114 // fail, because it's the main frame. 1120 // fail, because it's the main frame.
1115 CHECK(frame_entry->HasOneRef()); 1121 CHECK(frame_entry->HasOneRef());
1116 1122
1117 update_virtual_url = new_entry->update_virtual_url_with_url(); 1123 update_virtual_url = new_entry->update_virtual_url_with_url();
1118 } 1124 }
1119 1125
1120 // Only make a copy of the pending entry if it is appropriate for the new page 1126 // Only make a copy of the pending entry if it is appropriate for the new page
1121 // that was just loaded. Verify this by checking if the entry corresponds 1127 // that was just loaded. Verify this by checking if the entry corresponds
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
1213 1219
1214 // TODO(creis): Classify location.replace as NEW_PAGE instead of EXISTING_PAGE 1220 // TODO(creis): Classify location.replace as NEW_PAGE instead of EXISTING_PAGE
1215 // in https://crbug.com/596707. 1221 // in https://crbug.com/596707.
1216 1222
1217 NavigationEntryImpl* entry; 1223 NavigationEntryImpl* entry;
1218 if (params.intended_as_new_entry) { 1224 if (params.intended_as_new_entry) {
1219 // This was intended as a new entry but the pending entry was lost in the 1225 // This was intended as a new entry but the pending entry was lost in the
1220 // meanwhile and no new page was created. We are stuck at the last committed 1226 // meanwhile and no new page was created. We are stuck at the last committed
1221 // entry. 1227 // entry.
1222 entry = GetLastCommittedEntry(); 1228 entry = GetLastCommittedEntry();
1229 CHECK(!is_in_page);
1230 entry->GetSSL() = handle->ssl_status();
1223 } else if (params.nav_entry_id) { 1231 } else if (params.nav_entry_id) {
1224 // This is a browser-initiated navigation (back/forward/reload). 1232 // This is a browser-initiated navigation (back/forward/reload).
1225 entry = GetEntryWithUniqueID(params.nav_entry_id); 1233 entry = GetEntryWithUniqueID(params.nav_entry_id);
1226 1234
1227 if (is_in_page) { 1235 if (is_in_page) {
1228 // There's no SSLStatus in the NavigationHandle for in-page navigations, 1236 // There's no SSLStatus in the NavigationHandle for in-page navigations,
1229 // so normally we leave |entry|'s SSLStatus as is. However if this was a 1237 // so normally we leave |entry|'s SSLStatus as is. However if this was a
1230 // restored in-page navigation entry, then it won't have an SSLStatus. So 1238 // restored in-page navigation entry, then it won't have an SSLStatus. So
1231 // we need to copy over the SSLStatus from the entry that navigated it. 1239 // we need to copy over the SSLStatus from the entry that navigated it.
1232 NavigationEntryImpl* last_entry = GetLastCommittedEntry(); 1240 NavigationEntryImpl* last_entry = GetLastCommittedEntry();
(...skipping 943 matching lines...) Expand 10 before | Expand all | Expand 10 after
2176 } 2184 }
2177 } 2185 }
2178 } 2186 }
2179 2187
2180 void NavigationControllerImpl::SetGetTimestampCallbackForTest( 2188 void NavigationControllerImpl::SetGetTimestampCallbackForTest(
2181 const base::Callback<base::Time()>& get_timestamp_callback) { 2189 const base::Callback<base::Time()>& get_timestamp_callback) {
2182 get_timestamp_callback_ = get_timestamp_callback; 2190 get_timestamp_callback_ = get_timestamp_callback;
2183 } 2191 }
2184 2192
2185 } // namespace content 2193 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698