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

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

Issue 1977313002: Define parameter structs of resource messages out of resource_messages.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // IPC messages for resource loading. 5 // IPC messages for resource loading.
6 // 6 //
7 // NOTE: All messages must send an |int request_id| as their first parameter. 7 // NOTE: All messages must send an |int request_id| as their first parameter.
8 8
9 // Multiply-included message file, hence no include guard. 9 // Multiply-included message file, hence no include guard.
10 10
11 #include <stdint.h> 11 #include <stdint.h>
12 12
13 #include "base/memory/shared_memory.h" 13 #include "base/memory/shared_memory.h"
14 #include "base/process/process.h" 14 #include "base/process/process.h"
15 #include "content/common/content_param_traits_macros.h" 15 #include "content/common/content_param_traits_macros.h"
16 #include "content/common/navigation_params.h" 16 #include "content/common/navigation_params.h"
17 #include "content/common/resource_request.h"
17 #include "content/common/resource_request_body.h" 18 #include "content/common/resource_request_body.h"
19 #include "content/common/resource_request_completion_status.h"
18 #include "content/common/service_worker/service_worker_types.h" 20 #include "content/common/service_worker/service_worker_types.h"
19 #include "content/public/common/common_param_traits.h" 21 #include "content/public/common/common_param_traits.h"
20 #include "content/public/common/resource_response.h" 22 #include "content/public/common/resource_response.h"
21 #include "ipc/ipc_message_macros.h" 23 #include "ipc/ipc_message_macros.h"
22 #include "net/base/request_priority.h" 24 #include "net/base/request_priority.h"
23 #include "net/http/http_response_info.h" 25 #include "net/http/http_response_info.h"
24 #include "net/nqe/network_quality_estimator.h" 26 #include "net/nqe/network_quality_estimator.h"
25 #include "net/url_request/redirect_info.h" 27 #include "net/url_request/redirect_info.h"
26 28
27 #ifndef CONTENT_COMMON_RESOURCE_MESSAGES_H_ 29 #ifndef CONTENT_COMMON_RESOURCE_MESSAGES_H_
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 165
164 IPC_STRUCT_TRAITS_BEGIN(net::RedirectInfo) 166 IPC_STRUCT_TRAITS_BEGIN(net::RedirectInfo)
165 IPC_STRUCT_TRAITS_MEMBER(status_code) 167 IPC_STRUCT_TRAITS_MEMBER(status_code)
166 IPC_STRUCT_TRAITS_MEMBER(new_method) 168 IPC_STRUCT_TRAITS_MEMBER(new_method)
167 IPC_STRUCT_TRAITS_MEMBER(new_url) 169 IPC_STRUCT_TRAITS_MEMBER(new_url)
168 IPC_STRUCT_TRAITS_MEMBER(new_first_party_for_cookies) 170 IPC_STRUCT_TRAITS_MEMBER(new_first_party_for_cookies)
169 IPC_STRUCT_TRAITS_MEMBER(new_referrer) 171 IPC_STRUCT_TRAITS_MEMBER(new_referrer)
170 IPC_STRUCT_TRAITS_MEMBER(referred_token_binding_host) 172 IPC_STRUCT_TRAITS_MEMBER(referred_token_binding_host)
171 IPC_STRUCT_TRAITS_END() 173 IPC_STRUCT_TRAITS_END()
172 174
173 // Parameters for a resource request. 175 IPC_STRUCT_TRAITS_BEGIN(content::ResourceRequest)
174 IPC_STRUCT_BEGIN(ResourceHostMsg_Request) 176 IPC_STRUCT_TRAITS_MEMBER(method)
175 // The request method: GET, POST, etc. 177 IPC_STRUCT_TRAITS_MEMBER(url)
176 IPC_STRUCT_MEMBER(std::string, method) 178 IPC_STRUCT_TRAITS_MEMBER(first_party_for_cookies)
177 179 IPC_STRUCT_TRAITS_MEMBER(request_initiator)
178 // The requested URL. 180 IPC_STRUCT_TRAITS_MEMBER(referrer)
179 IPC_STRUCT_MEMBER(GURL, url) 181 IPC_STRUCT_TRAITS_MEMBER(referrer_policy)
180 182 IPC_STRUCT_TRAITS_MEMBER(visiblity_state)
181 // Usually the URL of the document in the top-level window, which may be 183 IPC_STRUCT_TRAITS_MEMBER(headers)
182 // checked by the third-party cookie blocking policy. Leaving it empty may 184 IPC_STRUCT_TRAITS_MEMBER(load_flags)
183 // lead to undesired cookie blocking. Third-party cookie blocking can be 185 IPC_STRUCT_TRAITS_MEMBER(origin_pid)
184 // bypassed by setting first_party_for_cookies = url, but this should ideally 186 IPC_STRUCT_TRAITS_MEMBER(resource_type)
185 // only be done if there really is no way to determine the correct value. 187 IPC_STRUCT_TRAITS_MEMBER(priority)
186 IPC_STRUCT_MEMBER(GURL, first_party_for_cookies) 188 IPC_STRUCT_TRAITS_MEMBER(request_context)
187 189 IPC_STRUCT_TRAITS_MEMBER(appcache_host_id)
188 // The origin of the context which initiated the request, which will be used 190 IPC_STRUCT_TRAITS_MEMBER(should_reset_appcache)
189 // for cookie checks like 'First-Party-Only'. 191 IPC_STRUCT_TRAITS_MEMBER(service_worker_provider_id)
190 IPC_STRUCT_MEMBER(url::Origin, request_initiator) 192 IPC_STRUCT_TRAITS_MEMBER(originated_from_service_worker)
191 193 IPC_STRUCT_TRAITS_MEMBER(skip_service_worker)
192 // The referrer to use (may be empty). 194 IPC_STRUCT_TRAITS_MEMBER(fetch_request_mode)
193 IPC_STRUCT_MEMBER(GURL, referrer) 195 IPC_STRUCT_TRAITS_MEMBER(fetch_credentials_mode)
194 196 IPC_STRUCT_TRAITS_MEMBER(fetch_redirect_mode)
195 // The referrer policy to use. 197 IPC_STRUCT_TRAITS_MEMBER(fetch_request_context_type)
196 IPC_STRUCT_MEMBER(blink::WebReferrerPolicy, referrer_policy) 198 IPC_STRUCT_TRAITS_MEMBER(fetch_frame_type)
197 199 IPC_STRUCT_TRAITS_MEMBER(request_body)
198 // The frame's visiblity state. 200 IPC_STRUCT_TRAITS_MEMBER(download_to_file)
199 IPC_STRUCT_MEMBER(blink::WebPageVisibilityState, visiblity_state) 201 IPC_STRUCT_TRAITS_MEMBER(has_user_gesture)
200 202 IPC_STRUCT_TRAITS_MEMBER(enable_load_timing)
201 // Additional HTTP request headers. 203 IPC_STRUCT_TRAITS_MEMBER(enable_upload_progress)
202 IPC_STRUCT_MEMBER(std::string, headers) 204 IPC_STRUCT_TRAITS_MEMBER(do_not_prompt_for_login)
203 205 IPC_STRUCT_TRAITS_MEMBER(render_frame_id)
204 // net::URLRequest load flags (0 by default). 206 IPC_STRUCT_TRAITS_MEMBER(is_main_frame)
205 IPC_STRUCT_MEMBER(int, load_flags) 207 IPC_STRUCT_TRAITS_MEMBER(parent_is_main_frame)
206 208 IPC_STRUCT_TRAITS_MEMBER(parent_render_frame_id)
207 // Process ID from which this request originated, or zero if it originated 209 IPC_STRUCT_TRAITS_MEMBER(transition_type)
208 // in the renderer itself. 210 IPC_STRUCT_TRAITS_MEMBER(should_replace_current_entry)
209 // If kDirectNPAPIRequests isn't specified, then plugin requests get routed 211 IPC_STRUCT_TRAITS_MEMBER(transferred_request_child_id)
210 // through the renderer and and this holds the pid of the plugin process. 212 IPC_STRUCT_TRAITS_MEMBER(transferred_request_request_id)
211 // Otherwise this holds the render_process_id of the view that has the plugin. 213 IPC_STRUCT_TRAITS_MEMBER(allow_download)
212 IPC_STRUCT_MEMBER(int, origin_pid) 214 IPC_STRUCT_TRAITS_MEMBER(report_raw_headers)
213 215 IPC_STRUCT_TRAITS_MEMBER(lofi_state)
214 // What this resource load is for (main frame, sub-frame, sub-resource, 216 IPC_STRUCT_TRAITS_MEMBER(resource_body_stream_url)
215 // object). 217 IPC_STRUCT_TRAITS_END()
216 IPC_STRUCT_MEMBER(content::ResourceType, resource_type)
217
218 // The priority of this request.
219 IPC_STRUCT_MEMBER(net::RequestPriority, priority)
220
221 // Used by plugin->browser requests to get the correct net::URLRequestContext.
222 IPC_STRUCT_MEMBER(uint32_t, request_context)
223
224 // Indicates which frame (or worker context) the request is being loaded into,
225 // or kAppCacheNoHostId.
226 IPC_STRUCT_MEMBER(int, appcache_host_id)
227
228 // True if corresponding AppCache group should be resetted.
229 IPC_STRUCT_MEMBER(bool, should_reset_appcache)
230
231 // Indicates which frame (or worker context) the request is being loaded into,
232 // or kInvalidServiceWorkerProviderId.
233 IPC_STRUCT_MEMBER(int, service_worker_provider_id)
234
235 // True if the request originated from a Service Worker, e.g. due to a
236 // fetch() in the Service Worker script.
237 IPC_STRUCT_MEMBER(bool, originated_from_service_worker)
238
239 // True if the request should not be handled by the ServiceWorker.
240 IPC_STRUCT_MEMBER(bool, skip_service_worker)
241
242 // The request mode passed to the ServiceWorker.
243 IPC_STRUCT_MEMBER(content::FetchRequestMode, fetch_request_mode)
244
245 // The credentials mode passed to the ServiceWorker.
246 IPC_STRUCT_MEMBER(content::FetchCredentialsMode, fetch_credentials_mode)
247
248 // The redirect mode used in Fetch API.
249 IPC_STRUCT_MEMBER(content::FetchRedirectMode, fetch_redirect_mode)
250
251 // The request context passed to the ServiceWorker.
252 IPC_STRUCT_MEMBER(content::RequestContextType, fetch_request_context_type)
253
254 // The frame type passed to the ServiceWorker.
255 IPC_STRUCT_MEMBER(content::RequestContextFrameType, fetch_frame_type)
256
257 // Optional resource request body (may be null).
258 IPC_STRUCT_MEMBER(scoped_refptr<content::ResourceRequestBody>,
259 request_body)
260
261 IPC_STRUCT_MEMBER(bool, download_to_file)
262
263 // True if the request was user initiated.
264 IPC_STRUCT_MEMBER(bool, has_user_gesture)
265
266 // True if load timing data should be collected for request.
267 IPC_STRUCT_MEMBER(bool, enable_load_timing)
268
269 // True if upload progress should be available for request.
270 IPC_STRUCT_MEMBER(bool, enable_upload_progress)
271
272 // True if login prompts for this request should be supressed.
273 IPC_STRUCT_MEMBER(bool, do_not_prompt_for_login)
274
275 // The routing id of the RenderFrame.
276 IPC_STRUCT_MEMBER(int, render_frame_id)
277
278 // True if |frame_id| is the main frame of a RenderView.
279 IPC_STRUCT_MEMBER(bool, is_main_frame)
280
281 // True if |parent_render_frame_id| is the main frame of a RenderView.
282 IPC_STRUCT_MEMBER(bool, parent_is_main_frame)
283
284 // Identifies the parent frame of the frame that sent the request.
285 // -1 if unknown / invalid.
286 IPC_STRUCT_MEMBER(int, parent_render_frame_id)
287
288 IPC_STRUCT_MEMBER(ui::PageTransition, transition_type)
289
290 // For navigations, whether this navigation should replace the current session
291 // history entry on commit.
292 IPC_STRUCT_MEMBER(bool, should_replace_current_entry)
293
294 // The following two members identify a previous request that has been
295 // created before this navigation has been transferred to a new render view.
296 // This serves the purpose of recycling the old request.
297 // Unless this refers to a transferred navigation, these values are -1 and -1.
298 IPC_STRUCT_MEMBER(int, transferred_request_child_id)
299 IPC_STRUCT_MEMBER(int, transferred_request_request_id)
300
301 // Whether or not we should allow the URL to download.
302 IPC_STRUCT_MEMBER(bool, allow_download)
303
304 // Whether to intercept headers to pass back to the renderer.
305 IPC_STRUCT_MEMBER(bool, report_raw_headers)
306
307 // Whether or not to request a LoFi version of the resource or let the browser
308 // decide.
309 IPC_STRUCT_MEMBER(content::LoFiState, lofi_state)
310
311 // PlzNavigate: the stream url associated with a navigation. Used to get
312 // access to the body of the response that has already been fetched by the
313 // browser.
314 IPC_STRUCT_MEMBER(GURL, resource_body_stream_url)
315 IPC_STRUCT_END()
316 218
317 // Parameters for a ResourceMsg_RequestComplete 219 // Parameters for a ResourceMsg_RequestComplete
318 IPC_STRUCT_BEGIN(ResourceMsg_RequestCompleteData) 220 IPC_STRUCT_TRAITS_BEGIN(content::ResourceRequestCompletionStatus)
319 // The error code. 221 IPC_STRUCT_TRAITS_MEMBER(error_code)
320 IPC_STRUCT_MEMBER(int, error_code) 222 IPC_STRUCT_TRAITS_MEMBER(was_ignored_by_handler)
321 223 IPC_STRUCT_TRAITS_MEMBER(exists_in_cache)
322 // Was ignored by the request handler. 224 IPC_STRUCT_TRAITS_MEMBER(security_info)
323 IPC_STRUCT_MEMBER(bool, was_ignored_by_handler) 225 IPC_STRUCT_TRAITS_MEMBER(completion_time)
324 226 IPC_STRUCT_TRAITS_MEMBER(encoded_data_length)
325 // A copy of the data requested exists in the cache. 227 IPC_STRUCT_TRAITS_END()
326 IPC_STRUCT_MEMBER(bool, exists_in_cache)
327
328 // Serialized security info; see content/common/ssl_status_serialization.h.
329 IPC_STRUCT_MEMBER(std::string, security_info)
330
331 // Time the request completed.
332 IPC_STRUCT_MEMBER(base::TimeTicks, completion_time)
333
334 // Total amount of data received from the network.
335 IPC_STRUCT_MEMBER(int64_t, encoded_data_length)
336 IPC_STRUCT_END()
337 228
338 // Resource messages sent from the browser to the renderer. 229 // Resource messages sent from the browser to the renderer.
339 230
340 // Sent when the headers are available for a resource request. 231 // Sent when the headers are available for a resource request.
341 IPC_MESSAGE_CONTROL2(ResourceMsg_ReceivedResponse, 232 IPC_MESSAGE_CONTROL2(ResourceMsg_ReceivedResponse,
342 int /* request_id */, 233 int /* request_id */,
343 content::ResourceResponseHead) 234 content::ResourceResponseHead)
344 235
345 // Sent when cached metadata from a resource request is ready. 236 // Sent when cached metadata from a resource request is ready.
346 IPC_MESSAGE_CONTROL2(ResourceMsg_ReceivedCachedMetadata, 237 IPC_MESSAGE_CONTROL2(ResourceMsg_ReceivedCachedMetadata,
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 // file. This is only called in the 'download_to_file' case and replaces 290 // file. This is only called in the 'download_to_file' case and replaces
400 // ResourceMsg_DataReceived in the call sequence in that case. 291 // ResourceMsg_DataReceived in the call sequence in that case.
401 IPC_MESSAGE_CONTROL3(ResourceMsg_DataDownloaded, 292 IPC_MESSAGE_CONTROL3(ResourceMsg_DataDownloaded,
402 int /* request_id */, 293 int /* request_id */,
403 int /* data_len */, 294 int /* data_len */,
404 int /* encoded_data_length */) 295 int /* encoded_data_length */)
405 296
406 // Sent when the request has been completed. 297 // Sent when the request has been completed.
407 IPC_MESSAGE_CONTROL2(ResourceMsg_RequestComplete, 298 IPC_MESSAGE_CONTROL2(ResourceMsg_RequestComplete,
408 int /* request_id */, 299 int /* request_id */,
409 ResourceMsg_RequestCompleteData) 300 content::ResourceRequestCompletionStatus)
410 301
411 // Resource messages sent from the renderer to the browser. 302 // Resource messages sent from the renderer to the browser.
412 303
413 // Makes a resource request via the browser. 304 // Makes a resource request via the browser.
414 IPC_MESSAGE_CONTROL3(ResourceHostMsg_RequestResource, 305 IPC_MESSAGE_CONTROL3(ResourceHostMsg_RequestResource,
415 int /* routing_id */, 306 int /* routing_id */,
416 int /* request_id */, 307 int /* request_id */,
417 ResourceHostMsg_Request) 308 content::ResourceRequest)
418 309
419 // Cancels a resource request with the ID given as the parameter. 310 // Cancels a resource request with the ID given as the parameter.
420 IPC_MESSAGE_CONTROL1(ResourceHostMsg_CancelRequest, 311 IPC_MESSAGE_CONTROL1(ResourceHostMsg_CancelRequest,
421 int /* request_id */) 312 int /* request_id */)
422 313
423 // Follows a redirect that occured for the resource request with the ID given 314 // Follows a redirect that occured for the resource request with the ID given
424 // as the parameter. 315 // as the parameter.
425 IPC_MESSAGE_CONTROL1(ResourceHostMsg_FollowRedirect, 316 IPC_MESSAGE_CONTROL1(ResourceHostMsg_FollowRedirect,
426 int /* request_id */) 317 int /* request_id */)
427 318
428 // Makes a synchronous resource request via the browser. 319 // Makes a synchronous resource request via the browser.
429 IPC_SYNC_MESSAGE_ROUTED2_1(ResourceHostMsg_SyncLoad, 320 IPC_SYNC_MESSAGE_ROUTED2_1(ResourceHostMsg_SyncLoad,
430 int /* request_id */, 321 int /* request_id */,
431 ResourceHostMsg_Request, 322 content::ResourceRequest,
432 content::SyncLoadResult) 323 content::SyncLoadResult)
433 324
434 // Sent when the renderer process is done processing a DataReceived 325 // Sent when the renderer process is done processing a DataReceived
435 // message. 326 // message.
436 IPC_MESSAGE_CONTROL1(ResourceHostMsg_DataReceived_ACK, 327 IPC_MESSAGE_CONTROL1(ResourceHostMsg_DataReceived_ACK,
437 int /* request_id */) 328 int /* request_id */)
438 329
439 // Sent when the renderer has processed a DataDownloaded message. 330 // Sent when the renderer has processed a DataDownloaded message.
440 IPC_MESSAGE_CONTROL1(ResourceHostMsg_DataDownloaded_ACK, 331 IPC_MESSAGE_CONTROL1(ResourceHostMsg_DataDownloaded_ACK,
441 int /* request_id */) 332 int /* request_id */)
442 333
443 // Sent by the renderer process to acknowledge receipt of a 334 // Sent by the renderer process to acknowledge receipt of a
444 // UploadProgress message. 335 // UploadProgress message.
445 IPC_MESSAGE_CONTROL1(ResourceHostMsg_UploadProgress_ACK, 336 IPC_MESSAGE_CONTROL1(ResourceHostMsg_UploadProgress_ACK,
446 int /* request_id */) 337 int /* request_id */)
447 338
448 // Sent when the renderer process deletes a resource loader. 339 // Sent when the renderer process deletes a resource loader.
449 IPC_MESSAGE_CONTROL1(ResourceHostMsg_ReleaseDownloadedFile, 340 IPC_MESSAGE_CONTROL1(ResourceHostMsg_ReleaseDownloadedFile,
450 int /* request_id */) 341 int /* request_id */)
451 342
452 // Sent by the renderer when a resource request changes priority. 343 // Sent by the renderer when a resource request changes priority.
453 IPC_MESSAGE_CONTROL3(ResourceHostMsg_DidChangePriority, 344 IPC_MESSAGE_CONTROL3(ResourceHostMsg_DidChangePriority,
454 int /* request_id */, 345 int /* request_id */,
455 net::RequestPriority, 346 net::RequestPriority,
456 int /* intra_priority_value */) 347 int /* intra_priority_value */)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698