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 "content/common/view_messages.h" | 7 #include "content/common/view_messages.h" |
| 8 #include "content/renderer/pepper/pepper_hung_plugin_filter.h" | 8 #include "content/renderer/pepper/pepper_hung_plugin_filter.h" |
| 9 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" | 9 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" |
| 10 #include "content/renderer/pepper/pepper_proxy_channel_delegate_impl.h" | 10 #include "content/renderer/pepper/pepper_proxy_channel_delegate_impl.h" |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 25 peer_pid_(peer_pid), | 25 peer_pid_(peer_pid), |
| 26 plugin_child_id_(plugin_child_id), | 26 plugin_child_id_(plugin_child_id), |
| 27 permissions_(perms), | 27 permissions_(perms), |
| 28 is_external_(is_external) {} | 28 is_external_(is_external) {} |
| 29 | 29 |
| 30 HostDispatcherWrapper::~HostDispatcherWrapper() {} | 30 HostDispatcherWrapper::~HostDispatcherWrapper() {} |
| 31 | 31 |
| 32 bool HostDispatcherWrapper::Init(const IPC::ChannelHandle& channel_handle, | 32 bool HostDispatcherWrapper::Init(const IPC::ChannelHandle& channel_handle, |
| 33 PP_GetInterface_Func local_get_interface, | 33 PP_GetInterface_Func local_get_interface, |
| 34 const ppapi::Preferences& preferences, | 34 const ppapi::Preferences& preferences, |
| 35 PepperHungPluginFilter* filter) { | 35 scoped_refptr<PepperHungPluginFilter> filter) { |
| 36 if (channel_handle.name.empty()) | 36 if (channel_handle.name.empty()) |
| 37 return false; | 37 return false; |
| 38 | 38 |
| 39 #if defined(OS_POSIX) | 39 #if defined(OS_POSIX) |
| 40 DCHECK_NE(-1, channel_handle.socket.fd); | 40 DCHECK_NE(-1, channel_handle.socket.fd); |
| 41 if (channel_handle.socket.fd == -1) | 41 if (channel_handle.socket.fd == -1) |
| 42 return false; | 42 return false; |
| 43 #endif | 43 #endif |
| 44 | 44 |
| 45 dispatcher_delegate_.reset(new PepperProxyChannelDelegateImpl); | 45 dispatcher_delegate_.reset(new PepperProxyChannelDelegateImpl); |
| 46 // TODO/FIXME(dmichael): Should we really be passing the filter to | |
| 47 // InitHostWithChannel? What about Init instead? | |
|
raymes
2014/09/23 02:57:09
I'm not sure I understand this comment. Aren't we
dmichael (off chromium)
2014/09/23 17:38:42
Sorry, this is one of the things I meant when I sa
| |
| 46 dispatcher_.reset(new ppapi::proxy::HostDispatcher( | 48 dispatcher_.reset(new ppapi::proxy::HostDispatcher( |
| 47 module_->pp_module(), local_get_interface, filter, permissions_)); | 49 module_->pp_module(), local_get_interface, filter, permissions_)); |
| 50 // The HungPluginFilter needs to know when we are blocked on a sync message | |
| 51 // to the plugin. Note the filter outlives the dispatcher, so there is no | |
| 52 // need to remove is as an observer. | |
|
raymes
2014/09/23 02:57:09
is->it
dmichael (off chromium)
2014/09/23 17:38:42
Done.
| |
| 53 dispatcher_->AddSyncMessageStatusObserver(filter.get()); | |
| 48 | 54 |
| 49 if (!dispatcher_->InitHostWithChannel(dispatcher_delegate_.get(), | 55 if (!dispatcher_->InitHostWithChannel(dispatcher_delegate_.get(), |
| 50 peer_pid_, | 56 peer_pid_, |
| 51 channel_handle, | 57 channel_handle, |
| 52 true, // Client. | 58 true, // Client. |
| 53 preferences)) { | 59 preferences)) { |
| 54 dispatcher_.reset(); | 60 dispatcher_.reset(); |
| 55 dispatcher_delegate_.reset(); | 61 dispatcher_delegate_.reset(); |
| 56 return false; | 62 return false; |
| 57 } | 63 } |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 97 if (host) { | 103 if (host) { |
| 98 RenderFrame* render_frame = host->GetRenderFrameForInstance(instance); | 104 RenderFrame* render_frame = host->GetRenderFrameForInstance(instance); |
| 99 if (render_frame) { | 105 if (render_frame) { |
| 100 render_frame->Send(new ViewHostMsg_DidDeleteOutOfProcessPepperInstance( | 106 render_frame->Send(new ViewHostMsg_DidDeleteOutOfProcessPepperInstance( |
| 101 plugin_child_id_, instance, is_external_)); | 107 plugin_child_id_, instance, is_external_)); |
| 102 } | 108 } |
| 103 } | 109 } |
| 104 } | 110 } |
| 105 | 111 |
| 106 } // namespace content | 112 } // namespace content |
| OLD | NEW |