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. | |
27 enum LoFiState { | |
28 // Add the LoFi header to the request. | |
bengr
2015/08/25 00:00:02
I would make the comments more declarative, e.g.:
megjablon
2015/08/25 20:29:46
Done.
| |
29 LOFI_ON = 0, | |
30 // Do not add the LoFi header to the request. | |
31 LOFI_OFF, | |
32 // Check with the network-quality-based triggering logic and add the header if | |
33 // the network is slow. | |
34 LOFI_DEFAULT, | |
35 }; | |
36 | |
25 // PlzNavigate | 37 // PlzNavigate |
26 // Helper function to determine if the navigation to |url| should make a request | 38 // 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 | 39 // 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. | 40 // URLs or about:blank. In these cases, no request needs to be sent. |
29 bool ShouldMakeNetworkRequestForURL(const GURL& url); | 41 bool ShouldMakeNetworkRequestForURL(const GURL& url); |
30 | 42 |
31 // The following structures hold parameters used during a navigation. In | 43 // The following structures hold parameters used during a navigation. In |
32 // particular they are used by FrameMsg_Navigate, FrameMsg_CommitNavigation and | 44 // particular they are used by FrameMsg_Navigate, FrameMsg_CommitNavigation and |
33 // FrameHostMsg_BeginNavigation. | 45 // FrameHostMsg_BeginNavigation. |
34 | 46 |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
184 base::Time request_time, | 196 base::Time request_time, |
185 const PageState& page_state, | 197 const PageState& page_state, |
186 int32 page_id, | 198 int32 page_id, |
187 int nav_entry_id, | 199 int nav_entry_id, |
188 bool is_same_document_history_load, | 200 bool is_same_document_history_load, |
189 bool has_committed_real_load, | 201 bool has_committed_real_load, |
190 bool intended_as_new_entry, | 202 bool intended_as_new_entry, |
191 int pending_history_list_offset, | 203 int pending_history_list_offset, |
192 int current_history_list_offset, | 204 int current_history_list_offset, |
193 int current_history_list_length, | 205 int current_history_list_length, |
194 bool should_clear_history_list); | 206 bool should_clear_history_list, |
207 int lofi_state); | |
195 ~RequestNavigationParams(); | 208 ~RequestNavigationParams(); |
196 | 209 |
197 // Whether or not the user agent override string should be used. | 210 // Whether or not the user agent override string should be used. |
198 bool is_overriding_user_agent; | 211 bool is_overriding_user_agent; |
199 | 212 |
200 // The navigationStart time to expose through the Navigation Timing API to JS. | 213 // The navigationStart time to expose through the Navigation Timing API to JS. |
201 base::TimeTicks browser_navigation_start; | 214 base::TimeTicks browser_navigation_start; |
202 | 215 |
203 // Any redirect URLs that occurred before |url|. Useful for cross-process | 216 // Any redirect URLs that occurred before |url|. Useful for cross-process |
204 // navigations; defaults to empty. | 217 // navigations; defaults to empty. |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
250 | 263 |
251 // Where its current page contents reside in session history and the total | 264 // Where its current page contents reside in session history and the total |
252 // size of the session history list. | 265 // size of the session history list. |
253 int current_history_list_offset; | 266 int current_history_list_offset; |
254 int current_history_list_length; | 267 int current_history_list_length; |
255 | 268 |
256 // Whether session history should be cleared. In that case, the RenderView | 269 // Whether session history should be cleared. In that case, the RenderView |
257 // needs to notify the browser that the clearing was succesful when the | 270 // needs to notify the browser that the clearing was succesful when the |
258 // navigation commits. | 271 // navigation commits. |
259 bool should_clear_history_list; | 272 bool should_clear_history_list; |
273 | |
274 // Whether or not the LoFi header should be added to the request or if the | |
bengr
2015/08/25 00:00:02
Not necessary or desirable imho to describe how Lo
megjablon
2015/08/25 20:29:46
Done.
| |
275 // decision should be left up to the network-quality-based triggering logic. | |
276 int lofi_state; | |
260 }; | 277 }; |
261 | 278 |
262 // Helper struct keeping track in one place of all the parameters the browser | 279 // Helper struct keeping track in one place of all the parameters the browser |
263 // needs to provide to the renderer. | 280 // needs to provide to the renderer. |
264 struct NavigationParams { | 281 struct NavigationParams { |
265 NavigationParams(const CommonNavigationParams& common_params, | 282 NavigationParams(const CommonNavigationParams& common_params, |
266 const StartNavigationParams& start_params, | 283 const StartNavigationParams& start_params, |
267 const RequestNavigationParams& request_params); | 284 const RequestNavigationParams& request_params); |
268 ~NavigationParams(); | 285 ~NavigationParams(); |
269 | 286 |
270 CommonNavigationParams common_params; | 287 CommonNavigationParams common_params; |
271 StartNavigationParams start_params; | 288 StartNavigationParams start_params; |
272 RequestNavigationParams request_params; | 289 RequestNavigationParams request_params; |
273 }; | 290 }; |
274 | 291 |
275 } // namespace content | 292 } // namespace content |
276 | 293 |
277 #endif // CONTENT_COMMON_NAVIGATION_PARAMS_H_ | 294 #endif // CONTENT_COMMON_NAVIGATION_PARAMS_H_ |
OLD | NEW |