diff options
author | teravest@chromium.org <teravest@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-26 11:43:07 +0000 |
---|---|---|
committer | teravest@chromium.org <teravest@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-26 11:43:07 +0000 |
commit | bf6bdef431d0f5ae1af407e68988f8697e213052 (patch) | |
tree | 88ca8aa9ff1ba8a68824a2bb2e9eff02e0b05e55 /ppapi/proxy/proxy_channel.h | |
parent | a1d076eef3be6ab74325d3d5ab30a267a1c9cc9a (diff) | |
download | chromium_src-bf6bdef431d0f5ae1af407e68988f8697e213052.zip chromium_src-bf6bdef431d0f5ae1af407e68988f8697e213052.tar.gz chromium_src-bf6bdef431d0f5ae1af407e68988f8697e213052.tar.bz2 |
Pepper: Fix channel init in ProxyChannel.
Previously, there was no way to savely add filters to the underlying
SyncChannel in a ProxyChannel safely.
This change splits channel initialization into two methods so there's a clear
step where filters may be added safely.
BUG=343768
Review URL: https://codereview.chromium.org/179743005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@253408 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/proxy/proxy_channel.h')
-rw-r--r-- | ppapi/proxy/proxy_channel.h | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/ppapi/proxy/proxy_channel.h b/ppapi/proxy/proxy_channel.h index 6c9f1f6..64b8a77 100644 --- a/ppapi/proxy/proxy_channel.h +++ b/ppapi/proxy/proxy_channel.h @@ -53,10 +53,10 @@ class PPAPI_PROXY_EXPORT ProxyChannel virtual ~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. In this case, the peer PID will be the current - // process ID. + // Alternative to InitWithChannel()/ConnectChannel() 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. 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 @@ -87,13 +87,14 @@ class PPAPI_PROXY_EXPORT ProxyChannel protected: explicit ProxyChannel(); - // You must call this function before anything else. Returns true on success. + // You must call this function before anything else. // 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); + void InitWithChannel(Delegate* delegate, base::ProcessId peer_pid); + + // You must call this function after InitWithChannel(), and after adding any + // desired filters to the underlying channel, but before anything else. + void ConnectChannel(const IPC::ChannelHandle& channel_handle, bool is_client); ProxyChannel::Delegate* delegate() const { return delegate_; |