[email protected] | b9fd01ba | 2012-02-28 01:50:40 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
[email protected] | 94dc971d | 2011-03-05 19:08:32 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | // IPC messages for resource loading. |
[email protected] | a17df45d | 2013-02-15 11:12:46 | [diff] [blame] | 6 | // |
| 7 | // NOTE: All messages must send an |int request_id| as their first parameter. |
[email protected] | 94dc971d | 2011-03-05 19:08:32 | [diff] [blame] | 8 | |
[email protected] | e503a12 | 2011-03-17 18:20:52 | [diff] [blame] | 9 | // Multiply-included message file, hence no include guard. |
[email protected] | 9cc992b | 2013-07-17 06:30:36 | [diff] [blame] | 10 | #include "base/memory/shared_memory.h" |
[email protected] | 71ed8e02 | 2013-07-25 14:39:57 | [diff] [blame] | 11 | #include "base/process/process.h" |
[email protected] | 9d8ea30 | 2012-09-25 15:04:22 | [diff] [blame] | 12 | #include "content/common/content_param_traits_macros.h" |
[email protected] | 14f154a | 2014-03-11 16:24:41 | [diff] [blame] | 13 | #include "content/common/resource_request_body.h" |
horo | 7e40ec7 | 2014-09-30 09:23:46 | [diff] [blame] | 14 | #include "content/common/service_worker/service_worker_types.h" |
[email protected] | 19a5c744 | 2011-10-21 20:00:41 | [diff] [blame] | 15 | #include "content/public/common/common_param_traits.h" |
[email protected] | 2336ffe | 2011-11-24 01:23:34 | [diff] [blame] | 16 | #include "content/public/common/resource_response.h" |
[email protected] | 94dc971d | 2011-03-05 19:08:32 | [diff] [blame] | 17 | #include "ipc/ipc_message_macros.h" |
[email protected] | a9344092d | 2013-02-27 00:56:45 | [diff] [blame] | 18 | #include "net/base/request_priority.h" |
[email protected] | 92a98df9 | 2013-06-06 02:47:42 | [diff] [blame] | 19 | #include "net/http/http_response_info.h" |
[email protected] | cba2464 | 2014-08-15 20:49:59 | [diff] [blame] | 20 | #include "net/url_request/redirect_info.h" |
[email protected] | 94dc971d | 2011-03-05 19:08:32 | [diff] [blame] | 21 | |
[email protected] | 9d8ea30 | 2012-09-25 15:04:22 | [diff] [blame] | 22 | #ifndef CONTENT_COMMON_RESOURCE_MESSAGES_H_ |
| 23 | #define CONTENT_COMMON_RESOURCE_MESSAGES_H_ |
| 24 | |
[email protected] | ec29880 | 2013-03-27 16:45:07 | [diff] [blame] | 25 | namespace net { |
| 26 | struct LoadTimingInfo; |
| 27 | } |
| 28 | |
[email protected] | 48ffdf7 | 2014-05-31 02:16:57 | [diff] [blame] | 29 | namespace content { |
[email protected] | 9d8ea30 | 2012-09-25 15:04:22 | [diff] [blame] | 30 | struct ResourceDevToolsInfo; |
[email protected] | 9d8ea30 | 2012-09-25 15:04:22 | [diff] [blame] | 31 | } |
| 32 | |
| 33 | namespace IPC { |
| 34 | |
| 35 | template <> |
| 36 | struct ParamTraits<scoped_refptr<net::HttpResponseHeaders> > { |
| 37 | typedef scoped_refptr<net::HttpResponseHeaders> param_type; |
| 38 | static void Write(Message* m, const param_type& p); |
| 39 | static bool Read(const Message* m, PickleIterator* iter, param_type* r); |
| 40 | static void Log(const param_type& p, std::string* l); |
| 41 | }; |
| 42 | |
| 43 | template <> |
[email protected] | cd501a7 | 2014-08-22 19:58:31 | [diff] [blame] | 44 | struct CONTENT_EXPORT ParamTraits<storage::DataElement> { |
| 45 | typedef storage::DataElement param_type; |
[email protected] | 9d8ea30 | 2012-09-25 15:04:22 | [diff] [blame] | 46 | static void Write(Message* m, const param_type& p); |
| 47 | static bool Read(const Message* m, PickleIterator* iter, param_type* r); |
| 48 | static void Log(const param_type& p, std::string* l); |
| 49 | }; |
| 50 | |
| 51 | template <> |
[email protected] | 48ffdf7 | 2014-05-31 02:16:57 | [diff] [blame] | 52 | struct ParamTraits<scoped_refptr<content::ResourceDevToolsInfo> > { |
| 53 | typedef scoped_refptr<content::ResourceDevToolsInfo> param_type; |
[email protected] | 9d8ea30 | 2012-09-25 15:04:22 | [diff] [blame] | 54 | static void Write(Message* m, const param_type& p); |
| 55 | static bool Read(const Message* m, PickleIterator* iter, param_type* r); |
| 56 | static void Log(const param_type& p, std::string* l); |
| 57 | }; |
| 58 | |
| 59 | template <> |
[email protected] | ec29880 | 2013-03-27 16:45:07 | [diff] [blame] | 60 | struct ParamTraits<net::LoadTimingInfo> { |
| 61 | typedef net::LoadTimingInfo param_type; |
[email protected] | 9d8ea30 | 2012-09-25 15:04:22 | [diff] [blame] | 62 | static void Write(Message* m, const param_type& p); |
| 63 | static bool Read(const Message* m, PickleIterator* iter, param_type* r); |
| 64 | static void Log(const param_type& p, std::string* l); |
| 65 | }; |
| 66 | |
| 67 | template <> |
[email protected] | 14f154a | 2014-03-11 16:24:41 | [diff] [blame] | 68 | struct ParamTraits<scoped_refptr<content::ResourceRequestBody> > { |
| 69 | typedef scoped_refptr<content::ResourceRequestBody> param_type; |
[email protected] | 9d8ea30 | 2012-09-25 15:04:22 | [diff] [blame] | 70 | static void Write(Message* m, const param_type& p); |
| 71 | static bool Read(const Message* m, PickleIterator* iter, param_type* r); |
| 72 | static void Log(const param_type& p, std::string* l); |
| 73 | }; |
| 74 | |
| 75 | } // namespace IPC |
| 76 | |
| 77 | #endif // CONTENT_COMMON_RESOURCE_MESSAGES_H_ |
| 78 | |
| 79 | |
[email protected] | 94dc971d | 2011-03-05 19:08:32 | [diff] [blame] | 80 | #define IPC_MESSAGE_START ResourceMsgStart |
[email protected] | 03ff5e5 | 2011-09-30 00:28:14 | [diff] [blame] | 81 | #undef IPC_MESSAGE_EXPORT |
| 82 | #define IPC_MESSAGE_EXPORT CONTENT_EXPORT |
[email protected] | 94dc971d | 2011-03-05 19:08:32 | [diff] [blame] | 83 | |
[email protected] | 92a98df9 | 2013-06-06 02:47:42 | [diff] [blame] | 84 | IPC_ENUM_TRAITS_MAX_VALUE( \ |
| 85 | net::HttpResponseInfo::ConnectionInfo, \ |
| 86 | net::HttpResponseInfo::NUM_OF_CONNECTION_INFOS - 1) |
| 87 | |
horo | 7e40ec7 | 2014-09-30 09:23:46 | [diff] [blame] | 88 | IPC_ENUM_TRAITS_MAX_VALUE(content::FetchRequestMode, |
| 89 | content::FETCH_REQUEST_MODE_LAST) |
| 90 | |
horo | 89252e8 | 2014-10-02 12:03:43 | [diff] [blame] | 91 | IPC_ENUM_TRAITS_MAX_VALUE(content::FetchCredentialsMode, |
| 92 | content::FETCH_CREDENTIALS_MODE_LAST) |
| 93 | |
[email protected] | 2336ffe | 2011-11-24 01:23:34 | [diff] [blame] | 94 | IPC_STRUCT_TRAITS_BEGIN(content::ResourceResponseHead) |
[email protected] | 0bf419d1 | 2014-05-28 01:02:23 | [diff] [blame] | 95 | IPC_STRUCT_TRAITS_PARENT(content::ResourceResponseInfo) |
[email protected] | d43d2e11 | 2012-08-07 01:10:19 | [diff] [blame] | 96 | IPC_STRUCT_TRAITS_MEMBER(request_start) |
| 97 | IPC_STRUCT_TRAITS_MEMBER(response_start) |
[email protected] | 2336ffe | 2011-11-24 01:23:34 | [diff] [blame] | 98 | IPC_STRUCT_TRAITS_END() |
| 99 | |
| 100 | IPC_STRUCT_TRAITS_BEGIN(content::SyncLoadResult) |
| 101 | IPC_STRUCT_TRAITS_PARENT(content::ResourceResponseHead) |
davidben | 015fd32 | 2014-09-03 23:31:33 | [diff] [blame] | 102 | IPC_STRUCT_TRAITS_MEMBER(error_code) |
[email protected] | 2336ffe | 2011-11-24 01:23:34 | [diff] [blame] | 103 | IPC_STRUCT_TRAITS_MEMBER(final_url) |
| 104 | IPC_STRUCT_TRAITS_MEMBER(data) |
| 105 | IPC_STRUCT_TRAITS_END() |
| 106 | |
[email protected] | 0bf419d1 | 2014-05-28 01:02:23 | [diff] [blame] | 107 | IPC_STRUCT_TRAITS_BEGIN(content::ResourceResponseInfo) |
[email protected] | 94dc971d | 2011-03-05 19:08:32 | [diff] [blame] | 108 | IPC_STRUCT_TRAITS_MEMBER(request_time) |
| 109 | IPC_STRUCT_TRAITS_MEMBER(response_time) |
| 110 | IPC_STRUCT_TRAITS_MEMBER(headers) |
| 111 | IPC_STRUCT_TRAITS_MEMBER(mime_type) |
| 112 | IPC_STRUCT_TRAITS_MEMBER(charset) |
| 113 | IPC_STRUCT_TRAITS_MEMBER(security_info) |
| 114 | IPC_STRUCT_TRAITS_MEMBER(content_length) |
[email protected] | dfd68217 | 2011-04-13 19:57:25 | [diff] [blame] | 115 | IPC_STRUCT_TRAITS_MEMBER(encoded_data_length) |
[email protected] | 94dc971d | 2011-03-05 19:08:32 | [diff] [blame] | 116 | IPC_STRUCT_TRAITS_MEMBER(appcache_id) |
| 117 | IPC_STRUCT_TRAITS_MEMBER(appcache_manifest_url) |
[email protected] | 94dc971d | 2011-03-05 19:08:32 | [diff] [blame] | 118 | IPC_STRUCT_TRAITS_MEMBER(load_timing) |
| 119 | IPC_STRUCT_TRAITS_MEMBER(devtools_info) |
| 120 | IPC_STRUCT_TRAITS_MEMBER(download_file_path) |
| 121 | IPC_STRUCT_TRAITS_MEMBER(was_fetched_via_spdy) |
| 122 | IPC_STRUCT_TRAITS_MEMBER(was_npn_negotiated) |
| 123 | IPC_STRUCT_TRAITS_MEMBER(was_alternate_protocol_available) |
[email protected] | 92a98df9 | 2013-06-06 02:47:42 | [diff] [blame] | 124 | IPC_STRUCT_TRAITS_MEMBER(connection_info) |
[email protected] | 94dc971d | 2011-03-05 19:08:32 | [diff] [blame] | 125 | IPC_STRUCT_TRAITS_MEMBER(was_fetched_via_proxy) |
[email protected] | b9fd01ba | 2012-02-28 01:50:40 | [diff] [blame] | 126 | IPC_STRUCT_TRAITS_MEMBER(npn_negotiated_protocol) |
[email protected] | 94dc971d | 2011-03-05 19:08:32 | [diff] [blame] | 127 | IPC_STRUCT_TRAITS_MEMBER(socket_address) |
[email protected] | 6ee72da1 | 2014-07-22 04:39:10 | [diff] [blame] | 128 | IPC_STRUCT_TRAITS_MEMBER(was_fetched_via_service_worker) |
horo | 0032057 | 2014-10-01 07:56:28 | [diff] [blame] | 129 | IPC_STRUCT_TRAITS_MEMBER(was_fallback_required_by_service_worker) |
[email protected] | 6ee72da1 | 2014-07-22 04:39:10 | [diff] [blame] | 130 | IPC_STRUCT_TRAITS_MEMBER(original_url_via_service_worker) |
horo | 1eac3a7 | 2014-10-21 03:37:20 | [diff] [blame] | 131 | IPC_STRUCT_TRAITS_MEMBER(response_type_via_service_worker) |
shimazu | 403d2d9 | 2014-09-19 01:25:16 | [diff] [blame] | 132 | IPC_STRUCT_TRAITS_MEMBER(service_worker_fetch_start) |
| 133 | IPC_STRUCT_TRAITS_MEMBER(service_worker_fetch_ready) |
| 134 | IPC_STRUCT_TRAITS_MEMBER(service_worker_fetch_end) |
jeremyim | bdcd2a7 | 2014-10-31 16:38:04 | [diff] [blame] | 135 | IPC_STRUCT_TRAITS_MEMBER(proxy_server) |
[email protected] | 94dc971d | 2011-03-05 19:08:32 | [diff] [blame] | 136 | IPC_STRUCT_TRAITS_END() |
| 137 | |
[email protected] | cba2464 | 2014-08-15 20:49:59 | [diff] [blame] | 138 | IPC_STRUCT_TRAITS_BEGIN(net::RedirectInfo) |
| 139 | IPC_STRUCT_TRAITS_MEMBER(status_code) |
| 140 | IPC_STRUCT_TRAITS_MEMBER(new_method) |
| 141 | IPC_STRUCT_TRAITS_MEMBER(new_url) |
| 142 | IPC_STRUCT_TRAITS_MEMBER(new_first_party_for_cookies) |
| 143 | IPC_STRUCT_TRAITS_MEMBER(new_referrer) |
| 144 | IPC_STRUCT_TRAITS_END() |
| 145 | |
[email protected] | 94dc971d | 2011-03-05 19:08:32 | [diff] [blame] | 146 | // Parameters for a resource request. |
| 147 | IPC_STRUCT_BEGIN(ResourceHostMsg_Request) |
| 148 | // The request method: GET, POST, etc. |
| 149 | IPC_STRUCT_MEMBER(std::string, method) |
| 150 | |
| 151 | // The requested URL. |
| 152 | IPC_STRUCT_MEMBER(GURL, url) |
| 153 | |
| 154 | // Usually the URL of the document in the top-level window, which may be |
| 155 | // checked by the third-party cookie blocking policy. Leaving it empty may |
| 156 | // lead to undesired cookie blocking. Third-party cookie blocking can be |
| 157 | // bypassed by setting first_party_for_cookies = url, but this should ideally |
| 158 | // only be done if there really is no way to determine the correct value. |
| 159 | IPC_STRUCT_MEMBER(GURL, first_party_for_cookies) |
| 160 | |
| 161 | // The referrer to use (may be empty). |
| 162 | IPC_STRUCT_MEMBER(GURL, referrer) |
| 163 | |
[email protected] | d5a5034 | 2011-12-05 21:56:52 | [diff] [blame] | 164 | // The referrer policy to use. |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 165 | IPC_STRUCT_MEMBER(blink::WebReferrerPolicy, referrer_policy) |
[email protected] | d5a5034 | 2011-12-05 21:56:52 | [diff] [blame] | 166 | |
[email protected] | 48ed261 | 2014-01-21 00:30:57 | [diff] [blame] | 167 | // The frame's visiblity state. |
| 168 | IPC_STRUCT_MEMBER(blink::WebPageVisibilityState, visiblity_state) |
| 169 | |
[email protected] | 94dc971d | 2011-03-05 19:08:32 | [diff] [blame] | 170 | // Additional HTTP request headers. |
| 171 | IPC_STRUCT_MEMBER(std::string, headers) |
| 172 | |
| 173 | // net::URLRequest load flags (0 by default). |
| 174 | IPC_STRUCT_MEMBER(int, load_flags) |
| 175 | |
| 176 | // Process ID from which this request originated, or zero if it originated |
| 177 | // in the renderer itself. |
[email protected] | 01cb1991 | 2013-09-11 19:13:03 | [diff] [blame] | 178 | // If kDirectNPAPIRequests isn't specified, then plugin requests get routed |
| 179 | // through the renderer and and this holds the pid of the plugin process. |
| 180 | // Otherwise this holds the render_process_id of the view that has the plugin. |
[email protected] | 94dc971d | 2011-03-05 19:08:32 | [diff] [blame] | 181 | IPC_STRUCT_MEMBER(int, origin_pid) |
| 182 | |
| 183 | // What this resource load is for (main frame, sub-frame, sub-resource, |
| 184 | // object). |
[email protected] | 6c1e0521 | 2014-07-31 00:59:40 | [diff] [blame] | 185 | IPC_STRUCT_MEMBER(content::ResourceType, resource_type) |
[email protected] | 94dc971d | 2011-03-05 19:08:32 | [diff] [blame] | 186 | |
[email protected] | 102ab68 | 2013-02-05 19:45:32 | [diff] [blame] | 187 | // The priority of this request. |
[email protected] | a9344092d | 2013-02-27 00:56:45 | [diff] [blame] | 188 | IPC_STRUCT_MEMBER(net::RequestPriority, priority) |
[email protected] | 102ab68 | 2013-02-05 19:45:32 | [diff] [blame] | 189 | |
[email protected] | 94dc971d | 2011-03-05 19:08:32 | [diff] [blame] | 190 | // Used by plugin->browser requests to get the correct net::URLRequestContext. |
| 191 | IPC_STRUCT_MEMBER(uint32, request_context) |
| 192 | |
| 193 | // Indicates which frame (or worker context) the request is being loaded into, |
[email protected] | 10f110fa | 2014-06-15 23:32:46 | [diff] [blame] | 194 | // or kAppCacheNoHostId. |
[email protected] | 94dc971d | 2011-03-05 19:08:32 | [diff] [blame] | 195 | IPC_STRUCT_MEMBER(int, appcache_host_id) |
| 196 | |
eustas | 2787684 | 2014-11-27 10:48:00 | [diff] [blame] | 197 | // True if corresponding AppCache group should be resetted. |
| 198 | IPC_STRUCT_MEMBER(bool, should_reset_appcache) |
| 199 | |
[email protected] | c4c091f | 2014-03-07 13:06:13 | [diff] [blame] | 200 | // Indicates which frame (or worker context) the request is being loaded into, |
| 201 | // or kInvalidServiceWorkerProviderId. |
| 202 | IPC_STRUCT_MEMBER(int, service_worker_provider_id) |
| 203 | |
horo | 258fc423 | 2014-09-05 10:15:31 | [diff] [blame] | 204 | // True if the request should not be handled by the ServiceWorker. |
| 205 | IPC_STRUCT_MEMBER(bool, skip_service_worker) |
| 206 | |
horo | 7e40ec7 | 2014-09-30 09:23:46 | [diff] [blame] | 207 | // The request mode passed to the ServiceWorker. |
| 208 | IPC_STRUCT_MEMBER(content::FetchRequestMode, fetch_request_mode) |
| 209 | |
horo | 89252e8 | 2014-10-02 12:03:43 | [diff] [blame] | 210 | // The credentials mode passed to the ServiceWorker. |
| 211 | IPC_STRUCT_MEMBER(content::FetchCredentialsMode, fetch_credentials_mode) |
| 212 | |
horo | e392d34 | 2014-10-03 06:23:23 | [diff] [blame] | 213 | // The request context passed to the ServiceWorker. |
| 214 | IPC_STRUCT_MEMBER(content::RequestContextType, fetch_request_context_type) |
| 215 | |
| 216 | // The frame type passed to the ServiceWorker. |
| 217 | IPC_STRUCT_MEMBER(content::RequestContextFrameType, fetch_frame_type) |
| 218 | |
[email protected] | e3e402c | 2012-08-21 13:57:42 | [diff] [blame] | 219 | // Optional resource request body (may be null). |
[email protected] | 14f154a | 2014-03-11 16:24:41 | [diff] [blame] | 220 | IPC_STRUCT_MEMBER(scoped_refptr<content::ResourceRequestBody>, |
[email protected] | e3e402c | 2012-08-21 13:57:42 | [diff] [blame] | 221 | request_body) |
[email protected] | 94dc971d | 2011-03-05 19:08:32 | [diff] [blame] | 222 | |
| 223 | IPC_STRUCT_MEMBER(bool, download_to_file) |
| 224 | |
| 225 | // True if the request was user initiated. |
| 226 | IPC_STRUCT_MEMBER(bool, has_user_gesture) |
[email protected] | 418da61 | 2011-07-21 19:01:52 | [diff] [blame] | 227 | |
[email protected] | 3821f7a | 2014-08-13 16:40:08 | [diff] [blame] | 228 | // True if load timing data should be collected for request. |
| 229 | IPC_STRUCT_MEMBER(bool, enable_load_timing) |
| 230 | |
ljagielski | 6615c1c | 2014-10-29 15:49:30 | [diff] [blame] | 231 | // True if upload progress should be available for request. |
| 232 | IPC_STRUCT_MEMBER(bool, enable_upload_progress) |
| 233 | |
[email protected] | 60eca4eb | 2013-12-06 00:02:16 | [diff] [blame] | 234 | // The routing id of the RenderFrame. |
| 235 | IPC_STRUCT_MEMBER(int, render_frame_id) |
| 236 | |
[email protected] | 418da61 | 2011-07-21 19:01:52 | [diff] [blame] | 237 | // True if |frame_id| is the main frame of a RenderView. |
| 238 | IPC_STRUCT_MEMBER(bool, is_main_frame) |
| 239 | |
[email protected] | 79a7028 | 2014-03-03 21:29:35 | [diff] [blame] | 240 | // True if |parent_render_frame_id| is the main frame of a RenderView. |
[email protected] | 91043a823 | 2011-11-04 16:41:19 | [diff] [blame] | 241 | IPC_STRUCT_MEMBER(bool, parent_is_main_frame) |
| 242 | |
| 243 | // Identifies the parent frame of the frame that sent the request. |
| 244 | // -1 if unknown / invalid. |
[email protected] | 79a7028 | 2014-03-03 21:29:35 | [diff] [blame] | 245 | IPC_STRUCT_MEMBER(int, parent_render_frame_id) |
[email protected] | 91043a823 | 2011-11-04 16:41:19 | [diff] [blame] | 246 | |
Sylvain Defresne | c6ccc77d | 2014-09-19 10:19:35 | [diff] [blame] | 247 | IPC_STRUCT_MEMBER(ui::PageTransition, transition_type) |
[email protected] | 4ad5d77d | 2011-12-03 02:00:48 | [diff] [blame] | 248 | |
[email protected] | 4972fc8 | 2013-11-19 04:33:42 | [diff] [blame] | 249 | // For navigations, whether this navigation should replace the current session |
| 250 | // history entry on commit. |
| 251 | IPC_STRUCT_MEMBER(bool, should_replace_current_entry) |
| 252 | |
[email protected] | 4ad5d77d | 2011-12-03 02:00:48 | [diff] [blame] | 253 | // The following two members identify a previous request that has been |
| 254 | // created before this navigation has been transferred to a new render view. |
| 255 | // This serves the purpose of recycling the old request. |
| 256 | // Unless this refers to a transferred navigation, these values are -1 and -1. |
| 257 | IPC_STRUCT_MEMBER(int, transferred_request_child_id) |
| 258 | IPC_STRUCT_MEMBER(int, transferred_request_request_id) |
[email protected] | 8074478 | 2012-05-04 01:47:00 | [diff] [blame] | 259 | |
| 260 | // Whether or not we should allow the URL to download. |
| 261 | IPC_STRUCT_MEMBER(bool, allow_download) |
[email protected] | 94dc971d | 2011-03-05 19:08:32 | [diff] [blame] | 262 | IPC_STRUCT_END() |
| 263 | |
[email protected] | dcbe3df | 2014-02-06 23:08:37 | [diff] [blame] | 264 | // Parameters for a ResourceMsg_RequestComplete |
| 265 | IPC_STRUCT_BEGIN(ResourceMsg_RequestCompleteData) |
| 266 | // The error code. |
| 267 | IPC_STRUCT_MEMBER(int, error_code) |
| 268 | |
| 269 | // Was ignored by the request handler. |
| 270 | IPC_STRUCT_MEMBER(bool, was_ignored_by_handler) |
| 271 | |
| 272 | // A copy of the data requested exists in the cache. |
| 273 | IPC_STRUCT_MEMBER(bool, exists_in_cache) |
| 274 | |
| 275 | // Serialized security info; see content/common/ssl_status_serialization.h. |
| 276 | IPC_STRUCT_MEMBER(std::string, security_info) |
| 277 | |
| 278 | // Time the request completed. |
| 279 | IPC_STRUCT_MEMBER(base::TimeTicks, completion_time) |
[email protected] | c8c56758 | 2014-02-10 12:54:57 | [diff] [blame] | 280 | |
| 281 | // Total amount of data received from the network. |
| 282 | IPC_STRUCT_MEMBER(int64, encoded_data_length) |
[email protected] | dcbe3df | 2014-02-06 23:08:37 | [diff] [blame] | 283 | IPC_STRUCT_END() |
| 284 | |
[email protected] | 94dc971d | 2011-03-05 19:08:32 | [diff] [blame] | 285 | // Resource messages sent from the browser to the renderer. |
| 286 | |
| 287 | // Sent when the headers are available for a resource request. |
[email protected] | f465319 | 2013-09-06 19:24:05 | [diff] [blame] | 288 | IPC_MESSAGE_CONTROL2(ResourceMsg_ReceivedResponse, |
| 289 | int /* request_id */, |
| 290 | content::ResourceResponseHead) |
[email protected] | 94dc971d | 2011-03-05 19:08:32 | [diff] [blame] | 291 | |
| 292 | // Sent when cached metadata from a resource request is ready. |
[email protected] | f465319 | 2013-09-06 19:24:05 | [diff] [blame] | 293 | IPC_MESSAGE_CONTROL2(ResourceMsg_ReceivedCachedMetadata, |
| 294 | int /* request_id */, |
| 295 | std::vector<char> /* data */) |
[email protected] | 94dc971d | 2011-03-05 19:08:32 | [diff] [blame] | 296 | |
| 297 | // Sent as upload progress is being made. |
[email protected] | f465319 | 2013-09-06 19:24:05 | [diff] [blame] | 298 | IPC_MESSAGE_CONTROL3(ResourceMsg_UploadProgress, |
| 299 | int /* request_id */, |
| 300 | int64 /* position */, |
| 301 | int64 /* size */) |
[email protected] | 94dc971d | 2011-03-05 19:08:32 | [diff] [blame] | 302 | |
| 303 | // Sent when the request has been redirected. The receiver is expected to |
| 304 | // respond with either a FollowRedirect message (if the redirect is to be |
| 305 | // followed) or a CancelRequest message (if it should not be followed). |
[email protected] | cba2464 | 2014-08-15 20:49:59 | [diff] [blame] | 306 | IPC_MESSAGE_CONTROL3(ResourceMsg_ReceivedRedirect, |
[email protected] | f465319 | 2013-09-06 19:24:05 | [diff] [blame] | 307 | int /* request_id */, |
[email protected] | cba2464 | 2014-08-15 20:49:59 | [diff] [blame] | 308 | net::RedirectInfo /* redirect_info */, |
[email protected] | f465319 | 2013-09-06 19:24:05 | [diff] [blame] | 309 | content::ResourceResponseHead) |
[email protected] | 94dc971d | 2011-03-05 19:08:32 | [diff] [blame] | 310 | |
[email protected] | f0fa1ab | 2012-09-18 06:28:38 | [diff] [blame] | 311 | // Sent to set the shared memory buffer to be used to transmit response data to |
| 312 | // the renderer. Subsequent DataReceived messages refer to byte ranges in the |
| 313 | // shared memory buffer. The shared memory buffer should be retained by the |
| 314 | // renderer until the resource request completes. |
| 315 | // |
| 316 | // NOTE: The shared memory handle should already be mapped into the process |
| 317 | // that receives this message. |
| 318 | // |
[email protected] | 9d9387e | 2013-01-12 16:55:08 | [diff] [blame] | 319 | // TODO(darin): The |renderer_pid| parameter is just a temporary parameter, |
| 320 | // added to help in debugging crbug/160401. |
| 321 | // |
[email protected] | f465319 | 2013-09-06 19:24:05 | [diff] [blame] | 322 | IPC_MESSAGE_CONTROL4(ResourceMsg_SetDataBuffer, |
| 323 | int /* request_id */, |
| 324 | base::SharedMemoryHandle /* shm_handle */, |
| 325 | int /* shm_size */, |
| 326 | base::ProcessId /* renderer_pid */) |
[email protected] | f0fa1ab | 2012-09-18 06:28:38 | [diff] [blame] | 327 | |
| 328 | // Sent when some data from a resource request is ready. The data offset and |
| 329 | // length specify a byte range into the shared memory buffer provided by the |
| 330 | // SetDataBuffer message. |
[email protected] | f465319 | 2013-09-06 19:24:05 | [diff] [blame] | 331 | IPC_MESSAGE_CONTROL4(ResourceMsg_DataReceived, |
| 332 | int /* request_id */, |
| 333 | int /* data_offset */, |
| 334 | int /* data_length */, |
| 335 | int /* encoded_data_length */) |
[email protected] | 94dc971d | 2011-03-05 19:08:32 | [diff] [blame] | 336 | |
| 337 | // Sent when some data from a resource request has been downloaded to |
| 338 | // file. This is only called in the 'download_to_file' case and replaces |
| 339 | // ResourceMsg_DataReceived in the call sequence in that case. |
[email protected] | f465319 | 2013-09-06 19:24:05 | [diff] [blame] | 340 | IPC_MESSAGE_CONTROL3(ResourceMsg_DataDownloaded, |
| 341 | int /* request_id */, |
| 342 | int /* data_len */, |
| 343 | int /* encoded_data_length */) |
[email protected] | 94dc971d | 2011-03-05 19:08:32 | [diff] [blame] | 344 | |
| 345 | // Sent when the request has been completed. |
[email protected] | dcbe3df | 2014-02-06 23:08:37 | [diff] [blame] | 346 | IPC_MESSAGE_CONTROL2(ResourceMsg_RequestComplete, |
[email protected] | f465319 | 2013-09-06 19:24:05 | [diff] [blame] | 347 | int /* request_id */, |
[email protected] | dcbe3df | 2014-02-06 23:08:37 | [diff] [blame] | 348 | ResourceMsg_RequestCompleteData) |
[email protected] | 94dc971d | 2011-03-05 19:08:32 | [diff] [blame] | 349 | |
| 350 | // Resource messages sent from the renderer to the browser. |
| 351 | |
| 352 | // Makes a resource request via the browser. |
[email protected] | 5636d90 | 2014-05-13 23:19:10 | [diff] [blame] | 353 | IPC_MESSAGE_CONTROL3(ResourceHostMsg_RequestResource, |
| 354 | int /* routing_id */, |
[email protected] | 94dc971d | 2011-03-05 19:08:32 | [diff] [blame] | 355 | int /* request_id */, |
| 356 | ResourceHostMsg_Request) |
| 357 | |
| 358 | // Cancels a resource request with the ID given as the parameter. |
[email protected] | f465319 | 2013-09-06 19:24:05 | [diff] [blame] | 359 | IPC_MESSAGE_CONTROL1(ResourceHostMsg_CancelRequest, |
| 360 | int /* request_id */) |
[email protected] | 94dc971d | 2011-03-05 19:08:32 | [diff] [blame] | 361 | |
[email protected] | 94dc971d | 2011-03-05 19:08:32 | [diff] [blame] | 362 | // Follows a redirect that occured for the resource request with the ID given |
| 363 | // as the parameter. |
[email protected] | b97fc38 | 2014-05-14 20:06:34 | [diff] [blame] | 364 | IPC_MESSAGE_CONTROL1(ResourceHostMsg_FollowRedirect, |
| 365 | int /* request_id */) |
[email protected] | 94dc971d | 2011-03-05 19:08:32 | [diff] [blame] | 366 | |
| 367 | // Makes a synchronous resource request via the browser. |
| 368 | IPC_SYNC_MESSAGE_ROUTED2_1(ResourceHostMsg_SyncLoad, |
| 369 | int /* request_id */, |
| 370 | ResourceHostMsg_Request, |
[email protected] | 2336ffe | 2011-11-24 01:23:34 | [diff] [blame] | 371 | content::SyncLoadResult) |
[email protected] | 94dc971d | 2011-03-05 19:08:32 | [diff] [blame] | 372 | |
| 373 | // Sent when the renderer process is done processing a DataReceived |
| 374 | // message. |
[email protected] | f465319 | 2013-09-06 19:24:05 | [diff] [blame] | 375 | IPC_MESSAGE_CONTROL1(ResourceHostMsg_DataReceived_ACK, |
| 376 | int /* request_id */) |
[email protected] | 94dc971d | 2011-03-05 19:08:32 | [diff] [blame] | 377 | |
| 378 | // Sent when the renderer has processed a DataDownloaded message. |
[email protected] | f465319 | 2013-09-06 19:24:05 | [diff] [blame] | 379 | IPC_MESSAGE_CONTROL1(ResourceHostMsg_DataDownloaded_ACK, |
| 380 | int /* request_id */) |
[email protected] | 94dc971d | 2011-03-05 19:08:32 | [diff] [blame] | 381 | |
| 382 | // Sent by the renderer process to acknowledge receipt of a |
| 383 | // UploadProgress message. |
[email protected] | f465319 | 2013-09-06 19:24:05 | [diff] [blame] | 384 | IPC_MESSAGE_CONTROL1(ResourceHostMsg_UploadProgress_ACK, |
| 385 | int /* request_id */) |
[email protected] | 94dc971d | 2011-03-05 19:08:32 | [diff] [blame] | 386 | |
| 387 | // Sent when the renderer process deletes a resource loader. |
| 388 | IPC_MESSAGE_CONTROL1(ResourceHostMsg_ReleaseDownloadedFile, |
| 389 | int /* request_id */) |
[email protected] | a9344092d | 2013-02-27 00:56:45 | [diff] [blame] | 390 | |
| 391 | // Sent by the renderer when a resource request changes priority. |
[email protected] | ed038bf | 2014-04-07 22:02:39 | [diff] [blame] | 392 | IPC_MESSAGE_CONTROL3(ResourceHostMsg_DidChangePriority, |
[email protected] | f465319 | 2013-09-06 19:24:05 | [diff] [blame] | 393 | int /* request_id */, |
[email protected] | ed038bf | 2014-04-07 22:02:39 | [diff] [blame] | 394 | net::RequestPriority, |
| 395 | int /* intra_priority_value */) |