| 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/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 #include "ppapi/c/private/ppb_instance_private.h" | 66 #include "ppapi/c/private/ppb_instance_private.h" |
| 67 #include "ppapi/c/private/ppb_pdf.h" | 67 #include "ppapi/c/private/ppb_pdf.h" |
| 68 #include "ppapi/c/private/ppb_proxy_private.h" | 68 #include "ppapi/c/private/ppb_proxy_private.h" |
| 69 #include "ppapi/c/private/ppb_uma_private.h" | 69 #include "ppapi/c/private/ppb_uma_private.h" |
| 70 #include "ppapi/c/trusted/ppb_audio_trusted.h" | 70 #include "ppapi/c/trusted/ppb_audio_trusted.h" |
| 71 #include "ppapi/c/trusted/ppb_broker_trusted.h" | 71 #include "ppapi/c/trusted/ppb_broker_trusted.h" |
| 72 #include "ppapi/c/trusted/ppb_buffer_trusted.h" | 72 #include "ppapi/c/trusted/ppb_buffer_trusted.h" |
| 73 #include "ppapi/c/trusted/ppb_file_io_trusted.h" | 73 #include "ppapi/c/trusted/ppb_file_io_trusted.h" |
| 74 #include "ppapi/c/trusted/ppb_image_data_trusted.h" | 74 #include "ppapi/c/trusted/ppb_image_data_trusted.h" |
| 75 #include "ppapi/c/trusted/ppb_url_loader_trusted.h" | 75 #include "ppapi/c/trusted/ppb_url_loader_trusted.h" |
| 76 #include "ppapi/shared_impl/input_event_impl.h" |
| 77 // TODO(dmichael): Delete this include after PPP_Instance_0_5 goes away in m14. |
| 78 // This is just to get the PPP_INSTANCE_0_5 definition. |
| 79 #include "ppapi/shared_impl/ppp_instance_combined.h" |
| 76 #include "ppapi/shared_impl/time_conversion.h" | 80 #include "ppapi/shared_impl/time_conversion.h" |
| 77 #include "ppapi/thunk/enter.h" | 81 #include "ppapi/thunk/enter.h" |
| 78 #include "ppapi/thunk/thunk.h" | 82 #include "ppapi/thunk/thunk.h" |
| 79 #include "webkit/plugins/ppapi/callbacks.h" | 83 #include "webkit/plugins/ppapi/callbacks.h" |
| 80 #include "webkit/plugins/ppapi/common.h" | 84 #include "webkit/plugins/ppapi/common.h" |
| 81 #include "webkit/plugins/ppapi/ppapi_interface_factory.h" | 85 #include "webkit/plugins/ppapi/ppapi_interface_factory.h" |
| 82 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" | 86 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" |
| 83 #include "webkit/plugins/ppapi/ppb_console_impl.h" | 87 #include "webkit/plugins/ppapi/ppb_console_impl.h" |
| 84 #include "webkit/plugins/ppapi/ppb_crypto_impl.h" | 88 #include "webkit/plugins/ppapi/ppb_crypto_impl.h" |
| 85 #include "webkit/plugins/ppapi/ppb_directory_reader_impl.h" | 89 #include "webkit/plugins/ppapi/ppb_directory_reader_impl.h" |
| (...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 528 return static_cast<const PPB_Memory_Dev*>(PPB_Memory_Impl::GetInterface()); | 532 return static_cast<const PPB_Memory_Dev*>(PPB_Memory_Impl::GetInterface()); |
| 529 } | 533 } |
| 530 | 534 |
| 531 // static | 535 // static |
| 532 PluginModule::GetInterfaceFunc PluginModule::GetLocalGetInterfaceFunc() { | 536 PluginModule::GetInterfaceFunc PluginModule::GetLocalGetInterfaceFunc() { |
| 533 return &GetInterface; | 537 return &GetInterface; |
| 534 } | 538 } |
| 535 | 539 |
| 536 PluginInstance* PluginModule::CreateInstance(PluginDelegate* delegate) { | 540 PluginInstance* PluginModule::CreateInstance(PluginDelegate* delegate) { |
| 537 PluginInstance* instance(NULL); | 541 PluginInstance* instance(NULL); |
| 538 const void* ppp_instance = GetPluginInterface(PPP_INSTANCE_INTERFACE_0_5); | 542 const void* ppp_instance = GetPluginInterface(PPP_INSTANCE_INTERFACE_1_0); |
| 539 if (ppp_instance) { | 543 if (ppp_instance) { |
| 544 instance = PluginInstance::Create1_0(delegate, this, ppp_instance); |
| 545 } else if ((ppp_instance = GetPluginInterface(PPP_INSTANCE_INTERFACE_0_5))) { |
| 546 // TODO(dmichael): Remove support for 0.5 in m14. |
| 540 instance = PluginInstance::Create0_5(delegate, this, ppp_instance); | 547 instance = PluginInstance::Create0_5(delegate, this, ppp_instance); |
| 541 } | 548 } |
| 542 if (!instance) { | 549 if (!instance) { |
| 543 LOG(WARNING) << "Plugin doesn't support instance interface, failing."; | 550 LOG(WARNING) << "Plugin doesn't support instance interface, failing."; |
| 544 return NULL; | 551 return NULL; |
| 545 } | 552 } |
| 546 if (out_of_process_proxy_.get()) | 553 if (out_of_process_proxy_.get()) |
| 547 out_of_process_proxy_->AddInstance(instance->pp_instance()); | 554 out_of_process_proxy_->AddInstance(instance->pp_instance()); |
| 548 return instance; | 555 return instance; |
| 549 } | 556 } |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 624 int retval = entry_points.initialize_module(pp_module(), &GetInterface); | 631 int retval = entry_points.initialize_module(pp_module(), &GetInterface); |
| 625 if (retval != 0) { | 632 if (retval != 0) { |
| 626 LOG(WARNING) << "PPP_InitializeModule returned failure " << retval; | 633 LOG(WARNING) << "PPP_InitializeModule returned failure " << retval; |
| 627 return false; | 634 return false; |
| 628 } | 635 } |
| 629 return true; | 636 return true; |
| 630 } | 637 } |
| 631 | 638 |
| 632 } // namespace ppapi | 639 } // namespace ppapi |
| 633 } // namespace webkit | 640 } // namespace webkit |
| OLD | NEW |