| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "content/browser/devtools/render_frame_devtools_agent_host.h" | 9 #include "content/browser/devtools/render_frame_devtools_agent_host.h" |
| 10 #include "content/browser/frame_host/frame_tree.h" | 10 #include "content/browser/frame_host/frame_tree.h" |
| 11 #include "content/browser/frame_host/frame_tree_node.h" | 11 #include "content/browser/frame_host/frame_tree_node.h" |
| 12 #include "content/browser/frame_host/navigation_controller_impl.h" | 12 #include "content/browser/frame_host/navigation_controller_impl.h" |
| 13 #include "content/browser/frame_host/navigation_handle_impl.h" | 13 #include "content/browser/frame_host/navigation_handle_impl.h" |
| 14 #include "content/browser/frame_host/navigation_request_info.h" | 14 #include "content/browser/frame_host/navigation_request_info.h" |
| 15 #include "content/browser/frame_host/navigator.h" | 15 #include "content/browser/frame_host/navigator.h" |
| 16 #include "content/browser/frame_host/navigator_impl.h" | 16 #include "content/browser/frame_host/navigator_impl.h" |
| 17 #include "content/browser/loader/navigation_url_loader.h" | 17 #include "content/browser/loader/navigation_url_loader.h" |
| 18 #include "content/browser/service_worker/service_worker_context_wrapper.h" | 18 #include "content/browser/service_worker/service_worker_context_wrapper.h" |
| 19 #include "content/browser/site_instance_impl.h" | 19 #include "content/browser/site_instance_impl.h" |
| 20 #include "content/common/resource_request_body_impl.h" | 20 #include "content/common/resource_request_body_impl.h" |
| 21 #include "content/public/browser/browser_context.h" | 21 #include "content/public/browser/browser_context.h" |
| 22 #include "content/public/browser/navigation_controller.h" | 22 #include "content/public/browser/navigation_controller.h" |
| 23 #include "content/public/browser/navigation_data.h" | 23 #include "content/public/browser/navigation_data.h" |
| 24 #include "content/public/browser/storage_partition.h" | 24 #include "content/public/browser/storage_partition.h" |
| 25 #include "content/public/browser/stream_handle.h" | 25 #include "content/public/browser/stream_handle.h" |
| 26 #include "content/public/common/content_client.h" | 26 #include "content/public/common/content_client.h" |
| 27 #include "content/public/common/request_context_type.h" |
| 27 #include "content/public/common/resource_response.h" | 28 #include "content/public/common/resource_response.h" |
| 28 #include "net/base/load_flags.h" | 29 #include "net/base/load_flags.h" |
| 29 #include "net/http/http_request_headers.h" | 30 #include "net/http/http_request_headers.h" |
| 30 #include "net/url_request/redirect_info.h" | 31 #include "net/url_request/redirect_info.h" |
| 31 #include "third_party/WebKit/public/web/WebSandboxFlags.h" | 32 #include "third_party/WebKit/public/web/WebSandboxFlags.h" |
| 32 | 33 |
| 33 namespace content { | 34 namespace content { |
| 34 | 35 |
| 35 namespace { | 36 namespace { |
| 36 | 37 |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 // It's safe to use base::Unretained because this NavigationRequest owns | 209 // It's safe to use base::Unretained because this NavigationRequest owns |
| 209 // the NavigationHandle where the callback will be stored. | 210 // the NavigationHandle where the callback will be stored. |
| 210 // TODO(clamy): pass the real value for |is_external_protocol| if needed. | 211 // TODO(clamy): pass the real value for |is_external_protocol| if needed. |
| 211 // TODO(clamy): pass the method to the NavigationHandle instead of a | 212 // TODO(clamy): pass the method to the NavigationHandle instead of a |
| 212 // boolean. | 213 // boolean. |
| 213 navigation_handle_->WillStartRequest( | 214 navigation_handle_->WillStartRequest( |
| 214 common_params_.method, common_params_.post_data, | 215 common_params_.method, common_params_.post_data, |
| 215 Referrer::SanitizeForRequest(common_params_.url, | 216 Referrer::SanitizeForRequest(common_params_.url, |
| 216 common_params_.referrer), | 217 common_params_.referrer), |
| 217 begin_params_.has_user_gesture, common_params_.transition, false, | 218 begin_params_.has_user_gesture, common_params_.transition, false, |
| 219 begin_params_.request_context_type, |
| 218 base::Bind(&NavigationRequest::OnStartChecksComplete, | 220 base::Bind(&NavigationRequest::OnStartChecksComplete, |
| 219 base::Unretained(this))); | 221 base::Unretained(this))); |
| 220 return; | 222 return; |
| 221 } | 223 } |
| 222 | 224 |
| 223 // There is no need to make a network request for this navigation, so commit | 225 // There is no need to make a network request for this navigation, so commit |
| 224 // it immediately. | 226 // it immediately. |
| 225 state_ = RESPONSE_STARTED; | 227 state_ = RESPONSE_STARTED; |
| 226 | 228 |
| 227 // Select an appropriate RenderFrameHost. | 229 // Select an appropriate RenderFrameHost. |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 is_view_source_); | 450 is_view_source_); |
| 449 | 451 |
| 450 // When navigating to a Javascript url, the NavigationRequest is not stored | 452 // When navigating to a Javascript url, the NavigationRequest is not stored |
| 451 // in the FrameTreeNode. Therefore do not reset it, as this could cancel an | 453 // in the FrameTreeNode. Therefore do not reset it, as this could cancel an |
| 452 // existing pending navigation. | 454 // existing pending navigation. |
| 453 if (!common_params_.url.SchemeIs(url::kJavaScriptScheme)) | 455 if (!common_params_.url.SchemeIs(url::kJavaScriptScheme)) |
| 454 frame_tree_node_->ResetNavigationRequest(true); | 456 frame_tree_node_->ResetNavigationRequest(true); |
| 455 } | 457 } |
| 456 | 458 |
| 457 } // namespace content | 459 } // namespace content |
| OLD | NEW |