| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <cmath> | 5 #include <cmath> |
| 6 | 6 |
| 7 #include "chrome/renderer/pepper_plugin_delegate_impl.h" | 7 #include "chrome/renderer/pepper_plugin_delegate_impl.h" |
| 8 | 8 |
| 9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
| 10 #include "app/surface/transport_dib.h" | 10 #include "app/surface/transport_dib.h" |
| (...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 419 : render_view_(render_view), | 419 : render_view_(render_view), |
| 420 id_generator_(0) { | 420 id_generator_(0) { |
| 421 } | 421 } |
| 422 | 422 |
| 423 PepperPluginDelegateImpl::~PepperPluginDelegateImpl() { | 423 PepperPluginDelegateImpl::~PepperPluginDelegateImpl() { |
| 424 } | 424 } |
| 425 | 425 |
| 426 scoped_refptr<pepper::PluginModule> | 426 scoped_refptr<pepper::PluginModule> |
| 427 PepperPluginDelegateImpl::CreateOutOfProcessPepperPlugin( | 427 PepperPluginDelegateImpl::CreateOutOfProcessPepperPlugin( |
| 428 const FilePath& path) { | 428 const FilePath& path) { |
| 429 base::ProcessHandle plugin_process_handle = NULL; |
| 429 IPC::ChannelHandle channel_handle; | 430 IPC::ChannelHandle channel_handle; |
| 430 render_view_->Send(new ViewHostMsg_OpenChannelToPepperPlugin( | 431 render_view_->Send(new ViewHostMsg_OpenChannelToPepperPlugin( |
| 431 path, &channel_handle)); | 432 path, &plugin_process_handle, &channel_handle)); |
| 432 if (channel_handle.name.empty()) | 433 if (channel_handle.name.empty()) |
| 433 return scoped_refptr<pepper::PluginModule>(); // Couldn't be initialized. | 434 return scoped_refptr<pepper::PluginModule>(); // Couldn't be initialized. |
| 434 return pepper::PluginModule::CreateOutOfProcessModule( | 435 return pepper::PluginModule::CreateOutOfProcessModule( |
| 435 ChildProcess::current()->io_message_loop(), | 436 ChildProcess::current()->io_message_loop(), |
| 437 plugin_process_handle, |
| 436 channel_handle, | 438 channel_handle, |
| 437 ChildProcess::current()->GetShutDownEvent()); | 439 ChildProcess::current()->GetShutDownEvent()); |
| 438 } | 440 } |
| 439 | 441 |
| 440 void PepperPluginDelegateImpl::ViewInitiatedPaint() { | 442 void PepperPluginDelegateImpl::ViewInitiatedPaint() { |
| 441 // Notify all of our instances that we started painting. This is used for | 443 // Notify all of our instances that we started painting. This is used for |
| 442 // internal bookkeeping only, so we know that the set can not change under | 444 // internal bookkeeping only, so we know that the set can not change under |
| 443 // us. | 445 // us. |
| 444 for (std::set<pepper::PluginInstance*>::iterator i = | 446 for (std::set<pepper::PluginInstance*>::iterator i = |
| 445 active_instances_.begin(); | 447 active_instances_.begin(); |
| (...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 842 } | 844 } |
| 843 | 845 |
| 844 void PepperPluginDelegateImpl::DidStopLoading() { | 846 void PepperPluginDelegateImpl::DidStopLoading() { |
| 845 render_view_->DidStopLoadingForPlugin(); | 847 render_view_->DidStopLoadingForPlugin(); |
| 846 } | 848 } |
| 847 | 849 |
| 848 void PepperPluginDelegateImpl::SetContentRestriction(int restrictions) { | 850 void PepperPluginDelegateImpl::SetContentRestriction(int restrictions) { |
| 849 render_view_->Send(new ViewHostMsg_UpdateContentRestrictions( | 851 render_view_->Send(new ViewHostMsg_UpdateContentRestrictions( |
| 850 render_view_->routing_id(), restrictions)); | 852 render_view_->routing_id(), restrictions)); |
| 851 } | 853 } |
| OLD | NEW |