| 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 #include "ppapi/proxy/resource_creation_proxy.h" | 5 #include "ppapi/proxy/resource_creation_proxy.h" |
| 6 | 6 |
| 7 #include "ppapi/c/pp_errors.h" | 7 #include "ppapi/c/pp_errors.h" |
| 8 #include "ppapi/c/pp_size.h" | 8 #include "ppapi/c/pp_size.h" |
| 9 #include "ppapi/c/trusted/ppb_image_data_trusted.h" | 9 #include "ppapi/c/trusted/ppb_image_data_trusted.h" |
| 10 #include "ppapi/proxy/audio_input_resource.h" | 10 #include "ppapi/proxy/audio_input_resource.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 } | 63 } |
| 64 | 64 |
| 65 ResourceCreationProxy::~ResourceCreationProxy() { | 65 ResourceCreationProxy::~ResourceCreationProxy() { |
| 66 } | 66 } |
| 67 | 67 |
| 68 // static | 68 // static |
| 69 InterfaceProxy* ResourceCreationProxy::Create(Dispatcher* dispatcher) { | 69 InterfaceProxy* ResourceCreationProxy::Create(Dispatcher* dispatcher) { |
| 70 return new ResourceCreationProxy(dispatcher); | 70 return new ResourceCreationProxy(dispatcher); |
| 71 } | 71 } |
| 72 | 72 |
| 73 PP_Resource ResourceCreationProxy::CreateDirectoryReader( |
| 74 PP_Instance instance, |
| 75 PP_Resource directory_ref) { |
| 76 return (new DirectoryReaderResource( |
| 77 GetConnection(), instance, directory_ref))->GetReference(); |
| 78 } |
| 79 |
| 73 PP_Resource ResourceCreationProxy::CreateFileIO(PP_Instance instance) { | 80 PP_Resource ResourceCreationProxy::CreateFileIO(PP_Instance instance) { |
| 74 return (new FileIOResource(GetConnection(), instance))->GetReference(); | 81 return (new FileIOResource(GetConnection(), instance))->GetReference(); |
| 75 } | 82 } |
| 76 | 83 |
| 77 PP_Resource ResourceCreationProxy::CreateFileRef(PP_Resource file_system, | 84 PP_Resource ResourceCreationProxy::CreateFileRef(PP_Resource file_system, |
| 78 const char* path) { | 85 const char* path) { |
| 79 return PPB_FileRef_Proxy::CreateProxyResource(file_system, path); | 86 return PPB_FileRef_Proxy::CreateProxyResource(file_system, path); |
| 80 } | 87 } |
| 81 | 88 |
| 82 PP_Resource ResourceCreationProxy::CreateFileSystem( | 89 PP_Resource ResourceCreationProxy::CreateFileSystem( |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 return 0; | 328 return 0; |
| 322 return (new BrowserFontResource_Trusted(GetConnection(), instance, | 329 return (new BrowserFontResource_Trusted(GetConnection(), instance, |
| 323 *description, dispatcher->preferences()))->GetReference(); | 330 *description, dispatcher->preferences()))->GetReference(); |
| 324 } | 331 } |
| 325 | 332 |
| 326 PP_Resource ResourceCreationProxy::CreateBuffer(PP_Instance instance, | 333 PP_Resource ResourceCreationProxy::CreateBuffer(PP_Instance instance, |
| 327 uint32_t size) { | 334 uint32_t size) { |
| 328 return PPB_Buffer_Proxy::CreateProxyResource(instance, size); | 335 return PPB_Buffer_Proxy::CreateProxyResource(instance, size); |
| 329 } | 336 } |
| 330 | 337 |
| 331 PP_Resource ResourceCreationProxy::CreateDirectoryReader( | |
| 332 PP_Instance instance, | |
| 333 PP_Resource directory_ref) { | |
| 334 return (new DirectoryReaderResource( | |
| 335 GetConnection(), instance, directory_ref))->GetReference(); | |
| 336 } | |
| 337 | |
| 338 PP_Resource ResourceCreationProxy::CreateFlashDeviceID(PP_Instance instance) { | 338 PP_Resource ResourceCreationProxy::CreateFlashDeviceID(PP_Instance instance) { |
| 339 return (new FlashDeviceIDResource(GetConnection(), instance))->GetReference(); | 339 return (new FlashDeviceIDResource(GetConnection(), instance))->GetReference(); |
| 340 } | 340 } |
| 341 | 341 |
| 342 PP_Resource ResourceCreationProxy::CreateFlashFontFile( | 342 PP_Resource ResourceCreationProxy::CreateFlashFontFile( |
| 343 PP_Instance instance, | 343 PP_Instance instance, |
| 344 const PP_BrowserFont_Trusted_Description* description, | 344 const PP_BrowserFont_Trusted_Description* description, |
| 345 PP_PrivateFontCharset charset) { | 345 PP_PrivateFontCharset charset) { |
| 346 return (new FlashFontFileResource( | 346 return (new FlashFontFileResource( |
| 347 GetConnection(), instance, description, charset))->GetReference(); | 347 GetConnection(), instance, description, charset))->GetReference(); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 bool ResourceCreationProxy::OnMessageReceived(const IPC::Message& msg) { | 397 bool ResourceCreationProxy::OnMessageReceived(const IPC::Message& msg) { |
| 398 return false; | 398 return false; |
| 399 } | 399 } |
| 400 | 400 |
| 401 Connection ResourceCreationProxy::GetConnection() { | 401 Connection ResourceCreationProxy::GetConnection() { |
| 402 return Connection(PluginGlobals::Get()->GetBrowserSender(), dispatcher()); | 402 return Connection(PluginGlobals::Get()->GetBrowserSender(), dispatcher()); |
| 403 } | 403 } |
| 404 | 404 |
| 405 } // namespace proxy | 405 } // namespace proxy |
| 406 } // namespace ppapi | 406 } // namespace ppapi |
| OLD | NEW |