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 11 matching lines...) Expand all Loading... |
22 #include "ppapi/c/private/ppb_network_monitor_private.h" | 22 #include "ppapi/c/private/ppb_network_monitor_private.h" |
23 #include "ppapi/shared_impl/api_id.h" | 23 #include "ppapi/shared_impl/api_id.h" |
24 | 24 |
25 struct PP_Flash_Menu; | 25 struct PP_Flash_Menu; |
26 struct PP_FontDescription_Dev; | 26 struct PP_FontDescription_Dev; |
27 struct PP_BrowserFont_Trusted_Description; | 27 struct PP_BrowserFont_Trusted_Description; |
28 struct PP_Size; | 28 struct PP_Size; |
29 | 29 |
30 namespace ppapi { | 30 namespace ppapi { |
31 | 31 |
| 32 struct PPB_FileRef_CreateInfo; |
32 struct URLRequestInfoData; | 33 struct URLRequestInfoData; |
33 struct URLResponseInfoData; | 34 struct URLResponseInfoData; |
34 | 35 |
35 namespace thunk { | 36 namespace thunk { |
36 | 37 |
37 // A functional API for creating resource types. Separating out the creation | 38 // A functional API for creating resource types. Separating out the creation |
38 // functions here allows us to implement most resources as a pure "resource | 39 // 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 | 40 // 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 | 41 // creation functions are not per-object (since there's no object during |
41 // creation) so need functional routing based on the instance ID. | 42 // creation) so need functional routing based on the instance ID. |
42 class ResourceCreationAPI { | 43 class ResourceCreationAPI { |
43 public: | 44 public: |
44 virtual ~ResourceCreationAPI() {} | 45 virtual ~ResourceCreationAPI() {} |
45 | 46 |
46 virtual PP_Resource CreateFileIO(PP_Instance instance) = 0; | 47 virtual PP_Resource CreateFileIO(PP_Instance instance) = 0; |
47 virtual PP_Resource CreateFileRef(PP_Instance instance, | 48 virtual PP_Resource CreateFileRef(PP_Instance instance, |
48 PP_Resource file_system, | 49 PP_Resource file_system, |
49 const char* path) = 0; | 50 const char* path) = 0; |
| 51 // Like the above version but takes a serialized file ref. The resource |
| 52 // in the serialized file ref is passed into this, which takes ownership of |
| 53 // the reference. In the proxy, the return value will be a plugin resource. |
| 54 // In the impl, the return value will be the same resource ID. |
| 55 virtual PP_Resource CreateFileRef( |
| 56 const PPB_FileRef_CreateInfo& serialized) = 0; |
50 virtual PP_Resource CreateFileSystem(PP_Instance instance, | 57 virtual PP_Resource CreateFileSystem(PP_Instance instance, |
51 PP_FileSystemType type) = 0; | 58 PP_FileSystemType type) = 0; |
52 virtual PP_Resource CreateIsolatedFileSystem(PP_Instance instance, | 59 virtual PP_Resource CreateIsolatedFileSystem(PP_Instance instance, |
53 const char* fsid) = 0; | 60 const char* fsid) = 0; |
54 virtual PP_Resource CreateIMEInputEvent(PP_Instance instance, | 61 virtual PP_Resource CreateIMEInputEvent(PP_Instance instance, |
55 PP_InputEvent_Type type, | 62 PP_InputEvent_Type type, |
56 PP_TimeTicks time_stamp, | 63 PP_TimeTicks time_stamp, |
57 struct PP_Var text, | 64 struct PP_Var text, |
58 uint32_t segment_number, | 65 uint32_t segment_number, |
59 const uint32_t* segment_offsets, | 66 const uint32_t* segment_offsets, |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 virtual PP_Resource CreateVideoSource(PP_Instance instance) = 0; | 180 virtual PP_Resource CreateVideoSource(PP_Instance instance) = 0; |
174 #endif // !defined(OS_NACL) | 181 #endif // !defined(OS_NACL) |
175 | 182 |
176 static const ApiID kApiID = API_ID_RESOURCE_CREATION; | 183 static const ApiID kApiID = API_ID_RESOURCE_CREATION; |
177 }; | 184 }; |
178 | 185 |
179 } // namespace thunk | 186 } // namespace thunk |
180 } // namespace ppapi | 187 } // namespace ppapi |
181 | 188 |
182 #endif // PPAPI_THUNK_RESOURCE_CREATION_API_H_ | 189 #endif // PPAPI_THUNK_RESOURCE_CREATION_API_H_ |
OLD | NEW |