| 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 #ifndef PPAPI_PROXY_SERIALIZED_STRUCTS_H_ | 5 #ifndef PPAPI_PROXY_SERIALIZED_STRUCTS_H_ |
| 6 #define PPAPI_PROXY_SERIALIZED_STRUCTS_H_ | 6 #define PPAPI_PROXY_SERIALIZED_STRUCTS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 | 74 |
| 75 struct PPBURLLoader_UpdateProgress_Params { | 75 struct PPBURLLoader_UpdateProgress_Params { |
| 76 PP_Instance instance; | 76 PP_Instance instance; |
| 77 ppapi::HostResource resource; | 77 ppapi::HostResource resource; |
| 78 int64_t bytes_sent; | 78 int64_t bytes_sent; |
| 79 int64_t total_bytes_to_be_sent; | 79 int64_t total_bytes_to_be_sent; |
| 80 int64_t bytes_received; | 80 int64_t bytes_received; |
| 81 int64_t total_bytes_to_be_received; | 81 int64_t total_bytes_to_be_received; |
| 82 }; | 82 }; |
| 83 | 83 |
| 84 struct PPPVideoCapture_Buffer { | |
| 85 ppapi::HostResource resource; | |
| 86 uint32_t size; | |
| 87 base::SharedMemoryHandle handle; | |
| 88 }; | |
| 89 | |
| 90 // We put all our handles in a unified structure to make it easy to translate | 84 // We put all our handles in a unified structure to make it easy to translate |
| 91 // them in NaClIPCAdapter for use in NaCl. | 85 // them in NaClIPCAdapter for use in NaCl. |
| 92 class PPAPI_PROXY_EXPORT SerializedHandle { | 86 class PPAPI_PROXY_EXPORT SerializedHandle { |
| 93 public: | 87 public: |
| 94 enum Type { INVALID, SHARED_MEMORY, SOCKET, CHANNEL_HANDLE }; | 88 enum Type { INVALID, SHARED_MEMORY, SOCKET, CHANNEL_HANDLE }; |
| 95 struct Header { | 89 struct Header { |
| 96 Header() : type(INVALID), size(0) {} | 90 Header() : type(INVALID), size(0) {} |
| 97 Header(Type type_arg, uint32_t size_arg) | 91 Header(Type type_arg, uint32_t size_arg) |
| 98 : type(type_arg), size(size_arg) { | 92 : type(type_arg), size(size_arg) { |
| 99 } | 93 } |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 // we add more complex things later, we should come up with a more memory- | 173 // we add more complex things later, we should come up with a more memory- |
| 180 // efficient strategy. | 174 // efficient strategy. |
| 181 // These are valid if type == SHARED_MEMORY. | 175 // These are valid if type == SHARED_MEMORY. |
| 182 base::SharedMemoryHandle shm_handle_; | 176 base::SharedMemoryHandle shm_handle_; |
| 183 uint32_t size_; | 177 uint32_t size_; |
| 184 | 178 |
| 185 // This is valid if type == SOCKET || type == CHANNEL_HANDLE. | 179 // This is valid if type == SOCKET || type == CHANNEL_HANDLE. |
| 186 IPC::PlatformFileForTransit descriptor_; | 180 IPC::PlatformFileForTransit descriptor_; |
| 187 }; | 181 }; |
| 188 | 182 |
| 189 // TODO(tomfinegan): This is identical to PPPVideoCapture_Buffer, maybe replace | |
| 190 // both with a single type? | |
| 191 struct PPPDecryptor_Buffer { | 183 struct PPPDecryptor_Buffer { |
| 192 ppapi::HostResource resource; | 184 ppapi::HostResource resource; |
| 193 uint32_t size; | 185 uint32_t size; |
| 194 base::SharedMemoryHandle handle; | 186 base::SharedMemoryHandle handle; |
| 195 }; | 187 }; |
| 196 | 188 |
| 197 #if defined(OS_WIN) | 189 #if defined(OS_WIN) |
| 198 typedef HANDLE ImageHandle; | 190 typedef HANDLE ImageHandle; |
| 199 #elif defined(OS_MACOSX) || defined(OS_ANDROID) | 191 #elif defined(OS_MACOSX) || defined(OS_ANDROID) |
| 200 typedef base::SharedMemoryHandle ImageHandle; | 192 typedef base::SharedMemoryHandle ImageHandle; |
| 201 #else | 193 #else |
| 202 // On X Windows this is a SysV shared memory key. | 194 // On X Windows this is a SysV shared memory key. |
| 203 typedef int ImageHandle; | 195 typedef int ImageHandle; |
| 204 #endif | 196 #endif |
| 205 | 197 |
| 206 } // namespace proxy | 198 } // namespace proxy |
| 207 } // namespace ppapi | 199 } // namespace ppapi |
| 208 | 200 |
| 209 #endif // PPAPI_PROXY_SERIALIZED_STRUCTS_H_ | 201 #endif // PPAPI_PROXY_SERIALIZED_STRUCTS_H_ |
| OLD | NEW |