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 "ui/base/page_transition_types.h" | 16 #include "ui/base/page_transition_types.h" |
17 #include "url/gurl.h" | 17 #include "url/gurl.h" |
18 | 18 |
19 namespace base { | 19 namespace base { |
20 class RefCountedMemory; | 20 class RefCountedMemory; |
21 } | 21 } |
22 | 22 |
23 namespace content { | 23 namespace content { |
24 | 24 |
25 // The LoFi state which determines whether to add the LoFi header. Must stay in | |
26 // sync with the enum in url_request.h. | |
davidben
2015/08/27 18:53:50
There is no reason for this. The enum shouldn't be
megjablon
2015/08/27 23:11:02
Using URLRequest in DataReductionProxyNetworkDeleg
| |
27 enum LoFiState { | |
28 // Request a LoFi version of the resource. | |
29 LOFI_ON = 0, | |
30 // Request a normal (non-LoFi) version of the resource. | |
31 LOFI_OFF, | |
32 // Let the browser process decide whether or not to request the LoFi version. | |
33 LOFI_DEFAULT, | |
34 }; | |
35 | |
25 // PlzNavigate | 36 // PlzNavigate |
26 // Helper function to determine if the navigation to |url| should make a request | 37 // Helper function to determine if the navigation to |url| should make a request |
27 // to the network stack. A request should not be sent for data URLs, JavaScript | 38 // to the network stack. A request should not be sent for data URLs, JavaScript |
28 // URLs or about:blank. In these cases, no request needs to be sent. | 39 // URLs or about:blank. In these cases, no request needs to be sent. |
29 bool ShouldMakeNetworkRequestForURL(const GURL& url); | 40 bool ShouldMakeNetworkRequestForURL(const GURL& url); |
30 | 41 |
31 // The following structures hold parameters used during a navigation. In | 42 // The following structures hold parameters used during a navigation. In |
32 // particular they are used by FrameMsg_Navigate, FrameMsg_CommitNavigation and | 43 // particular they are used by FrameMsg_Navigate, FrameMsg_CommitNavigation and |
33 // FrameHostMsg_BeginNavigation. | 44 // FrameHostMsg_BeginNavigation. |
34 | 45 |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
184 base::Time request_time, | 195 base::Time request_time, |
185 const PageState& page_state, | 196 const PageState& page_state, |
186 int32 page_id, | 197 int32 page_id, |
187 int nav_entry_id, | 198 int nav_entry_id, |
188 bool is_same_document_history_load, | 199 bool is_same_document_history_load, |
189 bool has_committed_real_load, | 200 bool has_committed_real_load, |
190 bool intended_as_new_entry, | 201 bool intended_as_new_entry, |
191 int pending_history_list_offset, | 202 int pending_history_list_offset, |
192 int current_history_list_offset, | 203 int current_history_list_offset, |
193 int current_history_list_length, | 204 int current_history_list_length, |
194 bool should_clear_history_list); | 205 bool should_clear_history_list, |
206 int lofi_state); | |
davidben
2015/08/27 18:53:50
Use your enum, not an int.
megjablon
2015/08/27 23:11:02
Done.
| |
195 ~RequestNavigationParams(); | 207 ~RequestNavigationParams(); |
196 | 208 |
197 // Whether or not the user agent override string should be used. | 209 // Whether or not the user agent override string should be used. |
198 bool is_overriding_user_agent; | 210 bool is_overriding_user_agent; |
199 | 211 |
200 // The navigationStart time to expose through the Navigation Timing API to JS. | 212 // The navigationStart time to expose through the Navigation Timing API to JS. |
201 base::TimeTicks browser_navigation_start; | 213 base::TimeTicks browser_navigation_start; |
202 | 214 |
203 // Any redirect URLs that occurred before |url|. Useful for cross-process | 215 // Any redirect URLs that occurred before |url|. Useful for cross-process |
204 // navigations; defaults to empty. | 216 // navigations; defaults to empty. |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
250 | 262 |
251 // Where its current page contents reside in session history and the total | 263 // Where its current page contents reside in session history and the total |
252 // size of the session history list. | 264 // size of the session history list. |
253 int current_history_list_offset; | 265 int current_history_list_offset; |
254 int current_history_list_length; | 266 int current_history_list_length; |
255 | 267 |
256 // Whether session history should be cleared. In that case, the RenderView | 268 // Whether session history should be cleared. In that case, the RenderView |
257 // needs to notify the browser that the clearing was succesful when the | 269 // needs to notify the browser that the clearing was succesful when the |
258 // navigation commits. | 270 // navigation commits. |
259 bool should_clear_history_list; | 271 bool should_clear_history_list; |
272 | |
273 // Whether or not to request a LoFi version of the resource or let the browser | |
274 // decide. | |
275 int lofi_state; | |
davidben
2015/08/27 18:53:50
Use your enum, not an int.
megjablon
2015/08/27 23:11:02
Using the enum instead of an int breaks IPC compil
davidben
2015/08/31 23:43:24
nasko would be a better person to answer this than
megjablon
2015/09/09 20:54:15
Done.
| |
260 }; | 276 }; |
261 | 277 |
262 // Helper struct keeping track in one place of all the parameters the browser | 278 // Helper struct keeping track in one place of all the parameters the browser |
263 // needs to provide to the renderer. | 279 // needs to provide to the renderer. |
264 struct NavigationParams { | 280 struct NavigationParams { |
265 NavigationParams(const CommonNavigationParams& common_params, | 281 NavigationParams(const CommonNavigationParams& common_params, |
266 const StartNavigationParams& start_params, | 282 const StartNavigationParams& start_params, |
267 const RequestNavigationParams& request_params); | 283 const RequestNavigationParams& request_params); |
268 ~NavigationParams(); | 284 ~NavigationParams(); |
269 | 285 |
270 CommonNavigationParams common_params; | 286 CommonNavigationParams common_params; |
271 StartNavigationParams start_params; | 287 StartNavigationParams start_params; |
272 RequestNavigationParams request_params; | 288 RequestNavigationParams request_params; |
273 }; | 289 }; |
274 | 290 |
275 } // namespace content | 291 } // namespace content |
276 | 292 |
277 #endif // CONTENT_COMMON_NAVIGATION_PARAMS_H_ | 293 #endif // CONTENT_COMMON_NAVIGATION_PARAMS_H_ |
OLD | NEW |