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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
184 base::Time request_time, | 193 base::Time request_time, |
185 const PageState& page_state, | 194 const PageState& page_state, |
186 int32 page_id, | 195 int32 page_id, |
187 int nav_entry_id, | 196 int nav_entry_id, |
188 bool is_same_document_history_load, | 197 bool is_same_document_history_load, |
189 bool has_committed_real_load, | 198 bool has_committed_real_load, |
190 bool intended_as_new_entry, | 199 bool intended_as_new_entry, |
191 int pending_history_list_offset, | 200 int pending_history_list_offset, |
192 int current_history_list_offset, | 201 int current_history_list_offset, |
193 int current_history_list_length, | 202 int current_history_list_length, |
194 bool should_clear_history_list); | 203 bool should_clear_history_list, |
204 int service_worker_provider_id); | |
195 ~RequestNavigationParams(); | 205 ~RequestNavigationParams(); |
196 | 206 |
197 // Whether or not the user agent override string should be used. | 207 // Whether or not the user agent override string should be used. |
198 bool is_overriding_user_agent; | 208 bool is_overriding_user_agent; |
199 | 209 |
200 // The navigationStart time to expose through the Navigation Timing API to JS. | 210 // The navigationStart time to expose through the Navigation Timing API to JS. |
201 base::TimeTicks browser_navigation_start; | 211 base::TimeTicks browser_navigation_start; |
202 | 212 |
203 // Any redirect URLs that occurred before |url|. Useful for cross-process | 213 // Any redirect URLs that occurred before |url|. Useful for cross-process |
204 // navigations; defaults to empty. | 214 // navigations; defaults to empty. |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
250 | 260 |
251 // Where its current page contents reside in session history and the total | 261 // Where its current page contents reside in session history and the total |
252 // size of the session history list. | 262 // size of the session history list. |
253 int current_history_list_offset; | 263 int current_history_list_offset; |
254 int current_history_list_length; | 264 int current_history_list_length; |
255 | 265 |
256 // Whether session history should be cleared. In that case, the RenderView | 266 // Whether session history should be cleared. In that case, the RenderView |
257 // needs to notify the browser that the clearing was succesful when the | 267 // needs to notify the browser that the clearing was succesful when the |
258 // navigation commits. | 268 // navigation commits. |
259 bool should_clear_history_list; | 269 bool should_clear_history_list; |
270 | |
271 // PlzNavigate | |
272 // SWProvider ID for navigations. | |
clamy
2015/10/01 12:41:27
Use the full class name.
Fabrice (no longer in Chrome)
2015/10/01 18:29:56
Done.
| |
273 int service_worker_provider_id; | |
260 }; | 274 }; |
261 | 275 |
262 // Helper struct keeping track in one place of all the parameters the browser | 276 // Helper struct keeping track in one place of all the parameters the browser |
263 // needs to provide to the renderer. | 277 // needs to provide to the renderer. |
264 struct NavigationParams { | 278 struct NavigationParams { |
265 NavigationParams(const CommonNavigationParams& common_params, | 279 NavigationParams(const CommonNavigationParams& common_params, |
266 const StartNavigationParams& start_params, | 280 const StartNavigationParams& start_params, |
267 const RequestNavigationParams& request_params); | 281 const RequestNavigationParams& request_params); |
268 ~NavigationParams(); | 282 ~NavigationParams(); |
269 | 283 |
270 CommonNavigationParams common_params; | 284 CommonNavigationParams common_params; |
271 StartNavigationParams start_params; | 285 StartNavigationParams start_params; |
272 RequestNavigationParams request_params; | 286 RequestNavigationParams request_params; |
273 }; | 287 }; |
274 | 288 |
275 } // namespace content | 289 } // namespace content |
276 | 290 |
277 #endif // CONTENT_COMMON_NAVIGATION_PARAMS_H_ | 291 #endif // CONTENT_COMMON_NAVIGATION_PARAMS_H_ |
OLD | NEW |