Chromium Code Reviews| 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/host_dispatcher_wrapper.h" | 5 #include "content/renderer/pepper/host_dispatcher_wrapper.h" |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 #include "content/common/frame_messages.h" | 8 #include "content/common/frame_messages.h" |
| 9 #include "content/public/common/origin_util.h" | 9 #include "content/public/common/origin_util.h" |
| 10 #include "content/renderer/pepper/pepper_hung_plugin_filter.h" | 10 #include "content/renderer/pepper/pepper_hung_plugin_filter.h" |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 30 plugin_child_id_(plugin_child_id), | 30 plugin_child_id_(plugin_child_id), |
| 31 permissions_(perms), | 31 permissions_(perms), |
| 32 is_external_(is_external) {} | 32 is_external_(is_external) {} |
| 33 | 33 |
| 34 HostDispatcherWrapper::~HostDispatcherWrapper() {} | 34 HostDispatcherWrapper::~HostDispatcherWrapper() {} |
| 35 | 35 |
| 36 bool HostDispatcherWrapper::Init(const IPC::ChannelHandle& channel_handle, | 36 bool HostDispatcherWrapper::Init(const IPC::ChannelHandle& channel_handle, |
| 37 PP_GetInterface_Func local_get_interface, | 37 PP_GetInterface_Func local_get_interface, |
| 38 const ppapi::Preferences& preferences, | 38 const ppapi::Preferences& preferences, |
| 39 scoped_refptr<PepperHungPluginFilter> filter) { | 39 scoped_refptr<PepperHungPluginFilter> filter) { |
| 40 if (channel_handle.name.empty()) | |
|
raymes
2016/10/17 23:07:23
if (channel_handle.name.empty() && !channel_handle
Sam McNally
2016/10/17 23:12:52
Done (using is_mojo_channel_handle() here and belo
| |
| 41 return false; | |
| 42 | |
| 43 #if defined(OS_POSIX) | 40 #if defined(OS_POSIX) |
| 44 DCHECK_NE(-1, channel_handle.socket.fd); | 41 DCHECK(channel_handle.socket.fd != -1 || |
| 45 if (channel_handle.socket.fd == -1) | 42 channel_handle.mojo_handle.is_valid()); |
| 43 if (channel_handle.socket.fd == -1 && !channel_handle.mojo_handle.is_valid()) | |
| 46 return false; | 44 return false; |
| 47 #endif | 45 #endif |
| 48 | 46 |
| 49 dispatcher_delegate_.reset(new PepperProxyChannelDelegateImpl); | 47 dispatcher_delegate_.reset(new PepperProxyChannelDelegateImpl); |
| 50 dispatcher_.reset(new ppapi::proxy::HostDispatcher( | 48 dispatcher_.reset(new ppapi::proxy::HostDispatcher( |
| 51 module_->pp_module(), local_get_interface, permissions_)); | 49 module_->pp_module(), local_get_interface, permissions_)); |
| 52 // The HungPluginFilter needs to know when we are blocked on a sync message | 50 // The HungPluginFilter needs to know when we are blocked on a sync message |
| 53 // to the plugin. Note the filter outlives the dispatcher, so there is no | 51 // to the plugin. Note the filter outlives the dispatcher, so there is no |
| 54 // need to remove it as an observer. | 52 // need to remove it as an observer. |
| 55 dispatcher_->AddSyncMessageStatusObserver(filter.get()); | 53 dispatcher_->AddSyncMessageStatusObserver(filter.get()); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 114 if (host) { | 112 if (host) { |
| 115 RenderFrame* render_frame = host->GetRenderFrameForInstance(instance); | 113 RenderFrame* render_frame = host->GetRenderFrameForInstance(instance); |
| 116 if (render_frame) { | 114 if (render_frame) { |
| 117 render_frame->Send(new FrameHostMsg_DidDeleteOutOfProcessPepperInstance( | 115 render_frame->Send(new FrameHostMsg_DidDeleteOutOfProcessPepperInstance( |
| 118 plugin_child_id_, instance, is_external_)); | 116 plugin_child_id_, instance, is_external_)); |
| 119 } | 117 } |
| 120 } | 118 } |
| 121 } | 119 } |
| 122 | 120 |
| 123 } // namespace content | 121 } // namespace content |
| OLD | NEW |