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 23 matching lines...) Expand all Loading... |
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()) | 40 if (channel_handle.name.empty()) |
41 return false; | 41 return false; |
42 | 42 |
43 #if defined(OS_POSIX) | 43 #if defined(OS_POSIX) |
44 DCHECK_NE(-1, channel_handle.socket.fd); | 44 DCHECK(channel_handle.socket.fd != -1 || |
45 if (channel_handle.socket.fd == -1) | 45 channel_handle.mojo_handle.is_valid()); |
| 46 if (channel_handle.socket.fd == -1 && !channel_handle.mojo_handle.is_valid()) |
46 return false; | 47 return false; |
47 #endif | 48 #endif |
48 | 49 |
49 dispatcher_delegate_.reset(new PepperProxyChannelDelegateImpl); | 50 dispatcher_delegate_.reset(new PepperProxyChannelDelegateImpl); |
50 dispatcher_.reset(new ppapi::proxy::HostDispatcher( | 51 dispatcher_.reset(new ppapi::proxy::HostDispatcher( |
51 module_->pp_module(), local_get_interface, permissions_)); | 52 module_->pp_module(), local_get_interface, permissions_)); |
52 // The HungPluginFilter needs to know when we are blocked on a sync message | 53 // 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 | 54 // to the plugin. Note the filter outlives the dispatcher, so there is no |
54 // need to remove it as an observer. | 55 // need to remove it as an observer. |
55 dispatcher_->AddSyncMessageStatusObserver(filter.get()); | 56 dispatcher_->AddSyncMessageStatusObserver(filter.get()); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 if (host) { | 115 if (host) { |
115 RenderFrame* render_frame = host->GetRenderFrameForInstance(instance); | 116 RenderFrame* render_frame = host->GetRenderFrameForInstance(instance); |
116 if (render_frame) { | 117 if (render_frame) { |
117 render_frame->Send(new FrameHostMsg_DidDeleteOutOfProcessPepperInstance( | 118 render_frame->Send(new FrameHostMsg_DidDeleteOutOfProcessPepperInstance( |
118 plugin_child_id_, instance, is_external_)); | 119 plugin_child_id_, instance, is_external_)); |
119 } | 120 } |
120 } | 121 } |
121 } | 122 } |
122 | 123 |
123 } // namespace content | 124 } // namespace content |
OLD | NEW |