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_THUNK_RESOURCE_CREATION_API_H_ | 5 #ifndef PPAPI_THUNK_RESOURCE_CREATION_API_H_ |
6 #define PPAPI_THUNK_RESOURCE_CREATION_API_H_ | 6 #define PPAPI_THUNK_RESOURCE_CREATION_API_H_ |
7 | 7 |
8 #include "ppapi/c/dev/ppb_file_chooser_dev.h" | 8 #include "ppapi/c/dev/ppb_file_chooser_dev.h" |
9 #include "ppapi/c/pp_bool.h" | 9 #include "ppapi/c/pp_bool.h" |
10 #include "ppapi/c/pp_instance.h" | 10 #include "ppapi/c/pp_instance.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 | 36 |
37 // A functional API for creating resource types. Separating out the creation | 37 // A functional API for creating resource types. Separating out the creation |
38 // functions here allows us to implement most resources as a pure "resource | 38 // functions here allows us to implement most resources as a pure "resource |
39 // API", meaning all calls are routed on a per-resource-object basis. The | 39 // API", meaning all calls are routed on a per-resource-object basis. The |
40 // creation functions are not per-object (since there's no object during | 40 // creation functions are not per-object (since there's no object during |
41 // creation) so need functional routing based on the instance ID. | 41 // creation) so need functional routing based on the instance ID. |
42 class ResourceCreationAPI { | 42 class ResourceCreationAPI { |
43 public: | 43 public: |
44 virtual ~ResourceCreationAPI() {} | 44 virtual ~ResourceCreationAPI() {} |
45 | 45 |
| 46 virtual PP_Resource CreateDirectoryReader(PP_Instance instance, |
| 47 PP_Resource directory_ref) = 0; |
46 virtual PP_Resource CreateFileIO(PP_Instance instance) = 0; | 48 virtual PP_Resource CreateFileIO(PP_Instance instance) = 0; |
47 virtual PP_Resource CreateFileRef(PP_Resource file_system, | 49 virtual PP_Resource CreateFileRef(PP_Resource file_system, |
48 const char* path) = 0; | 50 const char* path) = 0; |
49 virtual PP_Resource CreateFileSystem(PP_Instance instance, | 51 virtual PP_Resource CreateFileSystem(PP_Instance instance, |
50 PP_FileSystemType type) = 0; | 52 PP_FileSystemType type) = 0; |
51 virtual PP_Resource CreateIMEInputEvent(PP_Instance instance, | 53 virtual PP_Resource CreateIMEInputEvent(PP_Instance instance, |
52 PP_InputEvent_Type type, | 54 PP_InputEvent_Type type, |
53 PP_TimeTicks time_stamp, | 55 PP_TimeTicks time_stamp, |
54 struct PP_Var text, | 56 struct PP_Var text, |
55 uint32_t segment_number, | 57 uint32_t segment_number, |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 virtual PP_Resource CreateUDPSocketPrivate(PP_Instance instace) = 0; | 145 virtual PP_Resource CreateUDPSocketPrivate(PP_Instance instace) = 0; |
144 virtual PP_Resource CreateWebSocket(PP_Instance instance) = 0; | 146 virtual PP_Resource CreateWebSocket(PP_Instance instance) = 0; |
145 virtual PP_Resource CreateX509CertificatePrivate(PP_Instance instance) = 0; | 147 virtual PP_Resource CreateX509CertificatePrivate(PP_Instance instance) = 0; |
146 #if !defined(OS_NACL) | 148 #if !defined(OS_NACL) |
147 virtual PP_Resource CreateAudioInput(PP_Instance instance) = 0; | 149 virtual PP_Resource CreateAudioInput(PP_Instance instance) = 0; |
148 virtual PP_Resource CreateBroker(PP_Instance instance) = 0; | 150 virtual PP_Resource CreateBroker(PP_Instance instance) = 0; |
149 virtual PP_Resource CreateBrowserFont( | 151 virtual PP_Resource CreateBrowserFont( |
150 PP_Instance instance, | 152 PP_Instance instance, |
151 const PP_BrowserFont_Trusted_Description* description) = 0; | 153 const PP_BrowserFont_Trusted_Description* description) = 0; |
152 virtual PP_Resource CreateBuffer(PP_Instance instance, uint32_t size) = 0; | 154 virtual PP_Resource CreateBuffer(PP_Instance instance, uint32_t size) = 0; |
153 virtual PP_Resource CreateDirectoryReader( | |
154 PP_Instance instance, | |
155 PP_Resource directory_ref) = 0; | |
156 virtual PP_Resource CreateFlashDeviceID(PP_Instance instance) = 0; | 155 virtual PP_Resource CreateFlashDeviceID(PP_Instance instance) = 0; |
157 virtual PP_Resource CreateFlashFontFile( | 156 virtual PP_Resource CreateFlashFontFile( |
158 PP_Instance instance, | 157 PP_Instance instance, |
159 const PP_BrowserFont_Trusted_Description* description, | 158 const PP_BrowserFont_Trusted_Description* description, |
160 PP_PrivateFontCharset charset) = 0; | 159 PP_PrivateFontCharset charset) = 0; |
161 virtual PP_Resource CreateFlashMenu(PP_Instance instance, | 160 virtual PP_Resource CreateFlashMenu(PP_Instance instance, |
162 const PP_Flash_Menu* menu_data) = 0; | 161 const PP_Flash_Menu* menu_data) = 0; |
163 virtual PP_Resource CreateFlashMessageLoop(PP_Instance instance) = 0; | 162 virtual PP_Resource CreateFlashMessageLoop(PP_Instance instance) = 0; |
164 virtual PP_Resource CreateScrollbar(PP_Instance instance, | 163 virtual PP_Resource CreateScrollbar(PP_Instance instance, |
165 PP_Bool vertical) = 0; | 164 PP_Bool vertical) = 0; |
166 virtual PP_Resource CreateTalk(PP_Instance instance) = 0; | 165 virtual PP_Resource CreateTalk(PP_Instance instance) = 0; |
167 virtual PP_Resource CreateVideoCapture(PP_Instance instance) = 0; | 166 virtual PP_Resource CreateVideoCapture(PP_Instance instance) = 0; |
168 virtual PP_Resource CreateVideoDecoder( | 167 virtual PP_Resource CreateVideoDecoder( |
169 PP_Instance instance, | 168 PP_Instance instance, |
170 PP_Resource context3d_id, | 169 PP_Resource context3d_id, |
171 PP_VideoDecoder_Profile profile) = 0; | 170 PP_VideoDecoder_Profile profile) = 0; |
172 #endif // !defined(OS_NACL) | 171 #endif // !defined(OS_NACL) |
173 | 172 |
174 static const ApiID kApiID = API_ID_RESOURCE_CREATION; | 173 static const ApiID kApiID = API_ID_RESOURCE_CREATION; |
175 }; | 174 }; |
176 | 175 |
177 } // namespace thunk | 176 } // namespace thunk |
178 } // namespace ppapi | 177 } // namespace ppapi |
179 | 178 |
180 #endif // PPAPI_THUNK_RESOURCE_CREATION_API_H_ | 179 #endif // PPAPI_THUNK_RESOURCE_CREATION_API_H_ |
OLD | NEW |