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

Unified Diff: ppapi/proxy/proxy_channel.cc

Issue 11722017: Use an explicit PID for duplicating Pepper handles rather than the Channel's. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 12 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/proxy/proxy_channel.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/proxy_channel.cc
diff --git a/ppapi/proxy/proxy_channel.cc b/ppapi/proxy/proxy_channel.cc
index d1c47a5fbec8596471323b6be2802ef0d1eb1679..81eb9a45553ca6629a8e2601d0cb3701eff9ea30 100644
--- a/ppapi/proxy/proxy_channel.cc
+++ b/ppapi/proxy/proxy_channel.cc
@@ -4,6 +4,8 @@
#include "ppapi/proxy/proxy_channel.h"
+#include "base/logging.h"
+#include "base/process_util.h"
#include "ipc/ipc_platform_file.h"
#include "ipc/ipc_test_sink.h"
@@ -16,6 +18,7 @@ namespace proxy {
ProxyChannel::ProxyChannel()
: delegate_(NULL),
+ peer_pid_(base::kNullProcessId),
test_sink_(NULL) {
}
@@ -24,9 +27,11 @@ ProxyChannel::~ProxyChannel() {
}
bool ProxyChannel::InitWithChannel(Delegate* delegate,
+ base::ProcessId peer_pid,
const IPC::ChannelHandle& channel_handle,
bool is_client) {
delegate_ = delegate;
+ peer_pid_ = peer_pid;
IPC::Channel::Mode mode = is_client ? IPC::Channel::MODE_CLIENT
: IPC::Channel::MODE_SERVER;
channel_.reset(new IPC::SyncChannel(channel_handle, mode, this,
@@ -38,6 +43,9 @@ bool ProxyChannel::InitWithChannel(Delegate* delegate,
void ProxyChannel::InitWithTestSink(IPC::TestSink* test_sink) {
DCHECK(!test_sink_);
test_sink_ = test_sink;
+#if !defined(OS_NACL)
+ peer_pid_ = base::GetCurrentProcId();
+#endif
}
void ProxyChannel::OnChannelError() {
@@ -65,7 +73,8 @@ IPC::PlatformFileForTransit ProxyChannel::ShareHandleWithRemote(
}
return IPC::InvalidPlatformFileForTransit();
}
- return delegate_->ShareHandleWithRemote(handle, *channel_,
+ DCHECK(peer_pid_ != base::kNullProcessId);
+ return delegate_->ShareHandleWithRemote(handle, peer_pid_,
should_close_source);
}
« no previous file with comments | « ppapi/proxy/proxy_channel.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698