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

Side by Side Diff: ppapi/proxy/serialized_structs.h

Issue 10796064: PPAPI/NaCl: Make nacl_ipc_adapter handle ImageData creation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sketch of idea for extracting handles generally Created 8 years, 5 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
« no previous file with comments | « ppapi/proxy/resource_creation_proxy.cc ('k') | ppapi/thunk/ppb_image_data_api.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 int64_t bytes_received; 102 int64_t bytes_received;
103 int64_t total_bytes_to_be_received; 103 int64_t total_bytes_to_be_received;
104 }; 104 };
105 105
106 struct PPPVideoCapture_Buffer { 106 struct PPPVideoCapture_Buffer {
107 ppapi::HostResource resource; 107 ppapi::HostResource resource;
108 uint32_t size; 108 uint32_t size;
109 base::SharedMemoryHandle handle; 109 base::SharedMemoryHandle handle;
110 }; 110 };
111 111
112 // When we share handles to NaCl, we need to know the size. So they should
113 // always be provided to the plugin in this struct, so the size is always
114 // available.
115 struct SerializedSharedMemoryHandle {
116 base::SharedMemoryHandle handle;
117 uint32_t size;
118 };
119
120 // On Windows, we can't differentiate SharedMemoryHandle from
121 // PlatformFileForTransit, since both are just typedefs to HANDLE. We use this
122 // type so we can differentiate the two, since when passing the handle to NaCl,
123 // we need to know which it is.
124 struct SerializedFileDescriptor {
125 IPC::PlatformFileForTransit descriptor;
126 };
127
112 #if defined(OS_WIN) 128 #if defined(OS_WIN)
113 typedef HANDLE ImageHandle; 129 typedef HANDLE ImageHandle;
114 #elif defined(OS_MACOSX) || defined(OS_ANDROID) 130 #elif defined(OS_MACOSX) || defined(OS_ANDROID)
115 typedef base::SharedMemoryHandle ImageHandle; 131 typedef base::SharedMemoryHandle ImageHandle;
116 #else 132 #else
117 // On X Windows this is a SysV shared memory key. 133 // On X Windows this is a SysV shared memory key.
118 typedef int ImageHandle; 134 typedef int ImageHandle;
119 #endif 135 #endif
120 136
121 } // namespace proxy 137 } // namespace proxy
122 } // namespace ppapi 138 } // namespace ppapi
123 139
124 #endif // PPAPI_PROXY_SERIALIZED_STRUCTS_H_ 140 #endif // PPAPI_PROXY_SERIALIZED_STRUCTS_H_
OLDNEW
« no previous file with comments | « ppapi/proxy/resource_creation_proxy.cc ('k') | ppapi/thunk/ppb_image_data_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698