| 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 "chrome/renderer/pepper_plugin_delegate_impl.h" | 5 #include "chrome/renderer/pepper_plugin_delegate_impl.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #include "app/surface/transport_dib.h" | 9 #include "app/surface/transport_dib.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 pp::proxy::Dispatcher::GetInterfaceFunc local_get_interface) { | 358 pp::proxy::Dispatcher::GetInterfaceFunc local_get_interface) { |
| 359 dispatcher_.reset(new pp::proxy::HostDispatcher( | 359 dispatcher_.reset(new pp::proxy::HostDispatcher( |
| 360 plugin_process_handle, pp_module, local_get_interface)); | 360 plugin_process_handle, pp_module, local_get_interface)); |
| 361 | 361 |
| 362 if (!dispatcher_->InitWithChannel( | 362 if (!dispatcher_->InitWithChannel( |
| 363 ChildProcess::current()->io_message_loop(), channel_handle, | 363 ChildProcess::current()->io_message_loop(), channel_handle, |
| 364 true, ChildProcess::current()->GetShutDownEvent())) { | 364 true, ChildProcess::current()->GetShutDownEvent())) { |
| 365 dispatcher_.reset(); | 365 dispatcher_.reset(); |
| 366 return false; | 366 return false; |
| 367 } | 367 } |
| 368 | |
| 369 if (!dispatcher_->InitializeModule()) { | |
| 370 // TODO(brettw) does the module get unloaded in this case? | |
| 371 dispatcher_.reset(); | |
| 372 return false; | |
| 373 } | |
| 374 return true; | 368 return true; |
| 375 } | 369 } |
| 376 | 370 |
| 377 } // namespace | 371 } // namespace |
| 378 | 372 |
| 379 PepperPluginDelegateImpl::PepperPluginDelegateImpl(RenderView* render_view) | 373 PepperPluginDelegateImpl::PepperPluginDelegateImpl(RenderView* render_view) |
| 380 : render_view_(render_view), | 374 : render_view_(render_view), |
| 381 has_saved_context_menu_action_(false), | 375 has_saved_context_menu_action_(false), |
| 382 saved_context_menu_action_(0), | 376 saved_context_menu_action_(0), |
| 383 id_generator_(0) { | 377 id_generator_(0) { |
| (...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 953 | 947 |
| 954 void PepperPluginDelegateImpl::SetContentRestriction(int restrictions) { | 948 void PepperPluginDelegateImpl::SetContentRestriction(int restrictions) { |
| 955 render_view_->Send(new ViewHostMsg_UpdateContentRestrictions( | 949 render_view_->Send(new ViewHostMsg_UpdateContentRestrictions( |
| 956 render_view_->routing_id(), restrictions)); | 950 render_view_->routing_id(), restrictions)); |
| 957 } | 951 } |
| 958 | 952 |
| 959 void PepperPluginDelegateImpl::HasUnsupportedFeature() { | 953 void PepperPluginDelegateImpl::HasUnsupportedFeature() { |
| 960 render_view_->Send(new ViewHostMsg_PDFHasUnsupportedFeature( | 954 render_view_->Send(new ViewHostMsg_PDFHasUnsupportedFeature( |
| 961 render_view_->routing_id())); | 955 render_view_->routing_id())); |
| 962 } | 956 } |
| OLD | NEW |