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 "content/renderer/pepper_plugin_delegate_impl.h" | 5 #include "content/renderer/pepper_plugin_delegate_impl.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 #include <queue> | 8 #include <queue> |
9 | 9 |
10 #include "app/surface/transport_dib.h" | 10 #include "app/surface/transport_dib.h" |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 DISALLOW_COPY_AND_ASSIGN(PlatformVideoDecoderImpl); | 371 DISALLOW_COPY_AND_ASSIGN(PlatformVideoDecoderImpl); |
372 }; | 372 }; |
373 | 373 |
374 class DispatcherWrapper | 374 class DispatcherWrapper |
375 : public webkit::ppapi::PluginDelegate::OutOfProcessProxy { | 375 : public webkit::ppapi::PluginDelegate::OutOfProcessProxy { |
376 public: | 376 public: |
377 DispatcherWrapper() {} | 377 DispatcherWrapper() {} |
378 virtual ~DispatcherWrapper() {} | 378 virtual ~DispatcherWrapper() {} |
379 | 379 |
380 bool Init(base::ProcessHandle plugin_process_handle, | 380 bool Init(base::ProcessHandle plugin_process_handle, |
381 IPC::ChannelHandle channel_handle, | 381 const IPC::ChannelHandle& channel_handle, |
382 PP_Module pp_module, | 382 PP_Module pp_module, |
383 pp::proxy::Dispatcher::GetInterfaceFunc local_get_interface); | 383 pp::proxy::Dispatcher::GetInterfaceFunc local_get_interface); |
384 | 384 |
385 // OutOfProcessProxy implementation. | 385 // OutOfProcessProxy implementation. |
386 virtual const void* GetProxiedInterface(const char* name) { | 386 virtual const void* GetProxiedInterface(const char* name) { |
387 return dispatcher_->GetProxiedInterface(name); | 387 return dispatcher_->GetProxiedInterface(name); |
388 } | 388 } |
389 virtual void AddInstance(PP_Instance instance) { | 389 virtual void AddInstance(PP_Instance instance) { |
390 pp::proxy::HostDispatcher::SetForInstance(instance, dispatcher_.get()); | 390 pp::proxy::HostDispatcher::SetForInstance(instance, dispatcher_.get()); |
391 } | 391 } |
392 virtual void RemoveInstance(PP_Instance instance) { | 392 virtual void RemoveInstance(PP_Instance instance) { |
393 pp::proxy::HostDispatcher::RemoveForInstance(instance); | 393 pp::proxy::HostDispatcher::RemoveForInstance(instance); |
394 } | 394 } |
395 | 395 |
396 private: | 396 private: |
397 scoped_ptr<pp::proxy::HostDispatcher> dispatcher_; | 397 scoped_ptr<pp::proxy::HostDispatcher> dispatcher_; |
398 }; | 398 }; |
399 | 399 |
400 bool DispatcherWrapper::Init( | 400 bool DispatcherWrapper::Init( |
401 base::ProcessHandle plugin_process_handle, | 401 base::ProcessHandle plugin_process_handle, |
402 IPC::ChannelHandle channel_handle, | 402 const IPC::ChannelHandle& channel_handle, |
403 PP_Module pp_module, | 403 PP_Module pp_module, |
404 pp::proxy::Dispatcher::GetInterfaceFunc local_get_interface) { | 404 pp::proxy::Dispatcher::GetInterfaceFunc local_get_interface) { |
405 dispatcher_.reset(new pp::proxy::HostDispatcher( | 405 dispatcher_.reset(new pp::proxy::HostDispatcher( |
406 plugin_process_handle, pp_module, local_get_interface)); | 406 plugin_process_handle, pp_module, local_get_interface)); |
407 | 407 |
408 if (!dispatcher_->InitWithChannel(PepperPluginRegistry::GetInstance(), | 408 if (!dispatcher_->InitWithChannel(PepperPluginRegistry::GetInstance(), |
409 channel_handle, true)) { | 409 channel_handle, true)) { |
410 dispatcher_.reset(); | 410 dispatcher_.reset(); |
411 return false; | 411 return false; |
412 } | 412 } |
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
958 } | 958 } |
959 | 959 |
960 void PepperPluginDelegateImpl::HasUnsupportedFeature() { | 960 void PepperPluginDelegateImpl::HasUnsupportedFeature() { |
961 render_view_->Send(new ViewHostMsg_PDFHasUnsupportedFeature( | 961 render_view_->Send(new ViewHostMsg_PDFHasUnsupportedFeature( |
962 render_view_->routing_id())); | 962 render_view_->routing_id())); |
963 } | 963 } |
964 | 964 |
965 P2PSocketDispatcher* PepperPluginDelegateImpl::GetP2PSocketDispatcher() { | 965 P2PSocketDispatcher* PepperPluginDelegateImpl::GetP2PSocketDispatcher() { |
966 return render_view_->p2p_socket_dispatcher(); | 966 return render_view_->p2p_socket_dispatcher(); |
967 } | 967 } |
OLD | NEW |