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

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

Issue 1294243004: PlzNavigate: Make ServiceWorker work with PlzNavigate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Style, placeholders, all that stuff Created 5 years, 4 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/common/service_worker/service_worker_types.h"
14 #include "content/public/common/page_state.h" 15 #include "content/public/common/page_state.h"
15 #include "content/public/common/referrer.h" 16 #include "content/public/common/referrer.h"
17 #include "content/public/common/request_context_frame_type.h"
18 #include "content/public/common/request_context_type.h"
16 #include "ui/base/page_transition_types.h" 19 #include "ui/base/page_transition_types.h"
17 #include "url/gurl.h" 20 #include "url/gurl.h"
18 21
19 namespace base { 22 namespace base {
20 class RefCountedMemory; 23 class RefCountedMemory;
21 } 24 }
22 25
23 namespace content { 26 namespace content {
24 27
25 // PlzNavigate 28 // PlzNavigate
(...skipping 13 matching lines...) Expand all
39 CommonNavigationParams(); 42 CommonNavigationParams();
40 CommonNavigationParams(const GURL& url, 43 CommonNavigationParams(const GURL& url,
41 const Referrer& referrer, 44 const Referrer& referrer,
42 ui::PageTransition transition, 45 ui::PageTransition transition,
43 FrameMsg_Navigate_Type::Value navigation_type, 46 FrameMsg_Navigate_Type::Value navigation_type,
44 bool allow_download, 47 bool allow_download,
45 bool should_replace_current_entry, 48 bool should_replace_current_entry,
46 base::TimeTicks ui_timestamp, 49 base::TimeTicks ui_timestamp,
47 FrameMsg_UILoadMetricsReportType::Value report_type, 50 FrameMsg_UILoadMetricsReportType::Value report_type,
48 const GURL& base_url_for_data_url, 51 const GURL& base_url_for_data_url,
49 const GURL& history_url_for_data_url); 52 const GURL& history_url_for_data_url,
53 int service_worker_provider_id);
michaeln 2015/09/01 01:15:23 browser_initiated_nav_id
50 ~CommonNavigationParams(); 54 ~CommonNavigationParams();
51 55
52 // The URL to navigate to. 56 // The URL to navigate to.
53 // PlzNavigate: May be modified when the navigation is ready to commit. 57 // PlzNavigate: May be modified when the navigation is ready to commit.
54 GURL url; 58 GURL url;
55 59
56 // The URL to send in the "Referer" header field. Can be empty if there is 60 // The URL to send in the "Referer" header field. Can be empty if there is
57 // no referrer. 61 // no referrer.
58 Referrer referrer; 62 Referrer referrer;
59 63
(...skipping 22 matching lines...) Expand all
82 // The report type to be used when recording the metric using |ui_timestamp|. 86 // The report type to be used when recording the metric using |ui_timestamp|.
83 FrameMsg_UILoadMetricsReportType::Value report_type; 87 FrameMsg_UILoadMetricsReportType::Value report_type;
84 88
85 // Base URL for use in Blink's SubstituteData. 89 // Base URL for use in Blink's SubstituteData.
86 // Is only used with data: URLs. 90 // Is only used with data: URLs.
87 GURL base_url_for_data_url; 91 GURL base_url_for_data_url;
88 92
89 // History URL for use in Blink's SubstituteData. 93 // History URL for use in Blink's SubstituteData.
90 // Is only used with data: URLs. 94 // Is only used with data: URLs.
91 GURL history_url_for_data_url; 95 GURL history_url_for_data_url;
96
97 // PlzNavigate
98 // The ServiceWorker provider ID associated with the navigation.
99 int service_worker_provider_id;
92 }; 100 };
93 101
94 // Provided by the renderer ---------------------------------------------------- 102 // Provided by the renderer ----------------------------------------------------
95 // 103 //
96 // This struct holds parameters sent by the renderer to the browser. It is only 104 // 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 105 // used in PlzNavigate (since in the current architecture, the renderer does not
98 // inform the browser of navigations until they commit). 106 // inform the browser of navigations until they commit).
99 107
100 // This struct is not used outside of the PlzNavigate project. 108 // This struct is not used outside of the PlzNavigate project.
101 // PlzNavigate: parameters needed to start a navigation on the IO thread, 109 // PlzNavigate: parameters needed to start a navigation on the IO thread,
102 // following a renderer-initiated navigation request. 110 // following a renderer-initiated navigation request.
103 struct CONTENT_EXPORT BeginNavigationParams { 111 struct CONTENT_EXPORT BeginNavigationParams {
104 // TODO(clamy): See if it is possible to reuse this in 112 // TODO(clamy): See if it is possible to reuse this in
105 // ResourceMsg_Request_Params. 113 // ResourceMsg_Request_Params.
106 BeginNavigationParams(); 114 BeginNavigationParams();
107 BeginNavigationParams(std::string method, 115 BeginNavigationParams(std::string method,
108 std::string headers, 116 std::string headers,
109 int load_flags, 117 int load_flags,
110 bool has_user_gesture); 118 bool has_user_gesture,
119 bool skip_service_worker,
120 FetchRequestMode fetch_request_mode,
nasko 2015/08/20 16:49:50 Can we skip adding some of these? For example, Fet
Fabrice (no longer in Chrome) 2015/08/26 13:23:24 I removed them and DCHEK'd them per clamy's sugges
121 FetchCredentialsMode fetch_credentials_mode,
122 FetchRedirectMode fetch_redirect_mode,
123 RequestContextType request_context_type,
nasko 2015/08/20 16:49:50 This one can also be only one of two values, right
Fabrice (no longer in Chrome) 2015/08/26 13:23:24 I did some quick and dirty testing, these are the
124 RequestContextFrameType frame_type);
111 125
112 // The request method: GET, POST, etc. 126 // The request method: GET, POST, etc.
113 std::string method; 127 std::string method;
114 128
115 // Additional HTTP request headers. 129 // Additional HTTP request headers.
116 std::string headers; 130 std::string headers;
117 131
118 // net::URLRequest load flags (net::LOAD_NORMAL) by default). 132 // net::URLRequest load flags (net::LOAD_NORMAL) by default).
119 int load_flags; 133 int load_flags;
120 134
121 // True if the request was user initiated. 135 // True if the request was user initiated.
122 bool has_user_gesture; 136 bool has_user_gesture;
137
138 // True if the ServiceWorker should be skipped.
clamy 2015/08/24 12:27:35 In which cases is skip_service_worker set to true?
Fabrice (no longer in Chrome) 2015/08/26 13:23:24 There are a few cases: -The request was fallbacked
kinuko 2015/08/27 01:37:44 I think your understanding is correct. Fallback ha
139 bool skip_service_worker;
140
141 // The request mode passed to the ServiceWorker.
142 FetchRequestMode fetch_request_mode;
143
144 // The credentials mode passed to the ServiceWorker.
145 FetchCredentialsMode fetch_credentials_mode;
146
147 // The redirect mode used in Fetch API.
148 FetchRedirectMode fetch_redirect_mode;
149
150 // Indicates if the current request is the main frame load, a sub-frame
151 // load, or a sub objects load.
152 RequestContextType request_context_type;
153 RequestContextFrameType frame_type;
123 }; 154 };
124 155
125 // Provided by the browser ----------------------------------------------------- 156 // Provided by the browser -----------------------------------------------------
126 // 157 //
127 // These structs are sent by the browser to the renderer to start/commit a 158 // These structs are sent by the browser to the renderer to start/commit a
128 // navigation depending on whether browser-side navigation is enabled. 159 // navigation depending on whether browser-side navigation is enabled.
129 // Parameters used both in the current architecture and PlzNavigate should be 160 // Parameters used both in the current architecture and PlzNavigate should be
130 // put in RequestNavigationParams. Parameters only used by the current 161 // put in RequestNavigationParams. Parameters only used by the current
131 // architecture should go in StartNavigationParams. 162 // architecture should go in StartNavigationParams.
132 163
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 ~NavigationParams(); 299 ~NavigationParams();
269 300
270 CommonNavigationParams common_params; 301 CommonNavigationParams common_params;
271 StartNavigationParams start_params; 302 StartNavigationParams start_params;
272 RequestNavigationParams request_params; 303 RequestNavigationParams request_params;
273 }; 304 };
274 305
275 } // namespace content 306 } // namespace content
276 307
277 #endif // CONTENT_COMMON_NAVIGATION_PARAMS_H_ 308 #endif // CONTENT_COMMON_NAVIGATION_PARAMS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698