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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/child/resource_dispatcher_unittest.cc ('k') | content/common/resource_request.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/resource_messages.h
diff --git a/content/common/resource_messages.h b/content/common/resource_messages.h
index 3471b4bc9b40289a4023da3efb40a80b4d65e2a0..c74a4e810561f4b098040732578315472ba777b6 100644
--- a/content/common/resource_messages.h
+++ b/content/common/resource_messages.h
@@ -14,7 +14,9 @@
#include "base/process/process.h"
#include "content/common/content_param_traits_macros.h"
#include "content/common/navigation_params.h"
+#include "content/common/resource_request.h"
#include "content/common/resource_request_body.h"
+#include "content/common/resource_request_completion_status.h"
#include "content/common/service_worker/service_worker_types.h"
#include "content/public/common/common_param_traits.h"
#include "content/public/common/resource_response.h"
@@ -196,170 +198,59 @@ IPC_STRUCT_TRAITS_END()
IPC_ENUM_TRAITS_MAX_VALUE(net::ct::SCTVerifyStatus, net::ct::SCT_STATUS_MAX)
-// Parameters for a resource request.
-IPC_STRUCT_BEGIN(ResourceHostMsg_Request)
- // The request method: GET, POST, etc.
- IPC_STRUCT_MEMBER(std::string, method)
-
- // The requested URL.
- IPC_STRUCT_MEMBER(GURL, url)
-
- // Usually the URL of the document in the top-level window, which may be
- // checked by the third-party cookie blocking policy. Leaving it empty may
- // lead to undesired cookie blocking. Third-party cookie blocking can be
- // bypassed by setting first_party_for_cookies = url, but this should ideally
- // only be done if there really is no way to determine the correct value.
- IPC_STRUCT_MEMBER(GURL, first_party_for_cookies)
-
- // The origin of the context which initiated the request, which will be used
- // for cookie checks like 'First-Party-Only'.
- IPC_STRUCT_MEMBER(url::Origin, request_initiator)
-
- // The referrer to use (may be empty).
- IPC_STRUCT_MEMBER(GURL, referrer)
-
- // The referrer policy to use.
- IPC_STRUCT_MEMBER(blink::WebReferrerPolicy, referrer_policy)
-
- // The frame's visiblity state.
- IPC_STRUCT_MEMBER(blink::WebPageVisibilityState, visiblity_state)
-
- // Additional HTTP request headers.
- IPC_STRUCT_MEMBER(std::string, headers)
-
- // net::URLRequest load flags (0 by default).
- IPC_STRUCT_MEMBER(int, load_flags)
-
- // Process ID from which this request originated, or zero if it originated
- // in the renderer itself.
- // If kDirectNPAPIRequests isn't specified, then plugin requests get routed
- // through the renderer and and this holds the pid of the plugin process.
- // Otherwise this holds the render_process_id of the view that has the plugin.
- IPC_STRUCT_MEMBER(int, origin_pid)
-
- // What this resource load is for (main frame, sub-frame, sub-resource,
- // object).
- IPC_STRUCT_MEMBER(content::ResourceType, resource_type)
-
- // The priority of this request.
- IPC_STRUCT_MEMBER(net::RequestPriority, priority)
-
- // Used by plugin->browser requests to get the correct net::URLRequestContext.
- IPC_STRUCT_MEMBER(uint32_t, request_context)
-
- // Indicates which frame (or worker context) the request is being loaded into,
- // or kAppCacheNoHostId.
- IPC_STRUCT_MEMBER(int, appcache_host_id)
-
- // True if corresponding AppCache group should be resetted.
- IPC_STRUCT_MEMBER(bool, should_reset_appcache)
-
- // Indicates which frame (or worker context) the request is being loaded into,
- // or kInvalidServiceWorkerProviderId.
- IPC_STRUCT_MEMBER(int, service_worker_provider_id)
-
- // True if the request originated from a Service Worker, e.g. due to a
- // fetch() in the Service Worker script.
- IPC_STRUCT_MEMBER(bool, originated_from_service_worker)
-
- // True if the request should not be handled by the ServiceWorker.
- IPC_STRUCT_MEMBER(bool, skip_service_worker)
-
- // The request mode passed to the ServiceWorker.
- IPC_STRUCT_MEMBER(content::FetchRequestMode, fetch_request_mode)
-
- // The credentials mode passed to the ServiceWorker.
- IPC_STRUCT_MEMBER(content::FetchCredentialsMode, fetch_credentials_mode)
-
- // The redirect mode used in Fetch API.
- IPC_STRUCT_MEMBER(content::FetchRedirectMode, fetch_redirect_mode)
-
- // The request context passed to the ServiceWorker.
- IPC_STRUCT_MEMBER(content::RequestContextType, fetch_request_context_type)
-
- // The frame type passed to the ServiceWorker.
- IPC_STRUCT_MEMBER(content::RequestContextFrameType, fetch_frame_type)
-
- // Optional resource request body (may be null).
- IPC_STRUCT_MEMBER(scoped_refptr<content::ResourceRequestBody>,
- request_body)
-
- IPC_STRUCT_MEMBER(bool, download_to_file)
-
- // True if the request was user initiated.
- IPC_STRUCT_MEMBER(bool, has_user_gesture)
-
- // True if load timing data should be collected for request.
- IPC_STRUCT_MEMBER(bool, enable_load_timing)
-
- // True if upload progress should be available for request.
- IPC_STRUCT_MEMBER(bool, enable_upload_progress)
-
- // True if login prompts for this request should be supressed.
- IPC_STRUCT_MEMBER(bool, do_not_prompt_for_login)
-
- // The routing id of the RenderFrame.
- IPC_STRUCT_MEMBER(int, render_frame_id)
-
- // True if |frame_id| is the main frame of a RenderView.
- IPC_STRUCT_MEMBER(bool, is_main_frame)
-
- // True if |parent_render_frame_id| is the main frame of a RenderView.
- IPC_STRUCT_MEMBER(bool, parent_is_main_frame)
-
- // Identifies the parent frame of the frame that sent the request.
- // -1 if unknown / invalid.
- IPC_STRUCT_MEMBER(int, parent_render_frame_id)
-
- IPC_STRUCT_MEMBER(ui::PageTransition, transition_type)
-
- // For navigations, whether this navigation should replace the current session
- // history entry on commit.
- IPC_STRUCT_MEMBER(bool, should_replace_current_entry)
-
- // The following two members identify a previous request that has been
- // created before this navigation has been transferred to a new render view.
- // This serves the purpose of recycling the old request.
- // Unless this refers to a transferred navigation, these values are -1 and -1.
- IPC_STRUCT_MEMBER(int, transferred_request_child_id)
- IPC_STRUCT_MEMBER(int, transferred_request_request_id)
-
- // Whether or not we should allow the URL to download.
- IPC_STRUCT_MEMBER(bool, allow_download)
-
- // Whether to intercept headers to pass back to the renderer.
- IPC_STRUCT_MEMBER(bool, report_raw_headers)
-
- // Whether or not to request a LoFi version of the resource or let the browser
- // decide.
- IPC_STRUCT_MEMBER(content::LoFiState, lofi_state)
-
- // PlzNavigate: the stream url associated with a navigation. Used to get
- // access to the body of the response that has already been fetched by the
- // browser.
- IPC_STRUCT_MEMBER(GURL, resource_body_stream_url)
-IPC_STRUCT_END()
+IPC_STRUCT_TRAITS_BEGIN(content::ResourceRequest)
+ IPC_STRUCT_TRAITS_MEMBER(method)
+ IPC_STRUCT_TRAITS_MEMBER(url)
+ IPC_STRUCT_TRAITS_MEMBER(first_party_for_cookies)
+ IPC_STRUCT_TRAITS_MEMBER(request_initiator)
+ IPC_STRUCT_TRAITS_MEMBER(referrer)
+ IPC_STRUCT_TRAITS_MEMBER(referrer_policy)
+ IPC_STRUCT_TRAITS_MEMBER(visiblity_state)
+ IPC_STRUCT_TRAITS_MEMBER(headers)
+ IPC_STRUCT_TRAITS_MEMBER(load_flags)
+ IPC_STRUCT_TRAITS_MEMBER(origin_pid)
+ IPC_STRUCT_TRAITS_MEMBER(resource_type)
+ IPC_STRUCT_TRAITS_MEMBER(priority)
+ IPC_STRUCT_TRAITS_MEMBER(request_context)
+ IPC_STRUCT_TRAITS_MEMBER(appcache_host_id)
+ IPC_STRUCT_TRAITS_MEMBER(should_reset_appcache)
+ IPC_STRUCT_TRAITS_MEMBER(service_worker_provider_id)
+ IPC_STRUCT_TRAITS_MEMBER(originated_from_service_worker)
+ IPC_STRUCT_TRAITS_MEMBER(skip_service_worker)
+ IPC_STRUCT_TRAITS_MEMBER(fetch_request_mode)
+ IPC_STRUCT_TRAITS_MEMBER(fetch_credentials_mode)
+ IPC_STRUCT_TRAITS_MEMBER(fetch_redirect_mode)
+ IPC_STRUCT_TRAITS_MEMBER(fetch_request_context_type)
+ IPC_STRUCT_TRAITS_MEMBER(fetch_frame_type)
+ IPC_STRUCT_TRAITS_MEMBER(request_body)
+ IPC_STRUCT_TRAITS_MEMBER(download_to_file)
+ IPC_STRUCT_TRAITS_MEMBER(has_user_gesture)
+ IPC_STRUCT_TRAITS_MEMBER(enable_load_timing)
+ IPC_STRUCT_TRAITS_MEMBER(enable_upload_progress)
+ IPC_STRUCT_TRAITS_MEMBER(do_not_prompt_for_login)
+ IPC_STRUCT_TRAITS_MEMBER(render_frame_id)
+ IPC_STRUCT_TRAITS_MEMBER(is_main_frame)
+ IPC_STRUCT_TRAITS_MEMBER(parent_is_main_frame)
+ IPC_STRUCT_TRAITS_MEMBER(parent_render_frame_id)
+ IPC_STRUCT_TRAITS_MEMBER(transition_type)
+ IPC_STRUCT_TRAITS_MEMBER(should_replace_current_entry)
+ IPC_STRUCT_TRAITS_MEMBER(transferred_request_child_id)
+ IPC_STRUCT_TRAITS_MEMBER(transferred_request_request_id)
+ IPC_STRUCT_TRAITS_MEMBER(allow_download)
+ IPC_STRUCT_TRAITS_MEMBER(report_raw_headers)
+ IPC_STRUCT_TRAITS_MEMBER(lofi_state)
+ IPC_STRUCT_TRAITS_MEMBER(resource_body_stream_url)
+IPC_STRUCT_TRAITS_END()
// Parameters for a ResourceMsg_RequestComplete
-IPC_STRUCT_BEGIN(ResourceMsg_RequestCompleteData)
- // The error code.
- IPC_STRUCT_MEMBER(int, error_code)
-
- // Was ignored by the request handler.
- IPC_STRUCT_MEMBER(bool, was_ignored_by_handler)
-
- // A copy of the data requested exists in the cache.
- IPC_STRUCT_MEMBER(bool, exists_in_cache)
-
- // Serialized security info; see content/common/ssl_status_serialization.h.
- IPC_STRUCT_MEMBER(std::string, security_info)
-
- // Time the request completed.
- IPC_STRUCT_MEMBER(base::TimeTicks, completion_time)
-
- // Total amount of data received from the network.
- IPC_STRUCT_MEMBER(int64_t, encoded_data_length)
-IPC_STRUCT_END()
+IPC_STRUCT_TRAITS_BEGIN(content::ResourceRequestCompletionStatus)
+ IPC_STRUCT_TRAITS_MEMBER(error_code)
+ IPC_STRUCT_TRAITS_MEMBER(was_ignored_by_handler)
+ IPC_STRUCT_TRAITS_MEMBER(exists_in_cache)
+ IPC_STRUCT_TRAITS_MEMBER(security_info)
+ IPC_STRUCT_TRAITS_MEMBER(completion_time)
+ IPC_STRUCT_TRAITS_MEMBER(encoded_data_length)
+IPC_STRUCT_TRAITS_END()
// Resource messages sent from the browser to the renderer.
@@ -432,15 +323,15 @@ IPC_MESSAGE_CONTROL3(ResourceMsg_DataDownloaded,
// Sent when the request has been completed.
IPC_MESSAGE_CONTROL2(ResourceMsg_RequestComplete,
int /* request_id */,
- ResourceMsg_RequestCompleteData)
+ content::ResourceRequestCompletionStatus)
// Resource messages sent from the renderer to the browser.
// Makes a resource request via the browser.
IPC_MESSAGE_CONTROL3(ResourceHostMsg_RequestResource,
- int /* routing_id */,
- int /* request_id */,
- ResourceHostMsg_Request)
+ int /* routing_id */,
+ int /* request_id */,
+ content::ResourceRequest)
// Cancels a resource request with the ID given as the parameter.
IPC_MESSAGE_CONTROL1(ResourceHostMsg_CancelRequest,
@@ -454,7 +345,7 @@ IPC_MESSAGE_CONTROL1(ResourceHostMsg_FollowRedirect,
// Makes a synchronous resource request via the browser.
IPC_SYNC_MESSAGE_ROUTED2_1(ResourceHostMsg_SyncLoad,
int /* request_id */,
- ResourceHostMsg_Request,
+ content::ResourceRequest,
content::SyncLoadResult)
// Sent when the renderer process is done processing a DataReceived
« no previous file with comments | « content/child/resource_dispatcher_unittest.cc ('k') | content/common/resource_request.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698