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

Unified Diff: ppapi/proxy/proxy_channel.h

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/ppapi_proxy_test.cc ('k') | ppapi/proxy/proxy_channel.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/proxy_channel.h
diff --git a/ppapi/proxy/proxy_channel.h b/ppapi/proxy/proxy_channel.h
index bb08f79c7f642c5ef9ac5cea80d9f6d8a3c9a653..d35f98a8628fcd9f19d88591e670b376ee7cb706 100644
--- a/ppapi/proxy/proxy_channel.h
+++ b/ppapi/proxy/proxy_channel.h
@@ -47,7 +47,7 @@ class PPAPI_PROXY_EXPORT ProxyChannel
// guarantees as ProxyChannel::ShareHandleWithRemote below.
virtual IPC::PlatformFileForTransit ShareHandleWithRemote(
base::PlatformFile handle,
- const IPC::SyncChannel& channel,
+ base::ProcessId remote_pid,
bool should_close_source) = 0;
};
@@ -55,7 +55,8 @@ class PPAPI_PROXY_EXPORT ProxyChannel
// Alternative to InitWithChannel() for unit tests that want to send all
// messages sent via this channel to the given test sink. The test sink
- // must outlive this class.
+ // must outlive this class. In this case, the peer PID will be the current
+ // process ID.
void InitWithTestSink(IPC::TestSink* test_sink);
// Shares a file handle (HANDLE / file descriptor) with the remote side. It
@@ -90,6 +91,7 @@ class PPAPI_PROXY_EXPORT ProxyChannel
// The delegate pointer must outlive this class, ownership is not
// transferred.
virtual bool InitWithChannel(Delegate* delegate,
+ base::ProcessId peer_pid,
const IPC::ChannelHandle& channel_handle,
bool is_client);
@@ -101,6 +103,11 @@ class PPAPI_PROXY_EXPORT ProxyChannel
// Non-owning pointer. Guaranteed non-NULL after init is called.
ProxyChannel::Delegate* delegate_;
+ // PID of the remote process. Use this instead of the Channel::peer_pid since
+ // this is set synchronously on construction rather than waiting on the
+ // "hello" message from the peer (which introduces a race condition).
+ base::ProcessId peer_pid_;
+
// When we're unit testing, this will indicate the sink for the messages to
// be deposited so they can be inspected by the test. When non-NULL, this
// indicates that the channel should not be used.
« no previous file with comments | « ppapi/proxy/ppapi_proxy_test.cc ('k') | ppapi/proxy/proxy_channel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698