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> |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 // Whether or not the CSP of the main world should apply. When the navigation | 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 | 150 // is initiated from a content script in an isolated world, the CSP defined |
151 // in the main world should not apply. | 151 // in the main world should not apply. |
152 // TODO(arthursonzogni): Instead of this boolean, the origin of the isolated | 152 // TODO(arthursonzogni): Instead of this boolean, the origin of the isolated |
153 // world which has initiated the navigation should be passed. | 153 // world which has initiated the navigation should be passed. |
154 // See https://crbug.com/702540 | 154 // See https://crbug.com/702540 |
155 CSPDisposition should_check_main_world_csp; | 155 CSPDisposition should_check_main_world_csp; |
156 }; | 156 }; |
157 | 157 |
158 // Provided by the renderer ---------------------------------------------------- | 158 // Provided by the renderer ---------------------------------------------------- |
159 // | 159 |
| 160 const int kInvalidRenderNavigationId = -1; |
| 161 |
160 // This struct holds parameters sent by the renderer to the browser. It is only | 162 // This struct holds parameters sent by the renderer to the browser. It is only |
161 // used in PlzNavigate (since in the current architecture, the renderer does not | 163 // used in PlzNavigate (since in the current architecture, the renderer does not |
162 // inform the browser of navigations until they commit). | 164 // inform the browser of navigations until they commit). |
163 | 165 |
164 // This struct is not used outside of the PlzNavigate project. | 166 // This struct is not used outside of the PlzNavigate project. |
165 // PlzNavigate: parameters needed to start a navigation on the IO thread, | 167 // PlzNavigate: parameters needed to start a navigation on the IO thread, |
166 // following a renderer-initiated navigation request. | 168 // following a renderer-initiated navigation request. |
167 struct CONTENT_EXPORT BeginNavigationParams { | 169 struct CONTENT_EXPORT BeginNavigationParams { |
168 // TODO(clamy): See if it is possible to reuse this in | 170 // TODO(clamy): See if it is possible to reuse this in |
169 // ResourceMsg_Request_Params. | 171 // ResourceMsg_Request_Params. |
170 BeginNavigationParams(); | 172 BeginNavigationParams(); |
171 BeginNavigationParams( | 173 BeginNavigationParams( |
172 std::string headers, | 174 std::string headers, |
173 int load_flags, | 175 int load_flags, |
174 bool has_user_gesture, | 176 bool has_user_gesture, |
175 bool skip_service_worker, | 177 bool skip_service_worker, |
176 RequestContextType request_context_type, | 178 RequestContextType request_context_type, |
177 blink::WebMixedContentContextType mixed_content_context_type, | 179 blink::WebMixedContentContextType mixed_content_context_type, |
178 bool is_form_submission, | 180 bool is_form_submission, |
179 const base::Optional<url::Origin>& initiator_origin); | 181 const base::Optional<url::Origin>& initiator_origin, |
| 182 int renderer_navigation_id); |
180 BeginNavigationParams(const BeginNavigationParams& other); | 183 BeginNavigationParams(const BeginNavigationParams& other); |
181 ~BeginNavigationParams(); | 184 ~BeginNavigationParams(); |
182 | 185 |
183 // Additional HTTP request headers. | 186 // Additional HTTP request headers. |
184 std::string headers; | 187 std::string headers; |
185 | 188 |
186 // net::URLRequest load flags (net::LOAD_NORMAL) by default). | 189 // net::URLRequest load flags (net::LOAD_NORMAL) by default). |
187 int load_flags; | 190 int load_flags; |
188 | 191 |
189 // True if the request was user initiated. | 192 // True if the request was user initiated. |
(...skipping 16 matching lines...) Expand all Loading... |
206 std::string searchable_form_encoding; | 209 std::string searchable_form_encoding; |
207 | 210 |
208 // Indicates the initiator of the request. In auxilliary navigations, this is | 211 // Indicates the initiator of the request. In auxilliary navigations, this is |
209 // the origin of the document that triggered the navigation. This parameter | 212 // the origin of the document that triggered the navigation. This parameter |
210 // can be null during browser-initiated navigations. | 213 // can be null during browser-initiated navigations. |
211 base::Optional<url::Origin> initiator_origin; | 214 base::Optional<url::Origin> initiator_origin; |
212 | 215 |
213 // If the transition type is a client side redirect, then this holds the URL | 216 // If the transition type is a client side redirect, then this holds the URL |
214 // of the page that had the client side redirect. | 217 // of the page that had the client side redirect. |
215 GURL client_side_redirect_url; | 218 GURL client_side_redirect_url; |
| 219 |
| 220 // ID provided by the renderer to identify this navigation. It will be sent |
| 221 // back to the renderer if the browser decides to drop the navigation. |
| 222 // kInvalidRenderNavigationId means that this navigation wasn't initiated by |
| 223 // the renderer process through the BeginNavigation IPC. |
| 224 int renderer_navigation_id; |
216 }; | 225 }; |
217 | 226 |
218 // Provided by the browser ----------------------------------------------------- | 227 // Provided by the browser ----------------------------------------------------- |
219 // | 228 // |
220 // These structs are sent by the browser to the renderer to start/commit a | 229 // These structs are sent by the browser to the renderer to start/commit a |
221 // navigation depending on whether browser-side navigation is enabled. | 230 // navigation depending on whether browser-side navigation is enabled. |
222 // Parameters used both in the current architecture and PlzNavigate should be | 231 // Parameters used both in the current architecture and PlzNavigate should be |
223 // put in RequestNavigationParams. Parameters only used by the current | 232 // put in RequestNavigationParams. Parameters only used by the current |
224 // architecture should go in StartNavigationParams. | 233 // architecture should go in StartNavigationParams. |
225 | 234 |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 ~NavigationParams(); | 411 ~NavigationParams(); |
403 | 412 |
404 CommonNavigationParams common_params; | 413 CommonNavigationParams common_params; |
405 StartNavigationParams start_params; | 414 StartNavigationParams start_params; |
406 RequestNavigationParams request_params; | 415 RequestNavigationParams request_params; |
407 }; | 416 }; |
408 | 417 |
409 } // namespace content | 418 } // namespace content |
410 | 419 |
411 #endif // CONTENT_COMMON_NAVIGATION_PARAMS_H_ | 420 #endif // CONTENT_COMMON_NAVIGATION_PARAMS_H_ |
OLD | NEW |