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> | 10 #include <set> |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 IPC_STRUCT_TRAITS_MEMBER(time_file_modified) | 47 IPC_STRUCT_TRAITS_MEMBER(time_file_modified) |
48 IPC_STRUCT_TRAITS_END() | 48 IPC_STRUCT_TRAITS_END() |
49 | 49 |
50 // This message is to tell the browser that we will be building a blob. The | 50 // This message is to tell the browser that we will be building a blob. The |
51 // DataElements are used to: | 51 // DataElements are used to: |
52 // * describe & transport non-memory resources (blobs, files, etc) | 52 // * describe & transport non-memory resources (blobs, files, etc) |
53 // * describe the size of memory items | 53 // * describe the size of memory items |
54 // * 'shortcut' transport the memory up to the IPC limit so the browser can use | 54 // * 'shortcut' transport the memory up to the IPC limit so the browser can use |
55 // it if it's not currently full. | 55 // it if it's not currently full. |
56 // See https://bit.ly/BlobStorageRefactor | 56 // See https://bit.ly/BlobStorageRefactor |
57 IPC_MESSAGE_CONTROL4(BlobStorageMsg_RegisterBlob, | 57 // |
58 std::string /* uuid */, | 58 // NOTE: This message is synchronous to ensure that the browser is aware of the |
59 std::string /* content_type */, | 59 // UUID before the UUID is passed to another process. This protects against a |
60 std::string /* content_disposition */, | 60 // race condition in which the browser could be asked about a UUID that doesn't |
61 std::vector<storage::DataElement> /* item_descriptions */) | 61 // yet exist from its perspective. |
| 62 // |
| 63 IPC_SYNC_MESSAGE_CONTROL4_0( |
| 64 BlobStorageMsg_RegisterBlob, |
| 65 std::string /* uuid */, |
| 66 std::string /* content_type */, |
| 67 std::string /* content_disposition */, |
| 68 std::vector<storage::DataElement> /* item_descriptions */) |
62 | 69 |
63 IPC_MESSAGE_CONTROL4( | 70 IPC_MESSAGE_CONTROL4( |
64 BlobStorageMsg_RequestMemoryItem, | 71 BlobStorageMsg_RequestMemoryItem, |
65 std::string /* uuid */, | 72 std::string /* uuid */, |
66 std::vector<storage::BlobItemBytesRequest> /* requests */, | 73 std::vector<storage::BlobItemBytesRequest> /* requests */, |
67 std::vector<base::SharedMemoryHandle> /* memory_handles */, | 74 std::vector<base::SharedMemoryHandle> /* memory_handles */, |
68 std::vector<IPC::PlatformFileForTransit> /* file_handles */) | 75 std::vector<IPC::PlatformFileForTransit> /* file_handles */) |
69 | 76 |
70 IPC_MESSAGE_CONTROL2( | 77 IPC_MESSAGE_CONTROL2( |
71 BlobStorageMsg_MemoryItemResponse, | 78 BlobStorageMsg_MemoryItemResponse, |
72 std::string /* uuid */, | 79 std::string /* uuid */, |
73 std::vector<storage::BlobItemBytesResponse> /* responses */) | 80 std::vector<storage::BlobItemBytesResponse> /* responses */) |
74 | 81 |
75 IPC_MESSAGE_CONTROL2(BlobStorageMsg_SendBlobStatus, | 82 IPC_MESSAGE_CONTROL2(BlobStorageMsg_SendBlobStatus, |
76 std::string /* uuid */, | 83 std::string /* uuid */, |
77 storage::BlobStatus /* code */) | 84 storage::BlobStatus /* code */) |
78 | 85 |
79 IPC_MESSAGE_CONTROL1(BlobHostMsg_IncrementRefCount, | 86 IPC_MESSAGE_CONTROL1(BlobHostMsg_IncrementRefCount, |
80 std::string /* uuid */) | 87 std::string /* uuid */) |
81 IPC_MESSAGE_CONTROL1(BlobHostMsg_DecrementRefCount, | 88 IPC_MESSAGE_CONTROL1(BlobHostMsg_DecrementRefCount, |
82 std::string /* uuid */) | 89 std::string /* uuid */) |
83 IPC_MESSAGE_CONTROL2(BlobHostMsg_RegisterPublicURL, | 90 // NOTE: This message is synchronous to ensure that the browser is aware of the |
84 GURL, | 91 // URL before the URL is passed to another process. This protects against a |
85 std::string /* uuid */) | 92 // race condition in which the browser could be asked to load an URL that |
| 93 // doesn't yet exist from its perspective. |
| 94 IPC_SYNC_MESSAGE_CONTROL2_0(BlobHostMsg_RegisterPublicURL, |
| 95 GURL, |
| 96 std::string /* uuid */) |
86 IPC_MESSAGE_CONTROL1(BlobHostMsg_RevokePublicURL, | 97 IPC_MESSAGE_CONTROL1(BlobHostMsg_RevokePublicURL, |
87 GURL) | 98 GURL) |
88 | 99 |
89 // Stream messages sent from the renderer to the browser. | 100 // Stream messages sent from the renderer to the browser. |
90 | 101 |
91 // Registers a stream as being built. | 102 // Registers a stream as being built. |
92 IPC_MESSAGE_CONTROL2(StreamHostMsg_StartBuilding, | 103 // |
93 GURL /* url */, | 104 // NOTE: This message is synchronous to ensure that the browser is aware of the |
94 std::string /* content_type */) | 105 // URL before the URL is passed to another process. This protects against a |
| 106 // race condition in which the browser could be asked to load an URL that |
| 107 // doesn't yet exist from its perspective. |
| 108 // |
| 109 IPC_SYNC_MESSAGE_CONTROL2_0(StreamHostMsg_StartBuilding, |
| 110 GURL /* url */, |
| 111 std::string /* content_type */) |
95 | 112 |
96 // Appends data to a stream being built. | 113 // Appends data to a stream being built. |
97 IPC_MESSAGE_CONTROL2(StreamHostMsg_AppendBlobDataItem, | 114 IPC_MESSAGE_CONTROL2(StreamHostMsg_AppendBlobDataItem, |
98 GURL /* url */, | 115 GURL /* url */, |
99 storage::DataElement) | 116 storage::DataElement) |
100 | 117 |
101 // Appends data to a stream being built. | 118 // Appends data to a stream being built. |
102 IPC_SYNC_MESSAGE_CONTROL3_0(StreamHostMsg_SyncAppendSharedMemory, | 119 IPC_SYNC_MESSAGE_CONTROL3_0(StreamHostMsg_SyncAppendSharedMemory, |
103 GURL /* url */, | 120 GURL /* url */, |
104 base::SharedMemoryHandle, | 121 base::SharedMemoryHandle, |
105 uint32_t /* buffer size */) | 122 uint32_t /* buffer size */) |
106 | 123 |
107 // Flushes contents buffered in the stream. | 124 // Flushes contents buffered in the stream. |
108 IPC_MESSAGE_CONTROL1(StreamHostMsg_Flush, | 125 IPC_MESSAGE_CONTROL1(StreamHostMsg_Flush, |
109 GURL /* url */) | 126 GURL /* url */) |
110 | 127 |
111 // Finishes building a stream. | 128 // Finishes building a stream. |
112 IPC_MESSAGE_CONTROL1(StreamHostMsg_FinishBuilding, | 129 IPC_MESSAGE_CONTROL1(StreamHostMsg_FinishBuilding, |
113 GURL /* url */) | 130 GURL /* url */) |
114 | 131 |
115 // Aborts building a stream. | 132 // Aborts building a stream. |
116 IPC_MESSAGE_CONTROL1(StreamHostMsg_AbortBuilding, | 133 IPC_MESSAGE_CONTROL1(StreamHostMsg_AbortBuilding, |
117 GURL /* url */) | 134 GURL /* url */) |
118 | 135 |
119 // Creates a new stream that's a clone of an existing src stream. | 136 // Creates a new stream that's a clone of an existing src stream. |
120 IPC_MESSAGE_CONTROL2(StreamHostMsg_Clone, | 137 // |
121 GURL /* url */, | 138 // NOTE: This message is synchronous to ensure that the browser is aware of the |
122 GURL /* src_url */) | 139 // URL before the URL is passed to another process. This protects against a |
| 140 // race condition in which the browser could be asked to load an URL that |
| 141 // doesn't yet exist from its perspective. |
| 142 // |
| 143 IPC_SYNC_MESSAGE_CONTROL2_0(StreamHostMsg_Clone, |
| 144 GURL /* url */, |
| 145 GURL /* src_url */) |
123 | 146 |
124 // Removes a stream. | 147 // Removes a stream. |
125 IPC_MESSAGE_CONTROL1(StreamHostMsg_Remove, | 148 IPC_MESSAGE_CONTROL1(StreamHostMsg_Remove, |
126 GURL /* url */) | 149 GURL /* url */) |
OLD | NEW |