OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "ppapi/proxy/ppb_file_system_proxy.h" | 5 #include "ppapi/proxy/ppb_file_system_proxy.h" |
6 | 6 |
7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
8 #include "base/task.h" | 8 #include "base/task.h" |
9 #include "ppapi/c/pp_errors.h" | 9 #include "ppapi/c/pp_errors.h" |
10 #include "ppapi/c/ppb_file_system.h" | 10 #include "ppapi/c/ppb_file_system.h" |
11 #include "ppapi/proxy/enter_proxy.h" | 11 #include "ppapi/proxy/enter_proxy.h" |
12 #include "ppapi/proxy/host_dispatcher.h" | 12 #include "ppapi/proxy/host_dispatcher.h" |
13 #include "ppapi/proxy/plugin_dispatcher.h" | 13 #include "ppapi/proxy/plugin_dispatcher.h" |
14 #include "ppapi/proxy/ppapi_messages.h" | 14 #include "ppapi/proxy/ppapi_messages.h" |
15 #include "ppapi/proxy/serialized_var.h" | 15 #include "ppapi/proxy/serialized_var.h" |
16 #include "ppapi/thunk/enter.h" | 16 #include "ppapi/thunk/enter.h" |
17 #include "ppapi/thunk/ppb_file_system_api.h" | 17 #include "ppapi/thunk/ppb_file_system_api.h" |
18 #include "ppapi/thunk/resource_creation_api.h" | 18 #include "ppapi/thunk/resource_creation_api.h" |
19 #include "ppapi/thunk/thunk.h" | 19 #include "ppapi/thunk/thunk.h" |
20 | 20 |
21 using ppapi::HostResource; | |
22 using ppapi::Resource; | |
23 using ppapi::thunk::EnterFunctionNoLock; | 21 using ppapi::thunk::EnterFunctionNoLock; |
24 using ppapi::thunk::PPB_FileSystem_API; | 22 using ppapi::thunk::PPB_FileSystem_API; |
25 using ppapi::thunk::ResourceCreationAPI; | 23 using ppapi::thunk::ResourceCreationAPI; |
26 | 24 |
27 namespace pp { | 25 namespace ppapi { |
28 namespace proxy { | 26 namespace proxy { |
29 | 27 |
30 namespace { | 28 namespace { |
31 | 29 |
32 InterfaceProxy* CreateFileSystemProxy(Dispatcher* dispatcher, | 30 InterfaceProxy* CreateFileSystemProxy(Dispatcher* dispatcher, |
33 const void* target_interface) { | 31 const void* target_interface) { |
34 return new PPB_FileSystem_Proxy(dispatcher, target_interface); | 32 return new PPB_FileSystem_Proxy(dispatcher, target_interface); |
35 } | 33 } |
36 | 34 |
37 } // namespace | 35 } // namespace |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 const void* target_interface) | 114 const void* target_interface) |
117 : InterfaceProxy(dispatcher, target_interface), | 115 : InterfaceProxy(dispatcher, target_interface), |
118 callback_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { | 116 callback_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { |
119 } | 117 } |
120 | 118 |
121 PPB_FileSystem_Proxy::~PPB_FileSystem_Proxy() { | 119 PPB_FileSystem_Proxy::~PPB_FileSystem_Proxy() { |
122 } | 120 } |
123 | 121 |
124 const InterfaceProxy::Info* PPB_FileSystem_Proxy::GetInfo() { | 122 const InterfaceProxy::Info* PPB_FileSystem_Proxy::GetInfo() { |
125 static const Info info = { | 123 static const Info info = { |
126 ::ppapi::thunk::GetPPB_FileSystem_Thunk(), | 124 thunk::GetPPB_FileSystem_Thunk(), |
127 PPB_FILESYSTEM_INTERFACE, | 125 PPB_FILESYSTEM_INTERFACE, |
128 INTERFACE_ID_PPB_FILE_SYSTEM, | 126 INTERFACE_ID_PPB_FILE_SYSTEM, |
129 false, | 127 false, |
130 &CreateFileSystemProxy, | 128 &CreateFileSystemProxy, |
131 }; | 129 }; |
132 return &info; | 130 return &info; |
133 } | 131 } |
134 | 132 |
135 // static | 133 // static |
136 PP_Resource PPB_FileSystem_Proxy::CreateProxyResource( | 134 PP_Resource PPB_FileSystem_Proxy::CreateProxyResource( |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 } | 188 } |
191 | 189 |
192 void PPB_FileSystem_Proxy::OpenCompleteInHost( | 190 void PPB_FileSystem_Proxy::OpenCompleteInHost( |
193 int32_t result, | 191 int32_t result, |
194 const HostResource& host_resource) { | 192 const HostResource& host_resource) { |
195 dispatcher()->Send(new PpapiMsg_PPBFileSystem_OpenComplete( | 193 dispatcher()->Send(new PpapiMsg_PPBFileSystem_OpenComplete( |
196 INTERFACE_ID_PPB_FILE_SYSTEM, host_resource, result)); | 194 INTERFACE_ID_PPB_FILE_SYSTEM, host_resource, result)); |
197 } | 195 } |
198 | 196 |
199 } // namespace proxy | 197 } // namespace proxy |
200 } // namespace pp | 198 } // namespace ppapi |
OLD | NEW |