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

Side by Side Diff: content/renderer/pepper/pepper_broker.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, 6 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
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/pepper_broker.h" 5 #include "content/renderer/pepper/pepper_broker.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 #include "content/renderer/pepper/pepper_proxy_channel_delegate_impl.h" 8 #include "content/renderer/pepper/pepper_proxy_channel_delegate_impl.h"
9 #include "content/renderer/pepper/plugin_module.h" 9 #include "content/renderer/pepper/plugin_module.h"
10 #include "content/renderer/pepper/ppb_broker_impl.h" 10 #include "content/renderer/pepper/ppb_broker_impl.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 47
48 } // namespace 48 } // namespace
49 49
50 PepperBrokerDispatcherWrapper::PepperBrokerDispatcherWrapper() {} 50 PepperBrokerDispatcherWrapper::PepperBrokerDispatcherWrapper() {}
51 51
52 PepperBrokerDispatcherWrapper::~PepperBrokerDispatcherWrapper() {} 52 PepperBrokerDispatcherWrapper::~PepperBrokerDispatcherWrapper() {}
53 53
54 bool PepperBrokerDispatcherWrapper::Init( 54 bool PepperBrokerDispatcherWrapper::Init(
55 base::ProcessId broker_pid, 55 base::ProcessId broker_pid,
56 const IPC::ChannelHandle& channel_handle) { 56 const IPC::ChannelHandle& channel_handle) {
57 if (channel_handle.name.empty()) 57 if (!channel_handle.mojo_handle.is_valid())
58 return false; 58 return false;
59 59
60 #if defined(OS_POSIX)
61 DCHECK_NE(-1, channel_handle.socket.fd);
62 if (channel_handle.socket.fd == -1)
63 return false;
64 #endif
65
66 dispatcher_delegate_.reset(new PepperProxyChannelDelegateImpl); 60 dispatcher_delegate_.reset(new PepperProxyChannelDelegateImpl);
67 dispatcher_.reset(new ppapi::proxy::BrokerHostDispatcher()); 61 dispatcher_.reset(new ppapi::proxy::BrokerHostDispatcher());
68 62
69 if (!dispatcher_->InitBrokerWithChannel(dispatcher_delegate_.get(), 63 if (!dispatcher_->InitBrokerWithChannel(dispatcher_delegate_.get(),
70 broker_pid, 64 broker_pid,
71 channel_handle, 65 channel_handle,
72 true)) { // Client. 66 true)) { // Client.
73 dispatcher_.reset(); 67 dispatcher_.reset();
74 dispatcher_delegate_.reset(); 68 dispatcher_delegate_.reset();
75 return false; 69 return false;
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 244
251 // TOOD(ddorwin): Change the IPC to asynchronous: Queue an object containing 245 // TOOD(ddorwin): Change the IPC to asynchronous: Queue an object containing
252 // client and plugin_socket.release(), then return. 246 // client and plugin_socket.release(), then return.
253 // That message handler will then call client->BrokerConnected() with the 247 // That message handler will then call client->BrokerConnected() with the
254 // saved pipe handle. 248 // saved pipe handle.
255 // Temporarily, just call back. 249 // Temporarily, just call back.
256 client->BrokerConnected(ppapi::PlatformFileToInt(plugin_handle), result); 250 client->BrokerConnected(ppapi::PlatformFileToInt(plugin_handle), result);
257 } 251 }
258 252
259 } // namespace content 253 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/pepper/host_dispatcher_wrapper.cc ('k') | content/renderer/pepper/plugin_module.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698