Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(354)

Side by Side Diff: content/common/navigation_params.h

Issue 1310743003: Consistently use LoFi for an entire page (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
35 // Provided by the browser or the renderer ------------------------------------- 47 // Provided by the browser or the renderer -------------------------------------
36 48
37 // Used by all navigation IPCs. 49 // Used by all navigation IPCs.
38 struct CONTENT_EXPORT CommonNavigationParams { 50 struct CONTENT_EXPORT CommonNavigationParams {
39 CommonNavigationParams(); 51 CommonNavigationParams();
40 CommonNavigationParams(const GURL& url, 52 CommonNavigationParams(const GURL& url,
41 const Referrer& referrer, 53 const Referrer& referrer,
42 ui::PageTransition transition, 54 ui::PageTransition transition,
43 FrameMsg_Navigate_Type::Value navigation_type, 55 FrameMsg_Navigate_Type::Value navigation_type,
44 bool allow_download, 56 bool allow_download,
45 bool should_replace_current_entry, 57 bool should_replace_current_entry,
46 base::TimeTicks ui_timestamp, 58 base::TimeTicks ui_timestamp,
47 FrameMsg_UILoadMetricsReportType::Value report_type, 59 FrameMsg_UILoadMetricsReportType::Value report_type,
48 const GURL& base_url_for_data_url, 60 const GURL& base_url_for_data_url,
49 const GURL& history_url_for_data_url); 61 const GURL& history_url_for_data_url,
62 LoFiState lofi_state);
50 ~CommonNavigationParams(); 63 ~CommonNavigationParams();
51 64
52 // The URL to navigate to. 65 // The URL to navigate to.
53 // PlzNavigate: May be modified when the navigation is ready to commit. 66 // PlzNavigate: May be modified when the navigation is ready to commit.
54 GURL url; 67 GURL url;
55 68
56 // The URL to send in the "Referer" header field. Can be empty if there is 69 // The URL to send in the "Referer" header field. Can be empty if there is
57 // no referrer. 70 // no referrer.
58 Referrer referrer; 71 Referrer referrer;
59 72
(...skipping 22 matching lines...) Expand all
82 // The report type to be used when recording the metric using |ui_timestamp|. 95 // The report type to be used when recording the metric using |ui_timestamp|.
83 FrameMsg_UILoadMetricsReportType::Value report_type; 96 FrameMsg_UILoadMetricsReportType::Value report_type;
84 97
85 // Base URL for use in Blink's SubstituteData. 98 // Base URL for use in Blink's SubstituteData.
86 // Is only used with data: URLs. 99 // Is only used with data: URLs.
87 GURL base_url_for_data_url; 100 GURL base_url_for_data_url;
88 101
89 // History URL for use in Blink's SubstituteData. 102 // History URL for use in Blink's SubstituteData.
90 // Is only used with data: URLs. 103 // Is only used with data: URLs.
91 GURL history_url_for_data_url; 104 GURL history_url_for_data_url;
105
106 // Whether or not to request a LoFi version of the document or let the browser
107 // decide.
108 LoFiState lofi_state;
92 }; 109 };
93 110
94 // Provided by the renderer ---------------------------------------------------- 111 // Provided by the renderer ----------------------------------------------------
95 // 112 //
96 // This struct holds parameters sent by the renderer to the browser. It is only 113 // 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 114 // used in PlzNavigate (since in the current architecture, the renderer does not
98 // inform the browser of navigations until they commit). 115 // inform the browser of navigations until they commit).
99 116
100 // This struct is not used outside of the PlzNavigate project. 117 // This struct is not used outside of the PlzNavigate project.
101 // PlzNavigate: parameters needed to start a navigation on the IO thread, 118 // PlzNavigate: parameters needed to start a navigation on the IO thread,
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698