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

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

Issue 2299843002: Fix the page's SSL status not being set on restore. (Closed)
Patch Set: add regression test and fix failing tests from initial patch 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 1168 matching lines...) Expand 10 before | Expand all | Expand 10 after
1179 1179
1180 NavigationEntryImpl* entry; 1180 NavigationEntryImpl* entry;
1181 if (params.intended_as_new_entry) { 1181 if (params.intended_as_new_entry) {
1182 // This was intended as a new entry but the pending entry was lost in the 1182 // This was intended as a new entry but the pending entry was lost in the
1183 // meanwhile and no new page was created. We are stuck at the last committed 1183 // meanwhile and no new page was created. We are stuck at the last committed
1184 // entry. 1184 // entry.
1185 entry = GetLastCommittedEntry(); 1185 entry = GetLastCommittedEntry();
1186 } else if (params.nav_entry_id) { 1186 } else if (params.nav_entry_id) {
1187 // This is a browser-initiated navigation (back/forward/reload). 1187 // This is a browser-initiated navigation (back/forward/reload).
1188 entry = GetEntryWithUniqueID(params.nav_entry_id); 1188 entry = GetEntryWithUniqueID(params.nav_entry_id);
1189
1190 // Needed for the restore case, where the serialized NavigationEntry doesn't
1191 // have the SSL state.
1192 NavigationHandleImpl* handle = rfh->navigation_handle();
1193 entry->GetSSL() = handle->ssl_status();
nasko 2016/09/01 01:35:29 I think we might need this to happen also in Rende
jam 2016/09/01 02:58:56 I tried pressing enter in the omnibox and it goes
nasko 2016/09/01 06:27:55 They key part is for the server to do a redirect.
jam 2016/09/01 15:44:09 Got it, thanks. Ok I added a test and a fix.
1189 } else { 1194 } else {
1190 // This is renderer-initiated. The only kinds of renderer-initated 1195 // This is renderer-initiated. The only kinds of renderer-initated
1191 // navigations that are EXISTING_PAGE are reloads and location.replace, 1196 // navigations that are EXISTING_PAGE are reloads and location.replace,
1192 // which land us at the last committed entry. 1197 // which land us at the last committed entry.
1193 entry = GetLastCommittedEntry(); 1198 entry = GetLastCommittedEntry();
1194 } 1199 }
1195 DCHECK(entry); 1200 DCHECK(entry);
1196 1201
1197 // The URL may have changed due to redirects. 1202 // The URL may have changed due to redirects.
1198 entry->set_page_type(params.url_is_unreachable ? PAGE_TYPE_ERROR 1203 entry->set_page_type(params.url_is_unreachable ? PAGE_TYPE_ERROR
(...skipping 902 matching lines...) Expand 10 before | Expand all | Expand 10 after
2101 } 2106 }
2102 } 2107 }
2103 } 2108 }
2104 2109
2105 void NavigationControllerImpl::SetGetTimestampCallbackForTest( 2110 void NavigationControllerImpl::SetGetTimestampCallbackForTest(
2106 const base::Callback<base::Time()>& get_timestamp_callback) { 2111 const base::Callback<base::Time()>& get_timestamp_callback) {
2107 get_timestamp_callback_ = get_timestamp_callback; 2112 get_timestamp_callback_ = get_timestamp_callback;
2108 } 2113 }
2109 2114
2110 } // namespace content 2115 } // namespace content
OLDNEW
« chrome/browser/ssl/ssl_browser_tests.cc ('K') | « chrome/browser/ssl/ssl_browser_tests.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698