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 CreateIMEInputEvent(PP_Instance instance, | 59 virtual PP_Resource CreateIMEInputEvent(PP_Instance instance, |
53 PP_InputEvent_Type type, | 60 PP_InputEvent_Type type, |
54 PP_TimeTicks time_stamp, | 61 PP_TimeTicks time_stamp, |
55 struct PP_Var text, | 62 struct PP_Var text, |
56 uint32_t segment_number, | 63 uint32_t segment_number, |
57 const uint32_t* segment_offsets, | 64 const uint32_t* segment_offsets, |
58 int32_t target_segment, | 65 int32_t target_segment, |
59 uint32_t selection_start, | 66 uint32_t selection_start, |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 virtual PP_Resource CreateVideoSource(PP_Instance instance) = 0; | 178 virtual PP_Resource CreateVideoSource(PP_Instance instance) = 0; |
172 #endif // !defined(OS_NACL) | 179 #endif // !defined(OS_NACL) |
173 | 180 |
174 static const ApiID kApiID = API_ID_RESOURCE_CREATION; | 181 static const ApiID kApiID = API_ID_RESOURCE_CREATION; |
175 }; | 182 }; |
176 | 183 |
177 } // namespace thunk | 184 } // namespace thunk |
178 } // namespace ppapi | 185 } // namespace ppapi |
179 | 186 |
180 #endif // PPAPI_THUNK_RESOURCE_CREATION_API_H_ | 187 #endif // PPAPI_THUNK_RESOURCE_CREATION_API_H_ |
OLD | NEW |