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 PPB_FileRef_CreateInfo; | 36 struct FileRefCreateInfo; |
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. | |
59 virtual PP_Resource CreateFileRef( | 52 virtual PP_Resource CreateFileRef( |
60 const PPB_FileRef_CreateInfo& serialized) = 0; | 53 PP_Instance instance, |
| 54 const FileRefCreateInfo& serialized) = 0; |
61 virtual PP_Resource CreateFileSystem(PP_Instance instance, | 55 virtual PP_Resource CreateFileSystem(PP_Instance instance, |
62 PP_FileSystemType type) = 0; | 56 PP_FileSystemType type) = 0; |
63 virtual PP_Resource CreateIMEInputEvent(PP_Instance instance, | 57 virtual PP_Resource CreateIMEInputEvent(PP_Instance instance, |
64 PP_InputEvent_Type type, | 58 PP_InputEvent_Type type, |
65 PP_TimeTicks time_stamp, | 59 PP_TimeTicks time_stamp, |
66 struct PP_Var text, | 60 struct PP_Var text, |
67 uint32_t segment_number, | 61 uint32_t segment_number, |
68 const uint32_t* segment_offsets, | 62 const uint32_t* segment_offsets, |
69 int32_t target_segment, | 63 int32_t target_segment, |
70 uint32_t selection_start, | 64 uint32_t selection_start, |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 PP_VideoDecoder_Profile profile) = 0; | 183 PP_VideoDecoder_Profile profile) = 0; |
190 #endif // !defined(OS_NACL) | 184 #endif // !defined(OS_NACL) |
191 | 185 |
192 static const ApiID kApiID = API_ID_RESOURCE_CREATION; | 186 static const ApiID kApiID = API_ID_RESOURCE_CREATION; |
193 }; | 187 }; |
194 | 188 |
195 } // namespace thunk | 189 } // namespace thunk |
196 } // namespace ppapi | 190 } // namespace ppapi |
197 | 191 |
198 #endif // PPAPI_THUNK_RESOURCE_CREATION_API_H_ | 192 #endif // PPAPI_THUNK_RESOURCE_CREATION_API_H_ |
OLD | NEW |