Chromium Code Reviews| Index: ipc/ipc_channel_proxy.h |
| diff --git a/ipc/ipc_channel_proxy.h b/ipc/ipc_channel_proxy.h |
| index 4e2ebbff2b31702eb6e4ade9000261838190ceaa..d9c94940e7c78c4cc2a43cc6e1aaca141811f860 100644 |
| --- a/ipc/ipc_channel_proxy.h |
| +++ b/ipc/ipc_channel_proxy.h |
| @@ -120,8 +120,21 @@ class IPC_EXPORT ChannelProxy : public Message::Sender { |
| Channel::Listener* listener, |
| base::MessageLoopProxy* ipc_thread_loop); |
| + // Creates an uninitialized channel proxy. Init must be called to receive |
| + // or send any messages. This two-step setup allows message filters to be |
| + // added before any messages are sent or received. |
| + ChannelProxy(Channel::Listener* listener, |
| + base::MessageLoopProxy* ipc_thread_loop); |
| + |
| virtual ~ChannelProxy(); |
| + // Initializes the channel proxy. Only call once this to initialize a channel |
|
dmac
2011/11/04 22:30:44
fix up the comment. Only call this once perhaps.
kkania
2011/11/07 20:25:16
Done.
|
| + // proxy that was not initialized in its constructor. If create_pipe_now is |
| + // true, the pipe is created synchronously. Otherwise it's created on the IO |
| + // thread. |
| + void Init(const IPC::ChannelHandle& channel_handle, Channel::Mode mode, |
| + bool create_pipe_now); |
| + |
| // Close the IPC::Channel. This operation completes asynchronously, once the |
| // background thread processes the command to close the channel. It is ok to |
| // call this method multiple times. Redundant calls are ignored. |
| @@ -165,13 +178,8 @@ class IPC_EXPORT ChannelProxy : public Message::Sender { |
| protected: |
| class Context; |
| // A subclass uses this constructor if it needs to add more information |
| - // to the internal state. If create_pipe_now is true, the pipe is created |
| - // immediately. Otherwise it's created on the IO thread. |
| - ChannelProxy(const IPC::ChannelHandle& channel_handle, |
| - Channel::Mode mode, |
| - base::MessageLoopProxy* ipc_thread_loop, |
| - Context* context, |
| - bool create_pipe_now); |
| + // to the internal state. |
| + ChannelProxy(Context* context); |
| // Used internally to hold state that is referenced on the IPC thread. |
| class Context : public base::RefCountedThreadSafe<Context>, |
| @@ -257,9 +265,6 @@ class IPC_EXPORT ChannelProxy : public Message::Sender { |
| private: |
| friend class SendTask; |
| - void Init(const IPC::ChannelHandle& channel_handle, Channel::Mode mode, |
| - base::MessageLoopProxy* ipc_thread_loop, bool create_pipe_now); |
| - |
| // By maintaining this indirection (ref-counted) to our internal state, we |
| // can safely be destroyed while the background thread continues to do stuff |
| // that involves this data. |