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

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

Issue 2550113002: Send a subtree of same-process PageStates for back/forward child frames.
Patch Set: Rebase Created 4 years 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "content/browser/frame_host/navigation_request.h" 5 #include "content/browser/frame_host/navigation_request.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "content/browser/appcache/appcache_navigation_handle.h" 9 #include "content/browser/appcache/appcache_navigation_handle.h"
10 #include "content/browser/appcache/chrome_appcache_service.h" 10 #include "content/browser/appcache/chrome_appcache_service.h"
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 std::unique_ptr<NavigationRequest> navigation_request(new NavigationRequest( 203 std::unique_ptr<NavigationRequest> navigation_request(new NavigationRequest(
204 frame_tree_node, entry.ConstructCommonNavigationParams( 204 frame_tree_node, entry.ConstructCommonNavigationParams(
205 frame_entry, request_body, dest_url, dest_referrer, 205 frame_entry, request_body, dest_url, dest_referrer,
206 navigation_type, lofi_state, navigation_start), 206 navigation_type, lofi_state, navigation_start),
207 BeginNavigationParams(entry.extra_headers(), net::LOAD_NORMAL, 207 BeginNavigationParams(entry.extra_headers(), net::LOAD_NORMAL,
208 false, // skip_service_worker 208 false, // skip_service_worker
209 REQUEST_CONTEXT_TYPE_LOCATION), 209 REQUEST_CONTEXT_TYPE_LOCATION),
210 entry.ConstructRequestNavigationParams( 210 entry.ConstructRequestNavigationParams(
211 frame_entry, is_same_document_history_load, 211 frame_entry, is_same_document_history_load,
212 is_history_navigation_in_new_child, 212 is_history_navigation_in_new_child,
213 entry.GetSubframeUniqueNames(frame_tree_node), 213 entry.GetSubtreePageStates(frame_tree_node),
214 frame_tree_node->has_committed_real_load(), 214 frame_tree_node->has_committed_real_load(),
215 controller->GetPendingEntryIndex() == -1, 215 controller->GetPendingEntryIndex() == -1,
216 controller->GetIndexOfEntry(&entry), 216 controller->GetIndexOfEntry(&entry),
217 controller->GetLastCommittedEntryIndex(), 217 controller->GetLastCommittedEntryIndex(),
218 controller->GetEntryCount()), 218 controller->GetEntryCount()),
219 true, &frame_entry, &entry)); 219 true, &frame_entry, &entry));
220 return navigation_request; 220 return navigation_request;
221 } 221 }
222 222
223 // static 223 // static
224 std::unique_ptr<NavigationRequest> NavigationRequest::CreateRendererInitiated( 224 std::unique_ptr<NavigationRequest> NavigationRequest::CreateRendererInitiated(
225 FrameTreeNode* frame_tree_node, 225 FrameTreeNode* frame_tree_node,
226 const CommonNavigationParams& common_params, 226 const CommonNavigationParams& common_params,
227 const BeginNavigationParams& begin_params, 227 const BeginNavigationParams& begin_params,
228 int current_history_list_offset, 228 int current_history_list_offset,
229 int current_history_list_length) { 229 int current_history_list_length) {
230 // TODO(clamy): Check if some PageState should be provided here. 230 // TODO(clamy): Check if some PageState should be provided here.
231 // TODO(clamy): See how we should handle override of the user agent when the 231 // TODO(clamy): See how we should handle override of the user agent when the
232 // navigation may start in a renderer and commit in another one. 232 // navigation may start in a renderer and commit in another one.
233 // TODO(clamy): See if the navigation start time should be measured in the 233 // TODO(clamy): See if the navigation start time should be measured in the
234 // renderer and sent to the browser instead of being measured here. 234 // renderer and sent to the browser instead of being measured here.
235 // TODO(clamy): The pending history list offset should be properly set. 235 // TODO(clamy): The pending history list offset should be properly set.
236 RequestNavigationParams request_params( 236 RequestNavigationParams request_params(
237 false, // is_overriding_user_agent 237 false, // is_overriding_user_agent
238 std::vector<GURL>(), // redirects 238 std::vector<GURL>(), // redirects
239 false, // can_load_local_resources 239 false, // can_load_local_resources
240 PageState(), // page_state 240 PageState(), // page_state
241 0, // nav_entry_id 241 0, // nav_entry_id
242 false, // is_same_document_history_load 242 false, // is_same_document_history_load
243 false, // is_history_navigation_in_new_child 243 false, // is_history_navigation_in_new_child
244 std::map<std::string, bool>(), // subframe_unique_names 244 std::map<std::string, PageState>(), // subtree_page_states
245 frame_tree_node->has_committed_real_load(), 245 frame_tree_node->has_committed_real_load(),
246 false, // intended_as_new_entry 246 false, // intended_as_new_entry
247 -1, // pending_history_list_offset 247 -1, // pending_history_list_offset
248 current_history_list_offset, current_history_list_length, 248 current_history_list_offset, current_history_list_length,
249 false, // is_view_source 249 false, // is_view_source
250 false); // should_clear_history_list 250 false); // should_clear_history_list
251 std::unique_ptr<NavigationRequest> navigation_request( 251 std::unique_ptr<NavigationRequest> navigation_request(
252 new NavigationRequest(frame_tree_node, common_params, begin_params, 252 new NavigationRequest(frame_tree_node, common_params, begin_params,
253 request_params, false, nullptr, nullptr)); 253 request_params, false, nullptr, nullptr));
254 return navigation_request; 254 return navigation_request;
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
655 TransferNavigationHandleOwnership(render_frame_host); 655 TransferNavigationHandleOwnership(render_frame_host);
656 656
657 render_frame_host->CommitNavigation(response_.get(), std::move(body_), 657 render_frame_host->CommitNavigation(response_.get(), std::move(body_),
658 common_params_, request_params_, 658 common_params_, request_params_,
659 is_view_source_); 659 is_view_source_);
660 660
661 frame_tree_node_->ResetNavigationRequest(true); 661 frame_tree_node_->ResetNavigationRequest(true);
662 } 662 }
663 663
664 } // namespace content 664 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/navigation_entry_impl.cc ('k') | content/browser/frame_host/navigator_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698