OLD | NEW |
---|---|
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 "content/browser/frame_host/frame_tree.h" | 7 #include "content/browser/frame_host/frame_tree.h" |
8 #include "content/browser/frame_host/frame_tree_node.h" | 8 #include "content/browser/frame_host/frame_tree_node.h" |
9 #include "content/browser/frame_host/navigation_controller_impl.h" | 9 #include "content/browser/frame_host/navigation_controller_impl.h" |
10 #include "content/browser/frame_host/navigation_handle_impl.h" | 10 #include "content/browser/frame_host/navigation_handle_impl.h" |
11 #include "content/browser/frame_host/navigation_request_info.h" | 11 #include "content/browser/frame_host/navigation_request_info.h" |
12 #include "content/browser/frame_host/navigator.h" | 12 #include "content/browser/frame_host/navigator.h" |
13 #include "content/browser/loader/navigation_url_loader.h" | 13 #include "content/browser/loader/navigation_url_loader.h" |
14 #include "content/browser/service_worker/service_worker_provider_host.h" | |
14 #include "content/browser/site_instance_impl.h" | 15 #include "content/browser/site_instance_impl.h" |
15 #include "content/common/resource_request_body.h" | 16 #include "content/common/resource_request_body.h" |
16 #include "content/public/browser/navigation_controller.h" | 17 #include "content/public/browser/navigation_controller.h" |
17 #include "content/public/browser/stream_handle.h" | 18 #include "content/public/browser/stream_handle.h" |
18 #include "content/public/common/content_client.h" | 19 #include "content/public/common/content_client.h" |
19 #include "net/base/load_flags.h" | 20 #include "net/base/load_flags.h" |
20 #include "net/http/http_request_headers.h" | 21 #include "net/http/http_request_headers.h" |
21 #include "net/url_request/redirect_info.h" | 22 #include "net/url_request/redirect_info.h" |
22 | 23 |
23 namespace content { | 24 namespace content { |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
78 if (entry.GetHasPostData()) { | 79 if (entry.GetHasPostData()) { |
79 request_body = new ResourceRequestBody(); | 80 request_body = new ResourceRequestBody(); |
80 request_body->AppendBytes( | 81 request_body->AppendBytes( |
81 reinterpret_cast<const char *>( | 82 reinterpret_cast<const char *>( |
82 entry.GetBrowserInitiatedPostData()->front()), | 83 entry.GetBrowserInitiatedPostData()->front()), |
83 entry.GetBrowserInitiatedPostData()->size()); | 84 entry.GetBrowserInitiatedPostData()->size()); |
84 } | 85 } |
85 | 86 |
86 scoped_ptr<NavigationRequest> navigation_request(new NavigationRequest( | 87 scoped_ptr<NavigationRequest> navigation_request(new NavigationRequest( |
87 frame_tree_node, | 88 frame_tree_node, |
88 entry.ConstructCommonNavigationParams(dest_url, dest_referrer, | 89 entry.ConstructCommonNavigationParams( |
89 frame_entry, navigation_type), | 90 dest_url, dest_referrer, frame_entry, navigation_type, |
90 BeginNavigationParams(method, headers.ToString(), | 91 ServiceWorkerProviderHost::GetNextBrowserProviderID()), |
91 LoadFlagFromNavigationType(navigation_type), false), | 92 BeginNavigationParams(method, |
93 headers.ToString(), | |
94 LoadFlagFromNavigationType(navigation_type), | |
95 false, // has_user_gestures | |
96 false, // skip_service_worker | |
97 FETCH_REQUEST_MODE_NO_CORS, | |
98 FETCH_CREDENTIALS_MODE_SAME_ORIGIN, | |
99 FetchRedirectMode::FOLLOW_MODE, | |
100 REQUEST_CONTEXT_TYPE_LOCATION, | |
101 REQUEST_CONTEXT_FRAME_TYPE_TOP_LEVEL), | |
nasko
2015/08/20 16:49:50
I don't think we can hardcode REQUEST_CONTEXT_FRAM
Fabrice (no longer in Chrome)
2015/08/26 13:23:24
Done.
| |
92 entry.ConstructRequestNavigationParams( | 102 entry.ConstructRequestNavigationParams( |
93 frame_entry, navigation_start, is_same_document_history_load, | 103 frame_entry, navigation_start, is_same_document_history_load, |
94 frame_tree_node->has_committed_real_load(), | 104 frame_tree_node->has_committed_real_load(), |
95 controller->GetPendingEntryIndex() == -1, | 105 controller->GetPendingEntryIndex() == -1, |
96 controller->GetIndexOfEntry(&entry), | 106 controller->GetIndexOfEntry(&entry), |
97 controller->GetLastCommittedEntryIndex(), | 107 controller->GetLastCommittedEntryIndex(), |
98 controller->GetEntryCount()), | 108 controller->GetEntryCount()), |
99 request_body, true, &frame_entry, &entry)); | 109 request_body, true, &frame_entry, &entry)); |
100 return navigation_request.Pass(); | 110 return navigation_request.Pass(); |
101 } | 111 } |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
237 frame_tree_node_->navigator()->FailedNavigation( | 247 frame_tree_node_->navigator()->FailedNavigation( |
238 frame_tree_node_, has_stale_copy_in_cache, net_error); | 248 frame_tree_node_, has_stale_copy_in_cache, net_error); |
239 } | 249 } |
240 | 250 |
241 void NavigationRequest::OnRequestStarted(base::TimeTicks timestamp) { | 251 void NavigationRequest::OnRequestStarted(base::TimeTicks timestamp) { |
242 frame_tree_node_->navigator()->LogResourceRequestTime(timestamp, | 252 frame_tree_node_->navigator()->LogResourceRequestTime(timestamp, |
243 common_params_.url); | 253 common_params_.url); |
244 } | 254 } |
245 | 255 |
246 } // namespace content | 256 } // namespace content |
OLD | NEW |