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 Lo-Fi header. | |
26 enum LoFiState { | |
27 // Let the browser process decide whether or not to request the Lo-Fi version. | |
28 LOFI_UNSPECIFIED = 0, | |
29 | |
30 // Request a normal (non-Lo-Fi) version of the resource. | |
31 LOFI_OFF, | |
32 | |
33 // Request a Lo-Fi version of the resource. | |
34 LOFI_ON, | |
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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
82 // The report type to be used when recording the metric using |ui_timestamp|. | 94 // The report type to be used when recording the metric using |ui_timestamp|. |
83 FrameMsg_UILoadMetricsReportType::Value report_type; | 95 FrameMsg_UILoadMetricsReportType::Value report_type; |
84 | 96 |
85 // Base URL for use in Blink's SubstituteData. | 97 // Base URL for use in Blink's SubstituteData. |
86 // Is only used with data: URLs. | 98 // Is only used with data: URLs. |
87 GURL base_url_for_data_url; | 99 GURL base_url_for_data_url; |
88 | 100 |
89 // History URL for use in Blink's SubstituteData. | 101 // History URL for use in Blink's SubstituteData. |
90 // Is only used with data: URLs. | 102 // Is only used with data: URLs. |
91 GURL history_url_for_data_url; | 103 GURL history_url_for_data_url; |
104 | |
105 // Whether or not to request a LoFi version of the document or let the browser | |
106 // decide. | |
107 LoFiState lofi_state; | |
clamy
2015/10/02 16:08:30
Why are we adding this parameter to this struct? I
megjablon
2015/10/02 17:47:39
It's going to be used in a follow up cl that switc
| |
92 }; | 108 }; |
93 | 109 |
94 // Provided by the renderer ---------------------------------------------------- | 110 // Provided by the renderer ---------------------------------------------------- |
95 // | 111 // |
96 // This struct holds parameters sent by the renderer to the browser. It is only | 112 // This struct holds parameters sent by the renderer to the browser. It is only |
97 // used in PlzNavigate (since in the current architecture, the renderer does not | 113 // used in PlzNavigate (since in the current architecture, the renderer does not |
98 // inform the browser of navigations until they commit). | 114 // inform the browser of navigations until they commit). |
99 | 115 |
100 // This struct is not used outside of the PlzNavigate project. | 116 // This struct is not used outside of the PlzNavigate project. |
101 // PlzNavigate: parameters needed to start a navigation on the IO thread, | 117 // PlzNavigate: parameters needed to start a navigation on the IO thread, |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 |