| 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/proxy/audio_input_resource.h" | 9 #include "ppapi/proxy/audio_input_resource.h" |
| 10 #include "ppapi/proxy/browser_font_resource_trusted.h" | |
| 11 #include "ppapi/proxy/connection.h" | 10 #include "ppapi/proxy/connection.h" |
| 12 #include "ppapi/proxy/ext_crx_file_system_private_resource.h" | 11 #include "ppapi/proxy/ext_crx_file_system_private_resource.h" |
| 13 #include "ppapi/proxy/file_chooser_resource.h" | 12 #include "ppapi/proxy/file_chooser_resource.h" |
| 14 #include "ppapi/proxy/file_io_resource.h" | 13 #include "ppapi/proxy/file_io_resource.h" |
| 15 #include "ppapi/proxy/file_system_resource.h" | 14 #include "ppapi/proxy/file_system_resource.h" |
| 16 #include "ppapi/proxy/flash_drm_resource.h" | 15 #include "ppapi/proxy/flash_drm_resource.h" |
| 17 #include "ppapi/proxy/flash_font_file_resource.h" | 16 #include "ppapi/proxy/flash_font_file_resource.h" |
| 18 #include "ppapi/proxy/flash_menu_resource.h" | 17 #include "ppapi/proxy/flash_menu_resource.h" |
| 19 #include "ppapi/proxy/graphics_2d_resource.h" | 18 #include "ppapi/proxy/graphics_2d_resource.h" |
| 20 #include "ppapi/proxy/host_resolver_private_resource.h" | 19 #include "ppapi/proxy/host_resolver_private_resource.h" |
| (...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 PP_Resource ResourceCreationProxy::CreateBroker(PP_Instance instance) { | 376 PP_Resource ResourceCreationProxy::CreateBroker(PP_Instance instance) { |
| 378 return PPB_Broker_Proxy::CreateProxyResource(instance); | 377 return PPB_Broker_Proxy::CreateProxyResource(instance); |
| 379 } | 378 } |
| 380 | 379 |
| 381 PP_Resource ResourceCreationProxy::CreateBrowserFont( | 380 PP_Resource ResourceCreationProxy::CreateBrowserFont( |
| 382 PP_Instance instance, | 381 PP_Instance instance, |
| 383 const PP_BrowserFont_Trusted_Description* description) { | 382 const PP_BrowserFont_Trusted_Description* description) { |
| 384 PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance); | 383 PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance); |
| 385 if (!dispatcher) | 384 if (!dispatcher) |
| 386 return 0; | 385 return 0; |
| 387 if (!BrowserFontResource_Trusted::IsPPFontDescriptionValid(*description)) | 386 return PluginGlobals::Get()->CreateBrowserFont( |
| 388 return 0; | 387 GetConnection(), instance, *description, dispatcher->preferences()); |
| 389 return (new BrowserFontResource_Trusted(GetConnection(), instance, | |
| 390 *description, dispatcher->preferences()))->GetReference(); | |
| 391 } | 388 } |
| 392 | 389 |
| 393 PP_Resource ResourceCreationProxy::CreateBuffer(PP_Instance instance, | 390 PP_Resource ResourceCreationProxy::CreateBuffer(PP_Instance instance, |
| 394 uint32_t size) { | 391 uint32_t size) { |
| 395 return PPB_Buffer_Proxy::CreateProxyResource(instance, size); | 392 return PPB_Buffer_Proxy::CreateProxyResource(instance, size); |
| 396 } | 393 } |
| 397 | 394 |
| 398 PP_Resource ResourceCreationProxy::CreateFlashDRM(PP_Instance instance) { | 395 PP_Resource ResourceCreationProxy::CreateFlashDRM(PP_Instance instance) { |
| 399 return (new FlashDRMResource(GetConnection(), instance))->GetReference(); | 396 return (new FlashDRMResource(GetConnection(), instance))->GetReference(); |
| 400 } | 397 } |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 457 bool ResourceCreationProxy::OnMessageReceived(const IPC::Message& msg) { | 454 bool ResourceCreationProxy::OnMessageReceived(const IPC::Message& msg) { |
| 458 return false; | 455 return false; |
| 459 } | 456 } |
| 460 | 457 |
| 461 Connection ResourceCreationProxy::GetConnection() { | 458 Connection ResourceCreationProxy::GetConnection() { |
| 462 return Connection(PluginGlobals::Get()->GetBrowserSender(), dispatcher()); | 459 return Connection(PluginGlobals::Get()->GetBrowserSender(), dispatcher()); |
| 463 } | 460 } |
| 464 | 461 |
| 465 } // namespace proxy | 462 } // namespace proxy |
| 466 } // namespace ppapi | 463 } // namespace ppapi |
| OLD | NEW |