OLD | NEW |
---|---|
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 1117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1128 // entry instead of looking at the pending entry, because the pending entry | 1128 // entry instead of looking at the pending entry, because the pending entry |
1129 // does not have any subframe history items. | 1129 // does not have any subframe history items. |
1130 if (is_in_page && GetLastCommittedEntry()) { | 1130 if (is_in_page && GetLastCommittedEntry()) { |
1131 FrameNavigationEntry* frame_entry = new FrameNavigationEntry( | 1131 FrameNavigationEntry* frame_entry = new FrameNavigationEntry( |
1132 params.frame_unique_name, params.item_sequence_number, | 1132 params.frame_unique_name, params.item_sequence_number, |
1133 params.document_sequence_number, rfh->GetSiteInstance(), nullptr, | 1133 params.document_sequence_number, rfh->GetSiteInstance(), nullptr, |
1134 params.url, params.referrer, params.method, params.post_id); | 1134 params.url, params.referrer, params.method, params.post_id); |
1135 new_entry = GetLastCommittedEntry()->CloneAndReplace( | 1135 new_entry = GetLastCommittedEntry()->CloneAndReplace( |
1136 frame_entry, true, rfh->frame_tree_node(), | 1136 frame_entry, true, rfh->frame_tree_node(), |
1137 delegate_->GetFrameTree()->root()); | 1137 delegate_->GetFrameTree()->root()); |
1138 CHECK_EQ(new_entry->GetURL().GetOrigin(), params.url.GetOrigin()); | |
estark
2017/02/21 19:39:41
optional nit: if we think the only way this can ha
jam
2017/02/21 20:22:45
I added this because I don't see a way for this to
| |
1138 | 1139 |
1139 // We expect |frame_entry| to be owned by |new_entry|. This should never | 1140 // We expect |frame_entry| to be owned by |new_entry|. This should never |
1140 // fail, because it's the main frame. | 1141 // fail, because it's the main frame. |
1141 CHECK(frame_entry->HasOneRef()); | 1142 CHECK(frame_entry->HasOneRef()); |
1142 | 1143 |
1143 update_virtual_url = new_entry->update_virtual_url_with_url(); | 1144 update_virtual_url = new_entry->update_virtual_url_with_url(); |
1144 | 1145 |
1145 MaybeDumpCopiedNonSameOriginEntry("New page navigation", params, is_in_page, | 1146 MaybeDumpCopiedNonSameOriginEntry("New page navigation", params, is_in_page, |
1146 GetLastCommittedEntry()); | 1147 GetLastCommittedEntry()); |
1147 } | 1148 } |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1244 // in https://crbug.com/596707. | 1245 // in https://crbug.com/596707. |
1245 | 1246 |
1246 NavigationEntryImpl* entry; | 1247 NavigationEntryImpl* entry; |
1247 if (params.intended_as_new_entry) { | 1248 if (params.intended_as_new_entry) { |
1248 // This was intended as a new entry but the pending entry was lost in the | 1249 // This was intended as a new entry but the pending entry was lost in the |
1249 // meanwhile and no new page was created. We are stuck at the last committed | 1250 // meanwhile and no new page was created. We are stuck at the last committed |
1250 // entry. | 1251 // entry. |
1251 entry = GetLastCommittedEntry(); | 1252 entry = GetLastCommittedEntry(); |
1252 MaybeDumpCopiedNonSameOriginEntry("Existing page navigation", params, | 1253 MaybeDumpCopiedNonSameOriginEntry("Existing page navigation", params, |
1253 is_in_page, entry); | 1254 is_in_page, entry); |
1255 CHECK(!is_in_page); | |
estark
2017/02/21 19:39:41
ditto about ReceivedBadMessage
| |
1256 entry->GetSSL() = handle->ssl_status(); | |
1254 } else if (params.nav_entry_id) { | 1257 } else if (params.nav_entry_id) { |
1255 // This is a browser-initiated navigation (back/forward/reload). | 1258 // This is a browser-initiated navigation (back/forward/reload). |
1256 entry = GetEntryWithUniqueID(params.nav_entry_id); | 1259 entry = GetEntryWithUniqueID(params.nav_entry_id); |
1257 | 1260 |
1258 if (is_in_page) { | 1261 if (is_in_page) { |
1259 // There's no SSLStatus in the NavigationHandle for in-page navigations, | 1262 // There's no SSLStatus in the NavigationHandle for in-page navigations, |
1260 // so normally we leave |entry|'s SSLStatus as is. However if this was a | 1263 // so normally we leave |entry|'s SSLStatus as is. However if this was a |
1261 // restored in-page navigation entry, then it won't have an SSLStatus. So | 1264 // restored in-page navigation entry, then it won't have an SSLStatus. So |
1262 // we need to copy over the SSLStatus from the entry that navigated it. | 1265 // we need to copy over the SSLStatus from the entry that navigated it. |
1263 NavigationEntryImpl* last_entry = GetLastCommittedEntry(); | 1266 NavigationEntryImpl* last_entry = GetLastCommittedEntry(); |
(...skipping 922 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2186 } | 2189 } |
2187 } | 2190 } |
2188 } | 2191 } |
2189 | 2192 |
2190 void NavigationControllerImpl::SetGetTimestampCallbackForTest( | 2193 void NavigationControllerImpl::SetGetTimestampCallbackForTest( |
2191 const base::Callback<base::Time()>& get_timestamp_callback) { | 2194 const base::Callback<base::Time()>& get_timestamp_callback) { |
2192 get_timestamp_callback_ = get_timestamp_callback; | 2195 get_timestamp_callback_ = get_timestamp_callback; |
2193 } | 2196 } |
2194 | 2197 |
2195 } // namespace content | 2198 } // namespace content |
OLD | NEW |