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 <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/time/time.h" | 11 #include "base/time/time.h" |
12 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
13 #include "content/common/frame_message_enums.h" | 13 #include "content/common/frame_message_enums.h" |
14 #include "content/public/common/page_state.h" | 14 #include "content/public/common/page_state.h" |
15 #include "content/public/common/referrer.h" | 15 #include "content/public/common/referrer.h" |
16 #include "content/public/common/request_context_type.h" | |
16 #include "ui/base/page_transition_types.h" | 17 #include "ui/base/page_transition_types.h" |
17 #include "url/gurl.h" | 18 #include "url/gurl.h" |
18 | 19 |
19 namespace base { | 20 namespace base { |
20 class RefCountedMemory; | 21 class RefCountedMemory; |
21 } | 22 } |
22 | 23 |
23 namespace content { | 24 namespace content { |
24 | 25 |
25 // PlzNavigate | 26 // PlzNavigate |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
100 // This struct is not used outside of the PlzNavigate project. | 101 // This struct is not used outside of the PlzNavigate project. |
101 // PlzNavigate: parameters needed to start a navigation on the IO thread, | 102 // PlzNavigate: parameters needed to start a navigation on the IO thread, |
102 // following a renderer-initiated navigation request. | 103 // following a renderer-initiated navigation request. |
103 struct CONTENT_EXPORT BeginNavigationParams { | 104 struct CONTENT_EXPORT BeginNavigationParams { |
104 // TODO(clamy): See if it is possible to reuse this in | 105 // TODO(clamy): See if it is possible to reuse this in |
105 // ResourceMsg_Request_Params. | 106 // ResourceMsg_Request_Params. |
106 BeginNavigationParams(); | 107 BeginNavigationParams(); |
107 BeginNavigationParams(std::string method, | 108 BeginNavigationParams(std::string method, |
108 std::string headers, | 109 std::string headers, |
109 int load_flags, | 110 int load_flags, |
110 bool has_user_gesture); | 111 bool has_user_gesture, |
112 bool skip_service_worker, | |
113 RequestContextType request_context_type); | |
111 | 114 |
112 // The request method: GET, POST, etc. | 115 // The request method: GET, POST, etc. |
113 std::string method; | 116 std::string method; |
114 | 117 |
115 // Additional HTTP request headers. | 118 // Additional HTTP request headers. |
116 std::string headers; | 119 std::string headers; |
117 | 120 |
118 // net::URLRequest load flags (net::LOAD_NORMAL) by default). | 121 // net::URLRequest load flags (net::LOAD_NORMAL) by default). |
119 int load_flags; | 122 int load_flags; |
120 | 123 |
121 // True if the request was user initiated. | 124 // True if the request was user initiated. |
122 bool has_user_gesture; | 125 bool has_user_gesture; |
126 | |
127 // True if the ServiceWorker should be skipped. | |
128 bool skip_service_worker; | |
129 | |
130 // Indicates the request context type. | |
131 RequestContextType request_context_type; | |
123 }; | 132 }; |
124 | 133 |
125 // Provided by the browser ----------------------------------------------------- | 134 // Provided by the browser ----------------------------------------------------- |
126 // | 135 // |
127 // These structs are sent by the browser to the renderer to start/commit a | 136 // These structs are sent by the browser to the renderer to start/commit a |
128 // navigation depending on whether browser-side navigation is enabled. | 137 // navigation depending on whether browser-side navigation is enabled. |
129 // Parameters used both in the current architecture and PlzNavigate should be | 138 // Parameters used both in the current architecture and PlzNavigate should be |
130 // put in RequestNavigationParams. Parameters only used by the current | 139 // put in RequestNavigationParams. Parameters only used by the current |
131 // architecture should go in StartNavigationParams. | 140 // architecture should go in StartNavigationParams. |
132 | 141 |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
250 | 259 |
251 // Where its current page contents reside in session history and the total | 260 // Where its current page contents reside in session history and the total |
252 // size of the session history list. | 261 // size of the session history list. |
253 int current_history_list_offset; | 262 int current_history_list_offset; |
254 int current_history_list_length; | 263 int current_history_list_length; |
255 | 264 |
256 // Whether session history should be cleared. In that case, the RenderView | 265 // Whether session history should be cleared. In that case, the RenderView |
257 // needs to notify the browser that the clearing was succesful when the | 266 // needs to notify the browser that the clearing was succesful when the |
258 // navigation commits. | 267 // navigation commits. |
259 bool should_clear_history_list; | 268 bool should_clear_history_list; |
269 | |
270 // PlzNavigate | |
271 // The ServiceWorkerProviderHost ID used for navigations. | |
272 // Set to kInvalidServiceWorkerProviderId for sandboxed frames and sync loads. | |
273 // This is unused for current navigation. | |
nasko
2015/10/02 22:09:45
Can you clarify what is meant by "current"? Is it
clamy
2015/10/05 12:18:17
+1. Something along the lines of "This parameter i
Fabrice (no longer in Chrome)
2015/10/06 17:21:38
Done in the other patch.
| |
274 int service_worker_provider_id; | |
260 }; | 275 }; |
261 | 276 |
262 // Helper struct keeping track in one place of all the parameters the browser | 277 // Helper struct keeping track in one place of all the parameters the browser |
263 // needs to provide to the renderer. | 278 // needs to provide to the renderer. |
264 struct NavigationParams { | 279 struct NavigationParams { |
265 NavigationParams(const CommonNavigationParams& common_params, | 280 NavigationParams(const CommonNavigationParams& common_params, |
266 const StartNavigationParams& start_params, | 281 const StartNavigationParams& start_params, |
267 const RequestNavigationParams& request_params); | 282 const RequestNavigationParams& request_params); |
268 ~NavigationParams(); | 283 ~NavigationParams(); |
269 | 284 |
270 CommonNavigationParams common_params; | 285 CommonNavigationParams common_params; |
271 StartNavigationParams start_params; | 286 StartNavigationParams start_params; |
272 RequestNavigationParams request_params; | 287 RequestNavigationParams request_params; |
273 }; | 288 }; |
274 | 289 |
275 } // namespace content | 290 } // namespace content |
276 | 291 |
277 #endif // CONTENT_COMMON_NAVIGATION_PARAMS_H_ | 292 #endif // CONTENT_COMMON_NAVIGATION_PARAMS_H_ |
OLD | NEW |