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