Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(335)

Side by Side Diff: content/common/navigation_params.h

Issue 2735183003: PlzNavigate: stop navigations when opening a document for write (Closed)
Patch Set: Rebase Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 const base::Optional<url::Origin>& initiator_origin); 180 const base::Optional<url::Origin>& initiator_origin,
181 int renderer_navigation_id);
179 BeginNavigationParams(const BeginNavigationParams& other); 182 BeginNavigationParams(const BeginNavigationParams& other);
180 ~BeginNavigationParams(); 183 ~BeginNavigationParams();
181 184
182 // Additional HTTP request headers. 185 // Additional HTTP request headers.
183 std::string headers; 186 std::string headers;
184 187
185 // net::URLRequest load flags (net::LOAD_NORMAL) by default). 188 // net::URLRequest load flags (net::LOAD_NORMAL) by default).
186 int load_flags; 189 int load_flags;
187 190
188 // True if the request was user initiated. 191 // True if the request was user initiated.
(...skipping 13 matching lines...) Expand all
202 std::string searchable_form_encoding; 205 std::string searchable_form_encoding;
203 206
204 // Indicates the initiator of the request. In auxilliary navigations, this is 207 // Indicates the initiator of the request. In auxilliary navigations, this is
205 // the origin of the document that triggered the navigation. This parameter 208 // the origin of the document that triggered the navigation. This parameter
206 // can be null during browser-initiated navigations. 209 // can be null during browser-initiated navigations.
207 base::Optional<url::Origin> initiator_origin; 210 base::Optional<url::Origin> initiator_origin;
208 211
209 // If the transition type is a client side redirect, then this holds the URL 212 // If the transition type is a client side redirect, then this holds the URL
210 // of the page that had the client side redirect. 213 // of the page that had the client side redirect.
211 GURL client_side_redirect_url; 214 GURL client_side_redirect_url;
215
216 // ID provided by the renderer to identify this navigation. It will be sent
217 // back to the renderer if the browser decides to drop the navigation.
218 // kInvalidRenderNavigationId means that this navigation wasn't initiated by
219 // the renderer process through the BeginNavigation IPC.
220 int renderer_navigation_id;
212 }; 221 };
213 222
214 // Provided by the browser ----------------------------------------------------- 223 // Provided by the browser -----------------------------------------------------
215 // 224 //
216 // These structs are sent by the browser to the renderer to start/commit a 225 // These structs are sent by the browser to the renderer to start/commit a
217 // navigation depending on whether browser-side navigation is enabled. 226 // navigation depending on whether browser-side navigation is enabled.
218 // Parameters used both in the current architecture and PlzNavigate should be 227 // Parameters used both in the current architecture and PlzNavigate should be
219 // put in RequestNavigationParams. Parameters only used by the current 228 // put in RequestNavigationParams. Parameters only used by the current
220 // architecture should go in StartNavigationParams. 229 // architecture should go in StartNavigationParams.
221 230
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 ~NavigationParams(); 407 ~NavigationParams();
399 408
400 CommonNavigationParams common_params; 409 CommonNavigationParams common_params;
401 StartNavigationParams start_params; 410 StartNavigationParams start_params;
402 RequestNavigationParams request_params; 411 RequestNavigationParams request_params;
403 }; 412 };
404 413
405 } // namespace content 414 } // namespace content
406 415
407 #endif // CONTENT_COMMON_NAVIGATION_PARAMS_H_ 416 #endif // CONTENT_COMMON_NAVIGATION_PARAMS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698