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

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

Issue 23583039: Convert a bunch of resource IPCs to be control messages. They didn't need to be routed. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 3 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 | Annotate | Revision Log
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 #include "base/memory/shared_memory.h" 10 #include "base/memory/shared_memory.h"
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 IPC_STRUCT_MEMBER(int, transferred_request_child_id) 196 IPC_STRUCT_MEMBER(int, transferred_request_child_id)
197 IPC_STRUCT_MEMBER(int, transferred_request_request_id) 197 IPC_STRUCT_MEMBER(int, transferred_request_request_id)
198 198
199 // Whether or not we should allow the URL to download. 199 // Whether or not we should allow the URL to download.
200 IPC_STRUCT_MEMBER(bool, allow_download) 200 IPC_STRUCT_MEMBER(bool, allow_download)
201 IPC_STRUCT_END() 201 IPC_STRUCT_END()
202 202
203 // Resource messages sent from the browser to the renderer. 203 // Resource messages sent from the browser to the renderer.
204 204
205 // Sent when the headers are available for a resource request. 205 // Sent when the headers are available for a resource request.
206 IPC_MESSAGE_ROUTED2(ResourceMsg_ReceivedResponse, 206 IPC_MESSAGE_CONTROL2(ResourceMsg_ReceivedResponse,
207 int /* request_id */, 207 int /* request_id */,
208 content::ResourceResponseHead) 208 content::ResourceResponseHead)
209 209
210 // Sent when cached metadata from a resource request is ready. 210 // Sent when cached metadata from a resource request is ready.
211 IPC_MESSAGE_ROUTED2(ResourceMsg_ReceivedCachedMetadata, 211 IPC_MESSAGE_CONTROL2(ResourceMsg_ReceivedCachedMetadata,
212 int /* request_id */, 212 int /* request_id */,
213 std::vector<char> /* data */) 213 std::vector<char> /* data */)
214 214
215 // Sent as upload progress is being made. 215 // Sent as upload progress is being made.
216 IPC_MESSAGE_ROUTED3(ResourceMsg_UploadProgress, 216 IPC_MESSAGE_CONTROL3(ResourceMsg_UploadProgress,
217 int /* request_id */, 217 int /* request_id */,
218 int64 /* position */, 218 int64 /* position */,
219 int64 /* size */) 219 int64 /* size */)
220 220
221 // Sent when the request has been redirected. The receiver is expected to 221 // Sent when the request has been redirected. The receiver is expected to
222 // respond with either a FollowRedirect message (if the redirect is to be 222 // respond with either a FollowRedirect message (if the redirect is to be
223 // followed) or a CancelRequest message (if it should not be followed). 223 // followed) or a CancelRequest message (if it should not be followed).
224 IPC_MESSAGE_ROUTED3(ResourceMsg_ReceivedRedirect, 224 IPC_MESSAGE_CONTROL3(ResourceMsg_ReceivedRedirect,
225 int /* request_id */, 225 int /* request_id */,
226 GURL /* new_url */, 226 GURL /* new_url */,
227 content::ResourceResponseHead) 227 content::ResourceResponseHead)
228 228
229 // Sent to set the shared memory buffer to be used to transmit response data to 229 // Sent to set the shared memory buffer to be used to transmit response data to
230 // the renderer. Subsequent DataReceived messages refer to byte ranges in the 230 // the renderer. Subsequent DataReceived messages refer to byte ranges in the
231 // shared memory buffer. The shared memory buffer should be retained by the 231 // shared memory buffer. The shared memory buffer should be retained by the
232 // renderer until the resource request completes. 232 // renderer until the resource request completes.
233 // 233 //
234 // NOTE: The shared memory handle should already be mapped into the process 234 // NOTE: The shared memory handle should already be mapped into the process
235 // that receives this message. 235 // that receives this message.
236 // 236 //
237 // TODO(darin): The |renderer_pid| parameter is just a temporary parameter, 237 // TODO(darin): The |renderer_pid| parameter is just a temporary parameter,
238 // added to help in debugging crbug/160401. 238 // added to help in debugging crbug/160401.
239 // 239 //
240 IPC_MESSAGE_ROUTED4(ResourceMsg_SetDataBuffer, 240 IPC_MESSAGE_CONTROL4(ResourceMsg_SetDataBuffer,
241 int /* request_id */, 241 int /* request_id */,
242 base::SharedMemoryHandle /* shm_handle */, 242 base::SharedMemoryHandle /* shm_handle */,
243 int /* shm_size */, 243 int /* shm_size */,
244 base::ProcessId /* renderer_pid */) 244 base::ProcessId /* renderer_pid */)
245 245
246 // Sent when some data from a resource request is ready. The data offset and 246 // Sent when some data from a resource request is ready. The data offset and
247 // length specify a byte range into the shared memory buffer provided by the 247 // length specify a byte range into the shared memory buffer provided by the
248 // SetDataBuffer message. 248 // SetDataBuffer message.
249 IPC_MESSAGE_ROUTED4(ResourceMsg_DataReceived, 249 IPC_MESSAGE_CONTROL4(ResourceMsg_DataReceived,
250 int /* request_id */, 250 int /* request_id */,
251 int /* data_offset */, 251 int /* data_offset */,
252 int /* data_length */, 252 int /* data_length */,
253 int /* encoded_data_length */) 253 int /* encoded_data_length */)
254 254
255 // Sent when some data from a resource request has been downloaded to 255 // Sent when some data from a resource request has been downloaded to
256 // file. This is only called in the 'download_to_file' case and replaces 256 // file. This is only called in the 'download_to_file' case and replaces
257 // ResourceMsg_DataReceived in the call sequence in that case. 257 // ResourceMsg_DataReceived in the call sequence in that case.
258 IPC_MESSAGE_ROUTED3(ResourceMsg_DataDownloaded, 258 IPC_MESSAGE_CONTROL3(ResourceMsg_DataDownloaded,
259 int /* request_id */, 259 int /* request_id */,
260 int /* data_len */, 260 int /* data_len */,
261 int /* encoded_data_length */) 261 int /* encoded_data_length */)
262 262
263 // Sent when the request has been completed. 263 // Sent when the request has been completed.
264 IPC_MESSAGE_ROUTED5(ResourceMsg_RequestComplete, 264 IPC_MESSAGE_CONTROL5(ResourceMsg_RequestComplete,
265 int /* request_id */, 265 int /* request_id */,
266 int /* error_code */, 266 int /* error_code */,
267 bool /* was_ignored_by_handler */, 267 bool /* was_ignored_by_handler */,
268 std::string /* security info */, 268 std::string /* security info */,
269 base::TimeTicks /* completion_time */) 269 base::TimeTicks /* completion_time */)
270 270
271 // Resource messages sent from the renderer to the browser. 271 // Resource messages sent from the renderer to the browser.
272 272
273 // Makes a resource request via the browser. 273 // Makes a resource request via the browser.
274 IPC_MESSAGE_ROUTED2(ResourceHostMsg_RequestResource, 274 IPC_MESSAGE_ROUTED2(ResourceHostMsg_RequestResource,
275 int /* request_id */, 275 int /* request_id */,
276 ResourceHostMsg_Request) 276 ResourceHostMsg_Request)
277 277
278 // Cancels a resource request with the ID given as the parameter. 278 // Cancels a resource request with the ID given as the parameter.
279 IPC_MESSAGE_ROUTED1(ResourceHostMsg_CancelRequest, 279 IPC_MESSAGE_CONTROL1(ResourceHostMsg_CancelRequest,
280 int /* request_id */) 280 int /* request_id */)
281 281
282 // Follows a redirect that occured for the resource request with the ID given 282 // Follows a redirect that occured for the resource request with the ID given
283 // as the parameter. 283 // as the parameter.
284 IPC_MESSAGE_ROUTED3(ResourceHostMsg_FollowRedirect, 284 IPC_MESSAGE_CONTROL3(ResourceHostMsg_FollowRedirect,
285 int /* request_id */, 285 int /* request_id */,
286 bool /* has_new_first_party_for_cookies */, 286 bool /* has_new_first_party_for_cookies */,
287 GURL /* new_first_party_for_cookies */) 287 GURL /* new_first_party_for_cookies */)
288 288
289 // Makes a synchronous resource request via the browser. 289 // Makes a synchronous resource request via the browser.
290 IPC_SYNC_MESSAGE_ROUTED2_1(ResourceHostMsg_SyncLoad, 290 IPC_SYNC_MESSAGE_ROUTED2_1(ResourceHostMsg_SyncLoad,
291 int /* request_id */, 291 int /* request_id */,
292 ResourceHostMsg_Request, 292 ResourceHostMsg_Request,
293 content::SyncLoadResult) 293 content::SyncLoadResult)
294 294
295 // Sent when the renderer process is done processing a DataReceived 295 // Sent when the renderer process is done processing a DataReceived
296 // message. 296 // message.
297 IPC_MESSAGE_ROUTED1(ResourceHostMsg_DataReceived_ACK, 297 IPC_MESSAGE_CONTROL1(ResourceHostMsg_DataReceived_ACK,
298 int /* request_id */) 298 int /* request_id */)
299 299
300 // Sent when the renderer has processed a DataDownloaded message. 300 // Sent when the renderer has processed a DataDownloaded message.
301 IPC_MESSAGE_ROUTED1(ResourceHostMsg_DataDownloaded_ACK, 301 IPC_MESSAGE_CONTROL1(ResourceHostMsg_DataDownloaded_ACK,
302 int /* request_id */) 302 int /* request_id */)
303 303
304 // Sent by the renderer process to acknowledge receipt of a 304 // Sent by the renderer process to acknowledge receipt of a
305 // UploadProgress message. 305 // UploadProgress message.
306 IPC_MESSAGE_ROUTED1(ResourceHostMsg_UploadProgress_ACK, 306 IPC_MESSAGE_CONTROL1(ResourceHostMsg_UploadProgress_ACK,
307 int /* request_id */) 307 int /* request_id */)
308 308
309 // Sent when the renderer process deletes a resource loader. 309 // Sent when the renderer process deletes a resource loader.
310 IPC_MESSAGE_CONTROL1(ResourceHostMsg_ReleaseDownloadedFile, 310 IPC_MESSAGE_CONTROL1(ResourceHostMsg_ReleaseDownloadedFile,
311 int /* request_id */) 311 int /* request_id */)
312 312
313 // Sent by the renderer when a resource request changes priority. 313 // Sent by the renderer when a resource request changes priority.
314 IPC_MESSAGE_ROUTED2(ResourceHostMsg_DidChangePriority, 314 IPC_MESSAGE_CONTROL2(ResourceHostMsg_DidChangePriority,
315 int /* request_id */, 315 int /* request_id */,
316 net::RequestPriority) 316 net::RequestPriority)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698