| 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_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 "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 523 | 523 |
| 524 bool Init(base::ProcessHandle plugin_process_handle, | 524 bool Init(base::ProcessHandle plugin_process_handle, |
| 525 const IPC::ChannelHandle& channel_handle, | 525 const IPC::ChannelHandle& channel_handle, |
| 526 PP_Module pp_module, | 526 PP_Module pp_module, |
| 527 ppapi::proxy::Dispatcher::GetInterfaceFunc local_get_interface, | 527 ppapi::proxy::Dispatcher::GetInterfaceFunc local_get_interface, |
| 528 const ppapi::Preferences& preferences) { | 528 const ppapi::Preferences& preferences) { |
| 529 if (channel_handle.name.empty()) | 529 if (channel_handle.name.empty()) |
| 530 return false; | 530 return false; |
| 531 | 531 |
| 532 #if defined(OS_POSIX) | 532 #if defined(OS_POSIX) |
| 533 // Check the validity of fd for bug investigation. Remove after fixed. | 533 DCHECK_NE(-1, channel_handle.socket.fd); |
| 534 // See for details: crbug.com/103957. | |
| 535 CHECK_NE(-1, channel_handle.socket.fd); | |
| 536 if (channel_handle.socket.fd == -1) | 534 if (channel_handle.socket.fd == -1) |
| 537 return false; | 535 return false; |
| 538 #endif | 536 #endif |
| 539 | 537 |
| 540 dispatcher_delegate_.reset(new DispatcherDelegate); | 538 dispatcher_delegate_.reset(new DispatcherDelegate); |
| 541 dispatcher_.reset(new ppapi::proxy::HostDispatcher( | 539 dispatcher_.reset(new ppapi::proxy::HostDispatcher( |
| 542 plugin_process_handle, pp_module, local_get_interface)); | 540 plugin_process_handle, pp_module, local_get_interface)); |
| 543 | 541 |
| 544 if (!dispatcher_->InitHostWithChannel(dispatcher_delegate_.get(), | 542 if (!dispatcher_->InitHostWithChannel(dispatcher_delegate_.get(), |
| 545 channel_handle, | 543 channel_handle, |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 675 BrokerDispatcherWrapper::~BrokerDispatcherWrapper() { | 673 BrokerDispatcherWrapper::~BrokerDispatcherWrapper() { |
| 676 } | 674 } |
| 677 | 675 |
| 678 bool BrokerDispatcherWrapper::Init( | 676 bool BrokerDispatcherWrapper::Init( |
| 679 base::ProcessHandle broker_process_handle, | 677 base::ProcessHandle broker_process_handle, |
| 680 const IPC::ChannelHandle& channel_handle) { | 678 const IPC::ChannelHandle& channel_handle) { |
| 681 if (channel_handle.name.empty()) | 679 if (channel_handle.name.empty()) |
| 682 return false; | 680 return false; |
| 683 | 681 |
| 684 #if defined(OS_POSIX) | 682 #if defined(OS_POSIX) |
| 683 DCHECK_NE(-1, channel_handle.socket.fd); |
| 685 if (channel_handle.socket.fd == -1) | 684 if (channel_handle.socket.fd == -1) |
| 686 return false; | 685 return false; |
| 687 #endif | 686 #endif |
| 688 | 687 |
| 689 dispatcher_delegate_.reset(new DispatcherDelegate); | 688 dispatcher_delegate_.reset(new DispatcherDelegate); |
| 690 dispatcher_.reset( | 689 dispatcher_.reset( |
| 691 new ppapi::proxy::BrokerHostDispatcher(broker_process_handle)); | 690 new ppapi::proxy::BrokerHostDispatcher(broker_process_handle)); |
| 692 | 691 |
| 693 if (!dispatcher_->InitBrokerWithChannel(dispatcher_delegate_.get(), | 692 if (!dispatcher_->InitBrokerWithChannel(dispatcher_delegate_.get(), |
| 694 channel_handle, | 693 channel_handle, |
| (...skipping 1413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2108 void PepperPluginDelegateImpl::UnSetAndDeleteLockTargetAdapter( | 2107 void PepperPluginDelegateImpl::UnSetAndDeleteLockTargetAdapter( |
| 2109 webkit::ppapi::PluginInstance* instance) { | 2108 webkit::ppapi::PluginInstance* instance) { |
| 2110 LockTargetMap::iterator it = mouse_lock_instances_.find(instance); | 2109 LockTargetMap::iterator it = mouse_lock_instances_.find(instance); |
| 2111 if (it != mouse_lock_instances_.end()) { | 2110 if (it != mouse_lock_instances_.end()) { |
| 2112 MouseLockDispatcher::LockTarget* target = it->second; | 2111 MouseLockDispatcher::LockTarget* target = it->second; |
| 2113 render_view_->mouse_lock_dispatcher()->OnLockTargetDestroyed(target); | 2112 render_view_->mouse_lock_dispatcher()->OnLockTargetDestroyed(target); |
| 2114 delete target; | 2113 delete target; |
| 2115 mouse_lock_instances_.erase(it); | 2114 mouse_lock_instances_.erase(it); |
| 2116 } | 2115 } |
| 2117 } | 2116 } |
| OLD | NEW |