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_ref_proxy.h" | 5 #include "ppapi/proxy/ppb_file_ref_proxy.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "ppapi/c/pp_errors.h" | 10 #include "ppapi/c/pp_errors.h" |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 | 190 |
191 PPB_FileRef_Proxy::PPB_FileRef_Proxy(Dispatcher* dispatcher) | 191 PPB_FileRef_Proxy::PPB_FileRef_Proxy(Dispatcher* dispatcher) |
192 : InterfaceProxy(dispatcher), | 192 : InterfaceProxy(dispatcher), |
193 callback_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { | 193 callback_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { |
194 } | 194 } |
195 | 195 |
196 PPB_FileRef_Proxy::~PPB_FileRef_Proxy() { | 196 PPB_FileRef_Proxy::~PPB_FileRef_Proxy() { |
197 } | 197 } |
198 | 198 |
199 // static | 199 // static |
200 const InterfaceProxy::Info* PPB_FileRef_Proxy::GetPrivateInfo() { | |
201 static const Info info = { | |
202 thunk::GetPPB_FileRefPrivate_Thunk(), | |
203 PPB_FILEREFPRIVATE_INTERFACE, | |
204 API_ID_NONE, // URL_LOADER is the canonical one. | |
205 false, | |
206 &CreateFileRefProxy | |
207 }; | |
208 return &info; | |
209 } | |
210 | |
211 // static | |
212 PP_Resource PPB_FileRef_Proxy::CreateProxyResource(PP_Resource file_system, | 200 PP_Resource PPB_FileRef_Proxy::CreateProxyResource(PP_Resource file_system, |
213 const char* path) { | 201 const char* path) { |
214 Resource* file_system_object = | 202 Resource* file_system_object = |
215 PpapiGlobals::Get()->GetResourceTracker()->GetResource(file_system); | 203 PpapiGlobals::Get()->GetResourceTracker()->GetResource(file_system); |
216 if (!file_system_object) | 204 if (!file_system_object) |
217 return 0; | 205 return 0; |
218 | 206 |
219 PPB_FileRef_CreateInfo create_info; | 207 PPB_FileRef_CreateInfo create_info; |
220 PluginDispatcher::GetForResource(file_system_object)->Send( | 208 PluginDispatcher::GetForResource(file_system_object)->Send( |
221 new PpapiHostMsg_PPBFileRef_Create( | 209 new PpapiHostMsg_PPBFileRef_Create( |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 int32_t result, | 334 int32_t result, |
347 const HostResource& host_resource, | 335 const HostResource& host_resource, |
348 int callback_id) { | 336 int callback_id) { |
349 // Execute OnMsgCallbackComplete in the plugin process. | 337 // Execute OnMsgCallbackComplete in the plugin process. |
350 Send(new PpapiMsg_PPBFileRef_CallbackComplete( | 338 Send(new PpapiMsg_PPBFileRef_CallbackComplete( |
351 API_ID_PPB_FILE_REF, host_resource, callback_id, result)); | 339 API_ID_PPB_FILE_REF, host_resource, callback_id, result)); |
352 } | 340 } |
353 | 341 |
354 } // namespace proxy | 342 } // namespace proxy |
355 } // namespace ppapi | 343 } // namespace ppapi |
OLD | NEW |