Chromium Code Reviews| 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 1095 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1106 // the URL. | 1106 // the URL. |
| 1107 update_virtual_url = needs_update; | 1107 update_virtual_url = needs_update; |
| 1108 } | 1108 } |
| 1109 | 1109 |
| 1110 // Don't use the page type from the pending entry. Some interstitial page | 1110 // Don't use the page type from the pending entry. Some interstitial page |
| 1111 // may have set the type to interstitial. Once we commit, however, the page | 1111 // may have set the type to interstitial. Once we commit, however, the page |
| 1112 // type must always be normal or error. | 1112 // type must always be normal or error. |
| 1113 new_entry->set_page_type(params.url_is_unreachable ? PAGE_TYPE_ERROR | 1113 new_entry->set_page_type(params.url_is_unreachable ? PAGE_TYPE_ERROR |
| 1114 : PAGE_TYPE_NORMAL); | 1114 : PAGE_TYPE_NORMAL); |
| 1115 new_entry->SetURL(params.url); | 1115 new_entry->SetURL(params.url); |
| 1116 new_entry->SetOrigin(url::Origin(params.url)); | |
|
Charlie Reis
2016/04/19 22:32:52
Oh, I missed this before. This is wrong-- it'll b
| |
| 1116 if (update_virtual_url) | 1117 if (update_virtual_url) |
| 1117 UpdateVirtualURLToURL(new_entry.get(), params.url); | 1118 UpdateVirtualURLToURL(new_entry.get(), params.url); |
| 1118 new_entry->SetReferrer(params.referrer); | 1119 new_entry->SetReferrer(params.referrer); |
| 1119 new_entry->SetPageID(params.page_id); | 1120 new_entry->SetPageID(params.page_id); |
| 1120 new_entry->SetTransitionType(params.transition); | 1121 new_entry->SetTransitionType(params.transition); |
| 1121 new_entry->set_site_instance( | 1122 new_entry->set_site_instance( |
| 1122 static_cast<SiteInstanceImpl*>(rfh->GetSiteInstance())); | 1123 static_cast<SiteInstanceImpl*>(rfh->GetSiteInstance())); |
| 1123 new_entry->SetOriginalRequestURL(params.original_request_url); | 1124 new_entry->SetOriginalRequestURL(params.original_request_url); |
| 1124 new_entry->SetIsOverridingUserAgent(params.is_overriding_user_agent); | 1125 new_entry->SetIsOverridingUserAgent(params.is_overriding_user_agent); |
| 1125 | 1126 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1173 // navigations that are EXISTING_PAGE are reloads and location.replace, | 1174 // navigations that are EXISTING_PAGE are reloads and location.replace, |
| 1174 // which land us at the last committed entry. | 1175 // which land us at the last committed entry. |
| 1175 entry = GetLastCommittedEntry(); | 1176 entry = GetLastCommittedEntry(); |
| 1176 } | 1177 } |
| 1177 DCHECK(entry); | 1178 DCHECK(entry); |
| 1178 | 1179 |
| 1179 // The URL may have changed due to redirects. | 1180 // The URL may have changed due to redirects. |
| 1180 entry->set_page_type(params.url_is_unreachable ? PAGE_TYPE_ERROR | 1181 entry->set_page_type(params.url_is_unreachable ? PAGE_TYPE_ERROR |
| 1181 : PAGE_TYPE_NORMAL); | 1182 : PAGE_TYPE_NORMAL); |
| 1182 entry->SetURL(params.url); | 1183 entry->SetURL(params.url); |
| 1184 entry->SetOrigin(url::Origin(params.url)); | |
| 1183 entry->SetReferrer(params.referrer); | 1185 entry->SetReferrer(params.referrer); |
| 1184 if (entry->update_virtual_url_with_url()) | 1186 if (entry->update_virtual_url_with_url()) |
| 1185 UpdateVirtualURLToURL(entry, params.url); | 1187 UpdateVirtualURLToURL(entry, params.url); |
| 1186 | 1188 |
| 1187 // Update the post parameters. | 1189 // Update the post parameters. |
| 1188 FrameNavigationEntry* frame_entry = | 1190 FrameNavigationEntry* frame_entry = |
| 1189 entry->GetFrameEntry(rfh->frame_tree_node()); | 1191 entry->GetFrameEntry(rfh->frame_tree_node()); |
| 1190 frame_entry->set_method(params.method); | 1192 frame_entry->set_method(params.method); |
| 1191 frame_entry->set_post_id(params.post_id); | 1193 frame_entry->set_post_id(params.post_id); |
| 1192 | 1194 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1234 // a regular user-initiated navigation. | 1236 // a regular user-initiated navigation. |
| 1235 DCHECK_EQ(pending_entry_->GetUniqueID(), params.nav_entry_id); | 1237 DCHECK_EQ(pending_entry_->GetUniqueID(), params.nav_entry_id); |
| 1236 existing_entry->set_unique_id(pending_entry_->GetUniqueID()); | 1238 existing_entry->set_unique_id(pending_entry_->GetUniqueID()); |
| 1237 | 1239 |
| 1238 // The URL may have changed due to redirects. | 1240 // The URL may have changed due to redirects. |
| 1239 existing_entry->set_page_type(params.url_is_unreachable ? PAGE_TYPE_ERROR | 1241 existing_entry->set_page_type(params.url_is_unreachable ? PAGE_TYPE_ERROR |
| 1240 : PAGE_TYPE_NORMAL); | 1242 : PAGE_TYPE_NORMAL); |
| 1241 if (existing_entry->update_virtual_url_with_url()) | 1243 if (existing_entry->update_virtual_url_with_url()) |
| 1242 UpdateVirtualURLToURL(existing_entry, params.url); | 1244 UpdateVirtualURLToURL(existing_entry, params.url); |
| 1243 existing_entry->SetURL(params.url); | 1245 existing_entry->SetURL(params.url); |
| 1246 existing_entry->SetOrigin(url::Origin(params.url)); | |
| 1244 existing_entry->SetReferrer(params.referrer); | 1247 existing_entry->SetReferrer(params.referrer); |
| 1245 | 1248 |
| 1246 // The page may have been requested with a different HTTP method. | 1249 // The page may have been requested with a different HTTP method. |
| 1247 FrameNavigationEntry* frame_entry = | 1250 FrameNavigationEntry* frame_entry = |
| 1248 existing_entry->GetFrameEntry(rfh->frame_tree_node()); | 1251 existing_entry->GetFrameEntry(rfh->frame_tree_node()); |
| 1249 frame_entry->set_method(params.method); | 1252 frame_entry->set_method(params.method); |
| 1250 frame_entry->set_post_id(params.post_id); | 1253 frame_entry->set_post_id(params.post_id); |
| 1251 | 1254 |
| 1252 DiscardNonCommittedEntries(); | 1255 DiscardNonCommittedEntries(); |
| 1253 } | 1256 } |
| (...skipping 794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2048 } | 2051 } |
| 2049 } | 2052 } |
| 2050 } | 2053 } |
| 2051 | 2054 |
| 2052 void NavigationControllerImpl::SetGetTimestampCallbackForTest( | 2055 void NavigationControllerImpl::SetGetTimestampCallbackForTest( |
| 2053 const base::Callback<base::Time()>& get_timestamp_callback) { | 2056 const base::Callback<base::Time()>& get_timestamp_callback) { |
| 2054 get_timestamp_callback_ = get_timestamp_callback; | 2057 get_timestamp_callback_ = get_timestamp_callback; |
| 2055 } | 2058 } |
| 2056 | 2059 |
| 2057 } // namespace content | 2060 } // namespace content |
| OLD | NEW |