| 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 REQUEST_CONTEXT_TYPE_HYPERLINK), |
| 92 entry.ConstructRequestNavigationParams( | 98 entry.ConstructRequestNavigationParams( |
| 93 frame_entry, navigation_start, is_same_document_history_load, | 99 frame_entry, navigation_start, is_same_document_history_load, |
| 94 frame_tree_node->has_committed_real_load(), | 100 frame_tree_node->has_committed_real_load(), |
| 95 controller->GetPendingEntryIndex() == -1, | 101 controller->GetPendingEntryIndex() == -1, |
| 96 controller->GetIndexOfEntry(&entry), | 102 controller->GetIndexOfEntry(&entry), |
| 97 controller->GetLastCommittedEntryIndex(), | 103 controller->GetLastCommittedEntryIndex(), |
| 98 controller->GetEntryCount()), | 104 controller->GetEntryCount()), |
| 99 request_body, true, &frame_entry, &entry)); | 105 request_body, true, &frame_entry, &entry)); |
| 100 return navigation_request.Pass(); | 106 return navigation_request.Pass(); |
| 101 } | 107 } |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 frame_tree_node_->navigator()->FailedNavigation( | 243 frame_tree_node_->navigator()->FailedNavigation( |
| 238 frame_tree_node_, has_stale_copy_in_cache, net_error); | 244 frame_tree_node_, has_stale_copy_in_cache, net_error); |
| 239 } | 245 } |
| 240 | 246 |
| 241 void NavigationRequest::OnRequestStarted(base::TimeTicks timestamp) { | 247 void NavigationRequest::OnRequestStarted(base::TimeTicks timestamp) { |
| 242 frame_tree_node_->navigator()->LogResourceRequestTime(timestamp, | 248 frame_tree_node_->navigator()->LogResourceRequestTime(timestamp, |
| 243 common_params_.url); | 249 common_params_.url); |
| 244 } | 250 } |
| 245 | 251 |
| 246 } // namespace content | 252 } // namespace content |
| OLD | NEW |