Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Side by Side Diff: content/renderer/pepper/host_dispatcher_wrapper.cc

Issue 2168523002: Use ChannelMojo for plugin-renderer channels. Base URL: https://chromium.googlesource.com/chromium/src.git@mojo-nacl-ipc-fds
Patch Set: rebase Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/ppapi_plugin/ppapi_thread.cc ('k') | content/renderer/pepper/pepper_broker.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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()) 40 if (!channel_handle.mojo_handle.is_valid())
41 return false; 41 return false;
42 42
43 #if defined(OS_POSIX)
44 DCHECK(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())
47 return false;
48 #endif
49
50 dispatcher_delegate_.reset(new PepperProxyChannelDelegateImpl); 43 dispatcher_delegate_.reset(new PepperProxyChannelDelegateImpl);
51 dispatcher_.reset(new ppapi::proxy::HostDispatcher( 44 dispatcher_.reset(new ppapi::proxy::HostDispatcher(
52 module_->pp_module(), local_get_interface, permissions_)); 45 module_->pp_module(), local_get_interface, permissions_));
53 // The HungPluginFilter needs to know when we are blocked on a sync message 46 // The HungPluginFilter needs to know when we are blocked on a sync message
54 // to the plugin. Note the filter outlives the dispatcher, so there is no 47 // to the plugin. Note the filter outlives the dispatcher, so there is no
55 // need to remove it as an observer. 48 // need to remove it as an observer.
56 dispatcher_->AddSyncMessageStatusObserver(filter.get()); 49 dispatcher_->AddSyncMessageStatusObserver(filter.get());
57 // Guarantee the hung_plugin_filter_ outlives |dispatcher_|. 50 // Guarantee the hung_plugin_filter_ outlives |dispatcher_|.
58 hung_plugin_filter_ = filter; 51 hung_plugin_filter_ = filter;
59 52
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 if (host) { 108 if (host) {
116 RenderFrame* render_frame = host->GetRenderFrameForInstance(instance); 109 RenderFrame* render_frame = host->GetRenderFrameForInstance(instance);
117 if (render_frame) { 110 if (render_frame) {
118 render_frame->Send(new FrameHostMsg_DidDeleteOutOfProcessPepperInstance( 111 render_frame->Send(new FrameHostMsg_DidDeleteOutOfProcessPepperInstance(
119 plugin_child_id_, instance, is_external_)); 112 plugin_child_id_, instance, is_external_));
120 } 113 }
121 } 114 }
122 } 115 }
123 116
124 } // namespace content 117 } // namespace content
OLDNEW
« no previous file with comments | « content/ppapi_plugin/ppapi_thread.cc ('k') | content/renderer/pepper/pepper_broker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698