| 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 "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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 #include "webkit/plugins/ppapi/ppb_graphics_2d_impl.h" | 109 #include "webkit/plugins/ppapi/ppb_graphics_2d_impl.h" |
| 110 #include "webkit/plugins/ppapi/ppb_image_data_impl.h" | 110 #include "webkit/plugins/ppapi/ppb_image_data_impl.h" |
| 111 #include "webkit/plugins/ppapi/ppb_layer_compositor_impl.h" | 111 #include "webkit/plugins/ppapi/ppb_layer_compositor_impl.h" |
| 112 #include "webkit/plugins/ppapi/ppb_proxy_impl.h" | 112 #include "webkit/plugins/ppapi/ppb_proxy_impl.h" |
| 113 #include "webkit/plugins/ppapi/ppb_scrollbar_impl.h" | 113 #include "webkit/plugins/ppapi/ppb_scrollbar_impl.h" |
| 114 #include "webkit/plugins/ppapi/ppb_uma_private_impl.h" | 114 #include "webkit/plugins/ppapi/ppb_uma_private_impl.h" |
| 115 #include "webkit/plugins/ppapi/ppb_var_deprecated_impl.h" | 115 #include "webkit/plugins/ppapi/ppb_var_deprecated_impl.h" |
| 116 #include "webkit/plugins/ppapi/ppb_video_capture_impl.h" | 116 #include "webkit/plugins/ppapi/ppb_video_capture_impl.h" |
| 117 #include "webkit/plugins/ppapi/ppb_video_decoder_impl.h" | 117 #include "webkit/plugins/ppapi/ppb_video_decoder_impl.h" |
| 118 #include "webkit/plugins/ppapi/ppb_video_layer_impl.h" | 118 #include "webkit/plugins/ppapi/ppb_video_layer_impl.h" |
| 119 #include "webkit/plugins/ppapi/webkit_forwarding_impl.h" | |
| 120 | 119 |
| 121 using ppapi::InputEventData; | 120 using ppapi::InputEventData; |
| 122 using ppapi::PpapiGlobals; | 121 using ppapi::PpapiGlobals; |
| 123 using ppapi::TimeTicksToPPTimeTicks; | 122 using ppapi::TimeTicksToPPTimeTicks; |
| 124 using ppapi::TimeToPPTime; | 123 using ppapi::TimeToPPTime; |
| 125 using ppapi::thunk::EnterResource; | 124 using ppapi::thunk::EnterResource; |
| 126 using ppapi::thunk::PPB_Graphics2D_API; | 125 using ppapi::thunk::PPB_Graphics2D_API; |
| 127 using ppapi::thunk::PPB_InputEvent_API; | 126 using ppapi::thunk::PPB_InputEvent_API; |
| 128 | 127 |
| 129 namespace webkit { | 128 namespace webkit { |
| (...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 584 | 583 |
| 585 void PluginModule::SetBroker(PluginDelegate::PpapiBroker* broker) { | 584 void PluginModule::SetBroker(PluginDelegate::PpapiBroker* broker) { |
| 586 DCHECK(!broker_ || !broker); | 585 DCHECK(!broker_ || !broker); |
| 587 broker_ = broker; | 586 broker_ = broker; |
| 588 } | 587 } |
| 589 | 588 |
| 590 PluginDelegate::PpapiBroker* PluginModule::GetBroker() { | 589 PluginDelegate::PpapiBroker* PluginModule::GetBroker() { |
| 591 return broker_; | 590 return broker_; |
| 592 } | 591 } |
| 593 | 592 |
| 594 ::ppapi::WebKitForwarding* PluginModule::GetWebKitForwarding() { | |
| 595 if (!webkit_forwarding_.get()) | |
| 596 webkit_forwarding_.reset(new WebKitForwardingImpl); | |
| 597 return webkit_forwarding_.get(); | |
| 598 } | |
| 599 | |
| 600 bool PluginModule::InitializeModule(const EntryPoints& entry_points) { | 593 bool PluginModule::InitializeModule(const EntryPoints& entry_points) { |
| 601 DCHECK(!out_of_process_proxy_.get()) << "Don't call for proxied modules."; | 594 DCHECK(!out_of_process_proxy_.get()) << "Don't call for proxied modules."; |
| 602 DCHECK(entry_points.initialize_module != NULL); | 595 DCHECK(entry_points.initialize_module != NULL); |
| 603 int retval = entry_points.initialize_module(pp_module(), &GetInterface); | 596 int retval = entry_points.initialize_module(pp_module(), &GetInterface); |
| 604 if (retval != 0) { | 597 if (retval != 0) { |
| 605 LOG(WARNING) << "PPP_InitializeModule returned failure " << retval; | 598 LOG(WARNING) << "PPP_InitializeModule returned failure " << retval; |
| 606 return false; | 599 return false; |
| 607 } | 600 } |
| 608 return true; | 601 return true; |
| 609 } | 602 } |
| 610 | 603 |
| 611 } // namespace ppapi | 604 } // namespace ppapi |
| 612 } // namespace webkit | 605 } // namespace webkit |
| OLD | NEW |