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 "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "content/browser/appcache/appcache_navigation_handle.h" | 10 #include "content/browser/appcache/appcache_navigation_handle.h" |
11 #include "content/browser/appcache/chrome_appcache_service.h" | 11 #include "content/browser/appcache/chrome_appcache_service.h" |
12 #include "content/browser/child_process_security_policy_impl.h" | 12 #include "content/browser/child_process_security_policy_impl.h" |
13 #include "content/browser/devtools/render_frame_devtools_agent_host.h" | 13 #include "content/browser/devtools/render_frame_devtools_agent_host.h" |
14 #include "content/browser/frame_host/debug_urls.h" | 14 #include "content/browser/frame_host/debug_urls.h" |
15 #include "content/browser/frame_host/frame_tree.h" | 15 #include "content/browser/frame_host/frame_tree.h" |
16 #include "content/browser/frame_host/frame_tree_node.h" | 16 #include "content/browser/frame_host/frame_tree_node.h" |
17 #include "content/browser/frame_host/navigation_controller_impl.h" | 17 #include "content/browser/frame_host/navigation_controller_impl.h" |
18 #include "content/browser/frame_host/navigation_handle_impl.h" | 18 #include "content/browser/frame_host/navigation_handle_impl.h" |
19 #include "content/browser/frame_host/navigation_request_info.h" | 19 #include "content/browser/frame_host/navigation_request_info.h" |
20 #include "content/browser/frame_host/navigator.h" | 20 #include "content/browser/frame_host/navigator.h" |
21 #include "content/browser/frame_host/navigator_impl.h" | 21 #include "content/browser/frame_host/navigator_impl.h" |
22 #include "content/browser/frame_host/render_frame_host_impl.h" | 22 #include "content/browser/frame_host/render_frame_host_impl.h" |
23 #include "content/browser/loader/navigation_url_loader.h" | 23 #include "content/browser/loader/navigation_url_loader.h" |
24 #include "content/browser/renderer_host/render_process_host_impl.h" | 24 #include "content/browser/renderer_host/render_process_host_impl.h" |
25 #include "content/browser/service_worker/service_worker_context_wrapper.h" | 25 #include "content/browser/service_worker/service_worker_context_wrapper.h" |
26 #include "content/browser/service_worker/service_worker_navigation_handle.h" | 26 #include "content/browser/service_worker/service_worker_navigation_handle.h" |
27 #include "content/browser/site_instance_impl.h" | 27 #include "content/browser/site_instance_impl.h" |
28 #include "content/common/appcache_interfaces.h" | 28 #include "content/common/appcache_interfaces.h" |
29 #include "content/common/resource_request_body_impl.h" | |
30 #include "content/public/browser/browser_context.h" | 29 #include "content/public/browser/browser_context.h" |
31 #include "content/public/browser/browser_thread.h" | 30 #include "content/public/browser/browser_thread.h" |
32 #include "content/public/browser/content_browser_client.h" | 31 #include "content/public/browser/content_browser_client.h" |
33 #include "content/public/browser/global_request_id.h" | 32 #include "content/public/browser/global_request_id.h" |
34 #include "content/public/browser/navigation_controller.h" | 33 #include "content/public/browser/navigation_controller.h" |
35 #include "content/public/browser/navigation_data.h" | 34 #include "content/public/browser/navigation_data.h" |
36 #include "content/public/browser/navigation_ui_data.h" | 35 #include "content/public/browser/navigation_ui_data.h" |
37 #include "content/public/browser/render_view_host.h" | 36 #include "content/public/browser/render_view_host.h" |
38 #include "content/public/browser/storage_partition.h" | 37 #include "content/public/browser/storage_partition.h" |
39 #include "content/public/browser/stream_handle.h" | 38 #include "content/public/browser/stream_handle.h" |
40 #include "content/public/common/appcache_info.h" | 39 #include "content/public/common/appcache_info.h" |
41 #include "content/public/common/content_client.h" | 40 #include "content/public/common/content_client.h" |
42 #include "content/public/common/origin_util.h" | 41 #include "content/public/common/origin_util.h" |
43 #include "content/public/common/request_context_type.h" | 42 #include "content/public/common/request_context_type.h" |
| 43 #include "content/public/common/resource_request_body.h" |
44 #include "content/public/common/resource_response.h" | 44 #include "content/public/common/resource_response.h" |
45 #include "content/public/common/url_constants.h" | 45 #include "content/public/common/url_constants.h" |
46 #include "content/public/common/web_preferences.h" | 46 #include "content/public/common/web_preferences.h" |
47 #include "net/base/load_flags.h" | 47 #include "net/base/load_flags.h" |
48 #include "net/base/net_errors.h" | 48 #include "net/base/net_errors.h" |
49 #include "net/base/url_util.h" | 49 #include "net/base/url_util.h" |
50 #include "net/http/http_request_headers.h" | 50 #include "net/http/http_request_headers.h" |
51 #include "net/url_request/redirect_info.h" | 51 #include "net/url_request/redirect_info.h" |
52 #include "third_party/WebKit/public/platform/WebMixedContentContextType.h" | 52 #include "third_party/WebKit/public/platform/WebMixedContentContextType.h" |
53 #include "third_party/WebKit/public/web/WebSandboxFlags.h" | 53 #include "third_party/WebKit/public/web/WebSandboxFlags.h" |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 std::unique_ptr<NavigationRequest> NavigationRequest::CreateBrowserInitiated( | 193 std::unique_ptr<NavigationRequest> NavigationRequest::CreateBrowserInitiated( |
194 FrameTreeNode* frame_tree_node, | 194 FrameTreeNode* frame_tree_node, |
195 const GURL& dest_url, | 195 const GURL& dest_url, |
196 const Referrer& dest_referrer, | 196 const Referrer& dest_referrer, |
197 const FrameNavigationEntry& frame_entry, | 197 const FrameNavigationEntry& frame_entry, |
198 const NavigationEntryImpl& entry, | 198 const NavigationEntryImpl& entry, |
199 FrameMsg_Navigate_Type::Value navigation_type, | 199 FrameMsg_Navigate_Type::Value navigation_type, |
200 PreviewsState previews_state, | 200 PreviewsState previews_state, |
201 bool is_same_document_history_load, | 201 bool is_same_document_history_load, |
202 bool is_history_navigation_in_new_child, | 202 bool is_history_navigation_in_new_child, |
203 const scoped_refptr<ResourceRequestBodyImpl>& post_body, | 203 const scoped_refptr<ResourceRequestBody>& post_body, |
204 const base::TimeTicks& navigation_start, | 204 const base::TimeTicks& navigation_start, |
205 NavigationControllerImpl* controller) { | 205 NavigationControllerImpl* controller) { |
206 // A form submission happens either because the navigation is a | 206 // A form submission happens either because the navigation is a |
207 // renderer-initiated form submission that took the OpenURL path or a | 207 // renderer-initiated form submission that took the OpenURL path or a |
208 // back/forward/reload navigation the does a form resubmission. | 208 // back/forward/reload navigation the does a form resubmission. |
209 scoped_refptr<ResourceRequestBodyImpl> request_body; | 209 scoped_refptr<ResourceRequestBody> request_body; |
210 if (post_body) { | 210 if (post_body) { |
211 // Standard form submission from the renderer. | 211 // Standard form submission from the renderer. |
212 request_body = post_body; | 212 request_body = post_body; |
213 } else if (frame_entry.method() == "POST") { | 213 } else if (frame_entry.method() == "POST") { |
214 // Form resubmission during a back/forward/reload navigation. | 214 // Form resubmission during a back/forward/reload navigation. |
215 request_body = frame_entry.GetPostData(); | 215 request_body = frame_entry.GetPostData(); |
216 } | 216 } |
217 // TODO(arthursonzogni): Form submission with the "GET" method is possible. | 217 // TODO(arthursonzogni): Form submission with the "GET" method is possible. |
218 // This is not currently handled here. | 218 // This is not currently handled here. |
219 bool is_form_submission = !!request_body; | 219 bool is_form_submission = !!request_body; |
(...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
989 CSPDirective::FrameSrc, common_params_.url, is_redirect, | 989 CSPDirective::FrameSrc, common_params_.url, is_redirect, |
990 common_params_.source_location.value_or(SourceLocation()), | 990 common_params_.source_location.value_or(SourceLocation()), |
991 CSPContext::CHECK_ENFORCED_CSP)) { | 991 CSPContext::CHECK_ENFORCED_CSP)) { |
992 return CONTENT_SECURITY_POLICY_CHECK_PASSED; | 992 return CONTENT_SECURITY_POLICY_CHECK_PASSED; |
993 } | 993 } |
994 | 994 |
995 return CONTENT_SECURITY_POLICY_CHECK_FAILED; | 995 return CONTENT_SECURITY_POLICY_CHECK_FAILED; |
996 } | 996 } |
997 | 997 |
998 } // namespace content | 998 } // namespace content |
OLD | NEW |