OLD | NEW |
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 HTML5 Blob and Stream. | 5 // IPC messages for HTML5 Blob and Stream. |
6 // Multiply-included message file, hence no include guard. | 6 // Multiply-included message file, hence no include guard. |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
| 10 #include <set> |
| 11 |
| 12 #include "base/memory/shared_memory.h" |
10 #include "content/common/content_export.h" | 13 #include "content/common/content_export.h" |
11 #include "ipc/ipc_message_macros.h" | 14 #include "ipc/ipc_message_macros.h" |
| 15 #include "ipc/ipc_message_utils.h" |
| 16 #include "ipc/ipc_param_traits.h" |
| 17 #include "ipc/ipc_platform_file.h" |
| 18 #include "storage/common/blob_storage/blob_item_bytes_request.h" |
| 19 #include "storage/common/blob_storage/blob_item_bytes_response.h" |
| 20 #include "storage/common/blob_storage/blob_storage_constants.h" |
12 #include "storage/common/data_element.h" | 21 #include "storage/common/data_element.h" |
13 #include "url/ipc/url_param_traits.h" | 22 #include "url/ipc/url_param_traits.h" |
14 | 23 |
15 #undef IPC_MESSAGE_EXPORT | 24 #undef IPC_MESSAGE_EXPORT |
16 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT | 25 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT |
17 #define IPC_MESSAGE_START BlobMsgStart | 26 #define IPC_MESSAGE_START BlobMsgStart |
18 | 27 |
19 // Blob messages sent from the renderer to the browser. | 28 // Trait definitions for async blob transport messages. |
20 | 29 |
21 IPC_MESSAGE_CONTROL1(BlobHostMsg_StartBuilding, | 30 IPC_ENUM_TRAITS_MAX_VALUE(storage::IPCBlobItemRequestStrategy, |
22 std::string /*uuid */) | 31 storage::IPCBlobItemRequestStrategy::LAST) |
23 IPC_MESSAGE_CONTROL2(BlobHostMsg_AppendBlobDataItem, | 32 IPC_ENUM_TRAITS_MAX_VALUE(storage::IPCBlobCreationCancelCode, |
| 33 storage::IPCBlobCreationCancelCode::LAST) |
| 34 |
| 35 IPC_STRUCT_TRAITS_BEGIN(storage::BlobItemBytesRequest) |
| 36 IPC_STRUCT_TRAITS_MEMBER(request_number) |
| 37 IPC_STRUCT_TRAITS_MEMBER(transport_strategy) |
| 38 IPC_STRUCT_TRAITS_MEMBER(renderer_item_index) |
| 39 IPC_STRUCT_TRAITS_MEMBER(renderer_item_offset) |
| 40 IPC_STRUCT_TRAITS_MEMBER(size) |
| 41 IPC_STRUCT_TRAITS_MEMBER(handle_index) |
| 42 IPC_STRUCT_TRAITS_MEMBER(handle_offset) |
| 43 IPC_STRUCT_TRAITS_END() |
| 44 |
| 45 IPC_STRUCT_TRAITS_BEGIN(storage::BlobItemBytesResponse) |
| 46 IPC_STRUCT_TRAITS_MEMBER(request_number) |
| 47 IPC_STRUCT_TRAITS_MEMBER(inline_data) |
| 48 IPC_STRUCT_TRAITS_MEMBER(time_file_modified) |
| 49 IPC_STRUCT_TRAITS_END() |
| 50 |
| 51 // This message is to tell the browser that we will be building a blob. |
| 52 IPC_MESSAGE_CONTROL4(BlobStorageMsg_RegisterBlobUUID, |
24 std::string /* uuid */, | 53 std::string /* uuid */, |
25 storage::DataElement) | 54 std::string /* content_type */, |
26 IPC_SYNC_MESSAGE_CONTROL3_0(BlobHostMsg_SyncAppendSharedMemory, | 55 std::string /* content_disposition */, |
27 std::string /*uuid*/, | 56 std::set<std::string> /* referenced_blob_uuids */); |
28 base::SharedMemoryHandle, | 57 |
29 uint32_t /* buffer size */) | 58 // The DataElements are used to: |
30 IPC_MESSAGE_CONTROL2(BlobHostMsg_FinishBuilding, | 59 // * describe & transport non-memory resources (blobs, files, etc) |
| 60 // * describe the size of memory items |
| 61 // * 'shortcut' transport the memory up to the IPC limit so the browser can use |
| 62 // it if it's not currently full. |
| 63 // See https://bit.ly/BlobStorageRefactor |
| 64 IPC_MESSAGE_CONTROL2(BlobStorageMsg_StartBuildingBlob, |
31 std::string /* uuid */, | 65 std::string /* uuid */, |
32 std::string /* content_type */) | 66 std::vector<storage::DataElement> /* item_descriptions */); |
| 67 |
| 68 IPC_MESSAGE_CONTROL4( |
| 69 BlobStorageMsg_RequestMemoryItem, |
| 70 std::string /* uuid */, |
| 71 std::vector<storage::BlobItemBytesRequest> /* requests */, |
| 72 std::vector<base::SharedMemoryHandle> /* memory_handles */, |
| 73 std::vector<IPC::PlatformFileForTransit> /* file_handles */); |
| 74 |
| 75 IPC_MESSAGE_CONTROL2( |
| 76 BlobStorageMsg_MemoryItemResponse, |
| 77 std::string /* uuid */, |
| 78 std::vector<storage::BlobItemBytesResponse> /* responses */); |
| 79 |
| 80 IPC_MESSAGE_CONTROL2(BlobStorageMsg_CancelBuildingBlob, |
| 81 std::string /* uuid */, |
| 82 storage::IPCBlobCreationCancelCode /* code */); |
| 83 |
| 84 IPC_MESSAGE_CONTROL1(BlobStorageMsg_DoneBuildingBlob, std::string /* uuid */); |
33 | 85 |
34 IPC_MESSAGE_CONTROL1(BlobHostMsg_IncrementRefCount, | 86 IPC_MESSAGE_CONTROL1(BlobHostMsg_IncrementRefCount, |
35 std::string /* uuid */) | 87 std::string /* uuid */) |
36 IPC_MESSAGE_CONTROL1(BlobHostMsg_DecrementRefCount, | 88 IPC_MESSAGE_CONTROL1(BlobHostMsg_DecrementRefCount, |
37 std::string /* uuid */) | 89 std::string /* uuid */) |
38 IPC_MESSAGE_CONTROL2(BlobHostMsg_RegisterPublicURL, | 90 IPC_MESSAGE_CONTROL2(BlobHostMsg_RegisterPublicURL, |
39 GURL, | 91 GURL, |
40 std::string /* uuid */) | 92 std::string /* uuid */) |
41 IPC_MESSAGE_CONTROL1(BlobHostMsg_RevokePublicURL, | 93 IPC_MESSAGE_CONTROL1(BlobHostMsg_RevokePublicURL, |
42 GURL) | 94 GURL) |
(...skipping 29 matching lines...) Expand all Loading... |
72 GURL /* url */) | 124 GURL /* url */) |
73 | 125 |
74 // Creates a new stream that's a clone of an existing src stream. | 126 // Creates a new stream that's a clone of an existing src stream. |
75 IPC_MESSAGE_CONTROL2(StreamHostMsg_Clone, | 127 IPC_MESSAGE_CONTROL2(StreamHostMsg_Clone, |
76 GURL /* url */, | 128 GURL /* url */, |
77 GURL /* src_url */) | 129 GURL /* src_url */) |
78 | 130 |
79 // Removes a stream. | 131 // Removes a stream. |
80 IPC_MESSAGE_CONTROL1(StreamHostMsg_Remove, | 132 IPC_MESSAGE_CONTROL1(StreamHostMsg_Remove, |
81 GURL /* url */) | 133 GURL /* url */) |
OLD | NEW |