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