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 #ifndef CONTENT_COMMON_NAVIGATION_PARAMS_H_ | 5 #ifndef CONTENT_COMMON_NAVIGATION_PARAMS_H_ |
6 #define CONTENT_COMMON_NAVIGATION_PARAMS_H_ | 6 #define CONTENT_COMMON_NAVIGATION_PARAMS_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
11 #include <string> | 11 #include <string> |
12 | 12 |
13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
14 #include "base/optional.h" | 14 #include "base/optional.h" |
15 #include "base/time/time.h" | 15 #include "base/time/time.h" |
16 #include "build/build_config.h" | 16 #include "build/build_config.h" |
17 #include "content/common/content_export.h" | 17 #include "content/common/content_export.h" |
| 18 #include "content/common/content_security_policy/csp_disposition_enum.h" |
18 #include "content/common/frame_message_enums.h" | 19 #include "content/common/frame_message_enums.h" |
19 #include "content/common/resource_request_body_impl.h" | 20 #include "content/common/resource_request_body_impl.h" |
20 #include "content/public/common/page_state.h" | 21 #include "content/public/common/page_state.h" |
21 #include "content/public/common/previews_state.h" | 22 #include "content/public/common/previews_state.h" |
22 #include "content/public/common/referrer.h" | 23 #include "content/public/common/referrer.h" |
23 #include "content/public/common/request_context_type.h" | 24 #include "content/public/common/request_context_type.h" |
24 #include "content/public/common/resource_response.h" | 25 #include "content/public/common/resource_response.h" |
25 #include "net/url_request/redirect_info.h" | 26 #include "net/url_request/redirect_info.h" |
26 #include "third_party/WebKit/public/platform/WebMixedContentContextType.h" | 27 #include "third_party/WebKit/public/platform/WebMixedContentContextType.h" |
27 #include "ui/base/page_transition_types.h" | 28 #include "ui/base/page_transition_types.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 bool allow_download, | 69 bool allow_download, |
69 bool should_replace_current_entry, | 70 bool should_replace_current_entry, |
70 base::TimeTicks ui_timestamp, | 71 base::TimeTicks ui_timestamp, |
71 FrameMsg_UILoadMetricsReportType::Value report_type, | 72 FrameMsg_UILoadMetricsReportType::Value report_type, |
72 const GURL& base_url_for_data_url, | 73 const GURL& base_url_for_data_url, |
73 const GURL& history_url_for_data_url, | 74 const GURL& history_url_for_data_url, |
74 PreviewsState previews_state, | 75 PreviewsState previews_state, |
75 const base::TimeTicks& navigation_start, | 76 const base::TimeTicks& navigation_start, |
76 std::string method, | 77 std::string method, |
77 const scoped_refptr<ResourceRequestBodyImpl>& post_data, | 78 const scoped_refptr<ResourceRequestBodyImpl>& post_data, |
78 base::Optional<SourceLocation> source_location); | 79 base::Optional<SourceLocation> source_location, |
| 80 CSPDisposition should_check_main_world_csp); |
79 CommonNavigationParams(const CommonNavigationParams& other); | 81 CommonNavigationParams(const CommonNavigationParams& other); |
80 ~CommonNavigationParams(); | 82 ~CommonNavigationParams(); |
81 | 83 |
82 // The URL to navigate to. | 84 // The URL to navigate to. |
83 // PlzNavigate: May be modified when the navigation is ready to commit. | 85 // PlzNavigate: May be modified when the navigation is ready to commit. |
84 GURL url; | 86 GURL url; |
85 | 87 |
86 // The URL to send in the "Referer" header field. Can be empty if there is | 88 // The URL to send in the "Referer" header field. Can be empty if there is |
87 // no referrer. | 89 // no referrer. |
88 Referrer referrer; | 90 Referrer referrer; |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 | 135 |
134 // The request method: GET, POST, etc. | 136 // The request method: GET, POST, etc. |
135 std::string method; | 137 std::string method; |
136 | 138 |
137 // Body of HTTP POST request. | 139 // Body of HTTP POST request. |
138 scoped_refptr<ResourceRequestBodyImpl> post_data; | 140 scoped_refptr<ResourceRequestBodyImpl> post_data; |
139 | 141 |
140 // PlzNavigate | 142 // PlzNavigate |
141 // Information about the Javascript source for this navigation. Used for | 143 // Information about the Javascript source for this navigation. Used for |
142 // providing information in console error messages triggered by the | 144 // providing information in console error messages triggered by the |
143 // navigation. If the navigation was not caused by Javascript, this should not | 145 // navigation. If the navigation was not caused by Javascript, this should |
144 // be set. | 146 // not be set. |
145 base::Optional<SourceLocation> source_location; | 147 base::Optional<SourceLocation> source_location; |
| 148 |
| 149 // Whether or not the CSP of the main world should apply. When the navigation |
| 150 // is initiated from a content script in an isolated world, the CSP defined |
| 151 // in the main world should not apply. |
| 152 // TODO(arthursonzogni): Instead of this boolean, the origin of the isolated |
| 153 // world which has initiated the navigation should be passed. |
| 154 // See https://crbug.com/702540 |
| 155 CSPDisposition should_check_main_world_csp; |
146 }; | 156 }; |
147 | 157 |
148 // Provided by the renderer ---------------------------------------------------- | 158 // Provided by the renderer ---------------------------------------------------- |
149 // | 159 // |
150 // This struct holds parameters sent by the renderer to the browser. It is only | 160 // This struct holds parameters sent by the renderer to the browser. It is only |
151 // used in PlzNavigate (since in the current architecture, the renderer does not | 161 // used in PlzNavigate (since in the current architecture, the renderer does not |
152 // inform the browser of navigations until they commit). | 162 // inform the browser of navigations until they commit). |
153 | 163 |
154 // This struct is not used outside of the PlzNavigate project. | 164 // This struct is not used outside of the PlzNavigate project. |
155 // PlzNavigate: parameters needed to start a navigation on the IO thread, | 165 // PlzNavigate: parameters needed to start a navigation on the IO thread, |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 ~NavigationParams(); | 398 ~NavigationParams(); |
389 | 399 |
390 CommonNavigationParams common_params; | 400 CommonNavigationParams common_params; |
391 StartNavigationParams start_params; | 401 StartNavigationParams start_params; |
392 RequestNavigationParams request_params; | 402 RequestNavigationParams request_params; |
393 }; | 403 }; |
394 | 404 |
395 } // namespace content | 405 } // namespace content |
396 | 406 |
397 #endif // CONTENT_COMMON_NAVIGATION_PARAMS_H_ | 407 #endif // CONTENT_COMMON_NAVIGATION_PARAMS_H_ |
OLD | NEW |