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