| 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 "webkit/plugins/ppapi/plugin_module.h" | 5 #include "webkit/plugins/ppapi/plugin_module.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 #include "ppapi/c/ppb_graphics_3d.h" | 52 #include "ppapi/c/ppb_graphics_3d.h" |
| 53 #include "ppapi/c/ppb_image_data.h" | 53 #include "ppapi/c/ppb_image_data.h" |
| 54 #include "ppapi/c/ppb_instance.h" | 54 #include "ppapi/c/ppb_instance.h" |
| 55 #include "ppapi/c/ppb_messaging.h" | 55 #include "ppapi/c/ppb_messaging.h" |
| 56 #include "ppapi/c/ppb_mouse_lock.h" | 56 #include "ppapi/c/ppb_mouse_lock.h" |
| 57 #include "ppapi/c/ppb_opengles2.h" | 57 #include "ppapi/c/ppb_opengles2.h" |
| 58 #include "ppapi/c/ppb_url_loader.h" | 58 #include "ppapi/c/ppb_url_loader.h" |
| 59 #include "ppapi/c/ppb_url_request_info.h" | 59 #include "ppapi/c/ppb_url_request_info.h" |
| 60 #include "ppapi/c/ppb_url_response_info.h" | 60 #include "ppapi/c/ppb_url_response_info.h" |
| 61 #include "ppapi/c/ppb_var.h" | 61 #include "ppapi/c/ppb_var.h" |
| 62 #include "ppapi/c/ppb_view.h" |
| 62 #include "ppapi/c/ppp.h" | 63 #include "ppapi/c/ppp.h" |
| 63 #include "ppapi/c/ppp_instance.h" | 64 #include "ppapi/c/ppp_instance.h" |
| 64 #include "ppapi/c/private/ppb_file_ref_private.h" | 65 #include "ppapi/c/private/ppb_file_ref_private.h" |
| 65 #include "ppapi/c/private/ppb_flash.h" | 66 #include "ppapi/c/private/ppb_flash.h" |
| 66 #include "ppapi/c/private/ppb_flash_clipboard.h" | 67 #include "ppapi/c/private/ppb_flash_clipboard.h" |
| 67 #include "ppapi/c/private/ppb_flash_file.h" | 68 #include "ppapi/c/private/ppb_flash_file.h" |
| 68 #include "ppapi/c/private/ppb_flash_fullscreen.h" | 69 #include "ppapi/c/private/ppb_flash_fullscreen.h" |
| 69 #include "ppapi/c/private/ppb_flash_tcp_socket.h" | 70 #include "ppapi/c/private/ppb_flash_tcp_socket.h" |
| 70 #include "ppapi/c/private/ppb_gpu_blacklist_private.h" | 71 #include "ppapi/c/private/ppb_gpu_blacklist_private.h" |
| 71 #include "ppapi/c/private/ppb_instance_private.h" | 72 #include "ppapi/c/private/ppb_instance_private.h" |
| (...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 490 return &core_interface; | 491 return &core_interface; |
| 491 } | 492 } |
| 492 | 493 |
| 493 // static | 494 // static |
| 494 PluginModule::GetInterfaceFunc PluginModule::GetLocalGetInterfaceFunc() { | 495 PluginModule::GetInterfaceFunc PluginModule::GetLocalGetInterfaceFunc() { |
| 495 return &GetInterface; | 496 return &GetInterface; |
| 496 } | 497 } |
| 497 | 498 |
| 498 PluginInstance* PluginModule::CreateInstance(PluginDelegate* delegate) { | 499 PluginInstance* PluginModule::CreateInstance(PluginDelegate* delegate) { |
| 499 PluginInstance* instance(NULL); | 500 PluginInstance* instance(NULL); |
| 500 const void* ppp_instance = GetPluginInterface(PPP_INSTANCE_INTERFACE_1_0); | 501 const void* ppp_instance = GetPluginInterface(PPP_INSTANCE_INTERFACE_1_1); |
| 501 if (ppp_instance) { | 502 if (ppp_instance) { |
| 503 instance = PluginInstance::Create1_1(delegate, this, ppp_instance); |
| 504 } else if ((ppp_instance = GetPluginInterface(PPP_INSTANCE_INTERFACE_1_0))) { |
| 502 instance = PluginInstance::Create1_0(delegate, this, ppp_instance); | 505 instance = PluginInstance::Create1_0(delegate, this, ppp_instance); |
| 503 } if (!instance) { | 506 } |
| 507 |
| 508 if (!instance) { |
| 504 LOG(WARNING) << "Plugin doesn't support instance interface, failing."; | 509 LOG(WARNING) << "Plugin doesn't support instance interface, failing."; |
| 505 return NULL; | 510 return NULL; |
| 506 } | 511 } |
| 507 if (out_of_process_proxy_.get()) | 512 if (out_of_process_proxy_.get()) |
| 508 out_of_process_proxy_->AddInstance(instance->pp_instance()); | 513 out_of_process_proxy_->AddInstance(instance->pp_instance()); |
| 509 return instance; | 514 return instance; |
| 510 } | 515 } |
| 511 | 516 |
| 512 PluginInstance* PluginModule::GetSomeInstance() const { | 517 PluginInstance* PluginModule::GetSomeInstance() const { |
| 513 // This will generally crash later if there is not actually any instance to | 518 // This will generally crash later if there is not actually any instance to |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 585 int retval = entry_points.initialize_module(pp_module(), &GetInterface); | 590 int retval = entry_points.initialize_module(pp_module(), &GetInterface); |
| 586 if (retval != 0) { | 591 if (retval != 0) { |
| 587 LOG(WARNING) << "PPP_InitializeModule returned failure " << retval; | 592 LOG(WARNING) << "PPP_InitializeModule returned failure " << retval; |
| 588 return false; | 593 return false; |
| 589 } | 594 } |
| 590 return true; | 595 return true; |
| 591 } | 596 } |
| 592 | 597 |
| 593 } // namespace ppapi | 598 } // namespace ppapi |
| 594 } // namespace webkit | 599 } // namespace webkit |
| OLD | NEW |