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

Unified Diff: ipc/ipc_channel_proxy.h

Issue 2316963005: Reworks Channel pausing behavior (Closed)
Patch Set: Created 4 years, 3 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 | « ipc/ipc_channel_mojo_unittest.cc ('k') | ipc/ipc_channel_proxy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_channel_proxy.h
diff --git a/ipc/ipc_channel_proxy.h b/ipc/ipc_channel_proxy.h
index b544a194ce1065a70af047eaf22dedab0850416a..06b3267117324006a1795bbf52cb4d7ec7e672c9 100644
--- a/ipc/ipc_channel_proxy.h
+++ b/ipc/ipc_channel_proxy.h
@@ -113,20 +113,21 @@ class IPC_EXPORT ChannelProxy : public Endpoint, public base::NonThreadSafe {
// Initializes the channel proxy. Only call this once to initialize a channel
// 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. If |create_paused| is true, outgoing messages will continue to be
- // queued until Unpause() is called.
+ // thread.
void Init(const IPC::ChannelHandle& channel_handle,
Channel::Mode mode,
- bool create_pipe_now,
- bool create_paused = false);
+ bool create_pipe_now);
void Init(std::unique_ptr<ChannelFactory> factory,
- bool create_pipe_now,
- bool create_paused = false);
+ bool create_pipe_now);
- // Unpause the channel. Only useful if Init was called with |create_paused|.
- // If |flush| is true the channel will be flushed as soon as it's unpaused.
- // Otherwise you must explicitly call Flush() to flush messages which were
- // queued while the channel was paused.
+ // Pause the channel. Subsequent calls to Send() will be internally queued
+ // until Unpause() is called. Queued messages will not be sent until the
+ // channel is flushed.
+ void Pause();
+
+ // Unpause the channel. If |flush| is true the channel will be flushed as soon
+ // as it's unpaused (see Flush() below.) Otherwise you must explicitly call
+ // Flush() to flush messages which were queued while the channel was paused.
void Unpause(bool flush);
// Flush the channel. This sends any messages which were queued before calling
@@ -288,11 +289,12 @@ class IPC_EXPORT ChannelProxy : public Endpoint, public base::NonThreadSafe {
// Returns true if the message was processed, false otherwise.
bool TryFilters(const Message& message);
+ void PauseChannel();
void UnpauseChannel(bool flush);
void FlushChannel();
// Like Open and Close, but called on the IPC thread.
- virtual void OnChannelOpened(bool pause);
+ virtual void OnChannelOpened();
virtual void OnChannelClosed();
// Called on the consumers thread when the ChannelProxy is closed. At that
« no previous file with comments | « ipc/ipc_channel_mojo_unittest.cc ('k') | ipc/ipc_channel_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698