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 "content/renderer/pepper/plugin_module.h" | 5 #include "content/renderer/pepper/plugin_module.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <string.h> | 9 #include <string.h> |
| 10 |
| 11 #include <memory> |
10 #include <set> | 12 #include <set> |
11 #include <utility> | 13 #include <utility> |
12 | 14 |
13 #include "base/bind.h" | 15 #include "base/bind.h" |
14 #include "base/command_line.h" | 16 #include "base/command_line.h" |
15 #include "base/logging.h" | 17 #include "base/logging.h" |
16 #include "base/memory/scoped_ptr.h" | |
17 #include "base/message_loop/message_loop.h" | 18 #include "base/message_loop/message_loop.h" |
18 #include "base/time/time.h" | 19 #include "base/time/time.h" |
19 #include "build/build_config.h" | 20 #include "build/build_config.h" |
20 #include "content/common/frame_messages.h" | 21 #include "content/common/frame_messages.h" |
21 #include "content/public/renderer/content_renderer_client.h" | 22 #include "content/public/renderer/content_renderer_client.h" |
22 #include "content/renderer/pepper/host_dispatcher_wrapper.h" | 23 #include "content/renderer/pepper/host_dispatcher_wrapper.h" |
23 #include "content/renderer/pepper/host_globals.h" | 24 #include "content/renderer/pepper/host_globals.h" |
24 #include "content/renderer/pepper/pepper_hung_plugin_filter.h" | 25 #include "content/renderer/pepper/pepper_hung_plugin_filter.h" |
25 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" | 26 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" |
26 #include "content/renderer/pepper/pepper_plugin_registry.h" | 27 #include "content/renderer/pepper/pepper_plugin_registry.h" |
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
545 PepperPluginRegistry::GetInstance()->PluginModuleDead(this); | 546 PepperPluginRegistry::GetInstance()->PluginModuleDead(this); |
546 } | 547 } |
547 | 548 |
548 // Don't add stuff here, the two notifications that the module object has | 549 // Don't add stuff here, the two notifications that the module object has |
549 // been deleted should be last. This allows, for example, | 550 // been deleted should be last. This allows, for example, |
550 // PPB_Proxy.IsInModuleDestructor to map PP_Module to this class during the | 551 // PPB_Proxy.IsInModuleDestructor to map PP_Module to this class during the |
551 // previous parts of the destructor. | 552 // previous parts of the destructor. |
552 } | 553 } |
553 | 554 |
554 void PluginModule::SetRendererPpapiHost( | 555 void PluginModule::SetRendererPpapiHost( |
555 scoped_ptr<RendererPpapiHostImpl> host) { | 556 std::unique_ptr<RendererPpapiHostImpl> host) { |
556 renderer_ppapi_host_ = std::move(host); | 557 renderer_ppapi_host_ = std::move(host); |
557 } | 558 } |
558 | 559 |
559 bool PluginModule::InitAsInternalPlugin( | 560 bool PluginModule::InitAsInternalPlugin( |
560 const PepperPluginInfo::EntryPoints& entry_points) { | 561 const PepperPluginInfo::EntryPoints& entry_points) { |
561 if (InitializeModule(entry_points)) { | 562 if (InitializeModule(entry_points)) { |
562 entry_points_ = entry_points; | 563 entry_points_ = entry_points; |
563 return true; | 564 return true; |
564 } | 565 } |
565 return false; | 566 return false; |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
714 RendererPpapiHostImpl* PluginModule::CreateOutOfProcessModule( | 715 RendererPpapiHostImpl* PluginModule::CreateOutOfProcessModule( |
715 RenderFrameImpl* render_frame, | 716 RenderFrameImpl* render_frame, |
716 const base::FilePath& path, | 717 const base::FilePath& path, |
717 ppapi::PpapiPermissions permissions, | 718 ppapi::PpapiPermissions permissions, |
718 const IPC::ChannelHandle& channel_handle, | 719 const IPC::ChannelHandle& channel_handle, |
719 base::ProcessId peer_pid, | 720 base::ProcessId peer_pid, |
720 int plugin_child_id, | 721 int plugin_child_id, |
721 bool is_external) { | 722 bool is_external) { |
722 scoped_refptr<PepperHungPluginFilter> hung_filter(new PepperHungPluginFilter( | 723 scoped_refptr<PepperHungPluginFilter> hung_filter(new PepperHungPluginFilter( |
723 path, render_frame->GetRoutingID(), plugin_child_id)); | 724 path, render_frame->GetRoutingID(), plugin_child_id)); |
724 scoped_ptr<HostDispatcherWrapper> dispatcher(new HostDispatcherWrapper( | 725 std::unique_ptr<HostDispatcherWrapper> dispatcher(new HostDispatcherWrapper( |
725 this, peer_pid, plugin_child_id, permissions, is_external)); | 726 this, peer_pid, plugin_child_id, permissions, is_external)); |
726 if (!dispatcher->Init(channel_handle, | 727 if (!dispatcher->Init(channel_handle, |
727 &GetInterface, | 728 &GetInterface, |
728 ppapi::Preferences(PpapiPreferencesBuilder::Build( | 729 ppapi::Preferences(PpapiPreferencesBuilder::Build( |
729 render_frame->render_view()->webkit_preferences())), | 730 render_frame->render_view()->webkit_preferences())), |
730 hung_filter.get())) | 731 hung_filter.get())) |
731 return NULL; | 732 return NULL; |
732 | 733 |
733 RendererPpapiHostImpl* host_impl = | 734 RendererPpapiHostImpl* host_impl = |
734 RendererPpapiHostImpl::CreateOnModuleForOutOfProcess( | 735 RendererPpapiHostImpl::CreateOnModuleForOutOfProcess( |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
816 channel_handle, | 817 channel_handle, |
817 peer_pid, | 818 peer_pid, |
818 plugin_child_id, | 819 plugin_child_id, |
819 false)) // is_external = false | 820 false)) // is_external = false |
820 return scoped_refptr<PluginModule>(); | 821 return scoped_refptr<PluginModule>(); |
821 | 822 |
822 return module; | 823 return module; |
823 } | 824 } |
824 | 825 |
825 } // namespace content | 826 } // namespace content |
OLD | NEW |