| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_PROXY_RESOURCE_CREATION_PROXY_H_ | 5 #ifndef MOJO_EXAMPLES_PEPPER_CONTAINER_APP_RESOURCE_CREATION_IMPL_H_ |
| 6 #define PPAPI_PROXY_RESOURCE_CREATION_PROXY_H_ | 6 #define MOJO_EXAMPLES_PEPPER_CONTAINER_APP_RESOURCE_CREATION_IMPL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include "base/compiler_specific.h" |
| 9 | 9 #include "base/macros.h" |
| 10 #include "base/basictypes.h" | 10 #include "build/build_config.h" |
| 11 #include "ipc/ipc_channel.h" | |
| 12 #include "ppapi/c/pp_bool.h" | |
| 13 #include "ppapi/c/pp_instance.h" | |
| 14 #include "ppapi/proxy/interface_proxy.h" | |
| 15 #include "ppapi/proxy/serialized_structs.h" | |
| 16 #include "ppapi/thunk/resource_creation_api.h" | 11 #include "ppapi/thunk/resource_creation_api.h" |
| 17 | 12 |
| 18 struct PP_Size; | 13 namespace mojo { |
| 14 namespace examples { |
| 19 | 15 |
| 20 namespace ppapi { | 16 class ResourceCreationImpl : public ppapi::thunk::ResourceCreationAPI { |
| 17 public: |
| 18 ResourceCreationImpl(); |
| 19 virtual ~ResourceCreationImpl(); |
| 21 | 20 |
| 22 class HostResource; | 21 // ppapi::thunk::ResourceCreationAPI implementation. |
| 23 | |
| 24 namespace proxy { | |
| 25 | |
| 26 struct Connection; | |
| 27 class Dispatcher; | |
| 28 | |
| 29 class ResourceCreationProxy : public InterfaceProxy, | |
| 30 public thunk::ResourceCreationAPI { | |
| 31 public: | |
| 32 explicit ResourceCreationProxy(Dispatcher* dispatcher); | |
| 33 virtual ~ResourceCreationProxy(); | |
| 34 | |
| 35 // Factory function used for registration (normal code can just use the | |
| 36 // constructor). | |
| 37 static InterfaceProxy* Create(Dispatcher* dispatcher); | |
| 38 | |
| 39 // ResourceCreationAPI (called in plugin). | |
| 40 virtual PP_Resource CreateFileIO(PP_Instance instance) OVERRIDE; | 22 virtual PP_Resource CreateFileIO(PP_Instance instance) OVERRIDE; |
| 41 virtual PP_Resource CreateFileRef( | 23 virtual PP_Resource CreateFileRef( |
| 42 PP_Instance instance, | 24 PP_Instance instance, |
| 43 const FileRefCreateInfo& create_info) OVERRIDE; | 25 const ppapi::FileRefCreateInfo& create_info) OVERRIDE; |
| 44 virtual PP_Resource CreateFileSystem(PP_Instance instance, | 26 virtual PP_Resource CreateFileSystem(PP_Instance instance, |
| 45 PP_FileSystemType type) OVERRIDE; | 27 PP_FileSystemType type) OVERRIDE; |
| 46 virtual PP_Resource CreateIMEInputEvent(PP_Instance instance, | 28 virtual PP_Resource CreateIMEInputEvent(PP_Instance instance, |
| 47 PP_InputEvent_Type type, | 29 PP_InputEvent_Type type, |
| 48 PP_TimeTicks time_stamp, | 30 PP_TimeTicks time_stamp, |
| 49 struct PP_Var text, | 31 struct PP_Var text, |
| 50 uint32_t segment_number, | 32 uint32_t segment_number, |
| 51 const uint32_t* segment_offsets, | 33 const uint32_t* segment_offsets, |
| 52 int32_t target_segment, | 34 int32_t target_segment, |
| 53 uint32_t selection_start, | 35 uint32_t selection_start, |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 virtual PP_Resource CreateScrollbar(PP_Instance instance, | 157 virtual PP_Resource CreateScrollbar(PP_Instance instance, |
| 176 PP_Bool vertical) OVERRIDE; | 158 PP_Bool vertical) OVERRIDE; |
| 177 virtual PP_Resource CreateTalk(PP_Instance instance) OVERRIDE; | 159 virtual PP_Resource CreateTalk(PP_Instance instance) OVERRIDE; |
| 178 virtual PP_Resource CreateVideoCapture(PP_Instance instance) OVERRIDE; | 160 virtual PP_Resource CreateVideoCapture(PP_Instance instance) OVERRIDE; |
| 179 virtual PP_Resource CreateVideoDecoder( | 161 virtual PP_Resource CreateVideoDecoder( |
| 180 PP_Instance instance, | 162 PP_Instance instance, |
| 181 PP_Resource context3d_id, | 163 PP_Resource context3d_id, |
| 182 PP_VideoDecoder_Profile profile) OVERRIDE; | 164 PP_VideoDecoder_Profile profile) OVERRIDE; |
| 183 #endif // !defined(OS_NACL) | 165 #endif // !defined(OS_NACL) |
| 184 | 166 |
| 185 virtual bool Send(IPC::Message* msg) OVERRIDE; | |
| 186 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; | |
| 187 | |
| 188 private: | 167 private: |
| 189 Connection GetConnection(); | 168 DISALLOW_COPY_AND_ASSIGN(ResourceCreationImpl); |
| 190 DISALLOW_COPY_AND_ASSIGN(ResourceCreationProxy); | |
| 191 }; | 169 }; |
| 192 | 170 |
| 193 } // namespace proxy | 171 } // namespace examples |
| 194 } // namespace ppapi | 172 } // namespace mojo |
| 195 | 173 |
| 196 #endif // PPAPI_PROXY_RESOURCE_CREATION_PROXY_H_ | 174 #endif // MOJO_EXAMPLES_PEPPER_CONTAINER_APP_RESOURCE_CREATION_IMPL_H_ |
| OLD | NEW |