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

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

Issue 2038423004: Use ChannelMojo for Browser-GPU and Renderer-GPU IPC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojo-utility-channel-mojo
Patch Set: fix pepper 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_NE(-1, channel_handle.socket.fd);
45 if (channel_handle.socket.fd == -1)
46 return false;
47 #endif
48
49 dispatcher_delegate_.reset(new PepperProxyChannelDelegateImpl); 43 dispatcher_delegate_.reset(new PepperProxyChannelDelegateImpl);
50 dispatcher_.reset(new ppapi::proxy::HostDispatcher( 44 dispatcher_.reset(new ppapi::proxy::HostDispatcher(
51 module_->pp_module(), local_get_interface, permissions_)); 45 module_->pp_module(), local_get_interface, permissions_));
52 // 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
53 // 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
54 // need to remove it as an observer. 48 // need to remove it as an observer.
55 dispatcher_->AddSyncMessageStatusObserver(filter.get()); 49 dispatcher_->AddSyncMessageStatusObserver(filter.get());
56 // Guarantee the hung_plugin_filter_ outlives |dispatcher_|. 50 // Guarantee the hung_plugin_filter_ outlives |dispatcher_|.
57 hung_plugin_filter_ = filter; 51 hung_plugin_filter_ = filter;
58 52
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 if (host) { 108 if (host) {
115 RenderFrame* render_frame = host->GetRenderFrameForInstance(instance); 109 RenderFrame* render_frame = host->GetRenderFrameForInstance(instance);
116 if (render_frame) { 110 if (render_frame) {
117 render_frame->Send(new FrameHostMsg_DidDeleteOutOfProcessPepperInstance( 111 render_frame->Send(new FrameHostMsg_DidDeleteOutOfProcessPepperInstance(
118 plugin_child_id_, instance, is_external_)); 112 plugin_child_id_, instance, is_external_));
119 } 113 }
120 } 114 }
121 } 115 }
122 116
123 } // 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