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