summaryrefslogtreecommitdiffstats
path: root/mojo/system/message_pipe_endpoint.h
diff options
context:
space:
mode:
authorviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-27 07:11:36 +0000
committerviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-27 07:11:36 +0000
commite2bdf91a6e00d639151839fd20fd187124150c54 (patch)
tree8209c9eb74cafdbba7dd52d222d1e253fee95491 /mojo/system/message_pipe_endpoint.h
parentff32a64e062e9a61047445f971167700dfb0a481 (diff)
downloadchromium_src-e2bdf91a6e00d639151839fd20fd187124150c54.zip
chromium_src-e2bdf91a6e00d639151839fd20fd187124150c54.tar.gz
chromium_src-e2bdf91a6e00d639151839fd20fd187124150c54.tar.bz2
Mojo: Eliminate some "cross-process" "simultaneous"-close races.
Don't detach an endpoint from a channel, unless the remote has sent us a message (kSubtypeMessagePipePeerClosed) that it has gone away. In particular, detach early -- even if the local side has gone away. There is no way to detach early safely, since we might conceivably end up reusing the ID (and then getting stale messages). (This "commonly" caused a CHECK failure in EmbedderTest.ChannelsBasic, but it can actually be reproduced in-process, communicating over a real pipe. There are other, non-asserting situations in which you'd get a "Received a message for nonexistent local destination ID <n>" warning. These are other aspects of the same bug.) R=darin@chromium.org BUG=335274 Review URL: https://codereview.chromium.org/143953015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@247203 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'mojo/system/message_pipe_endpoint.h')
-rw-r--r--mojo/system/message_pipe_endpoint.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/mojo/system/message_pipe_endpoint.h b/mojo/system/message_pipe_endpoint.h
index 7017596..835b966 100644
--- a/mojo/system/message_pipe_endpoint.h
+++ b/mojo/system/message_pipe_endpoint.h
@@ -36,8 +36,7 @@ class MOJO_SYSTEM_IMPL_EXPORT MessagePipeEndpoint {
// All implementations must implement these.
virtual void Close() = 0;
- // Returns false if the endpoint should be closed and destroyed, else true.
- virtual bool OnPeerClose() = 0;
+ virtual void OnPeerClose() = 0;
// Checks if |EnqueueMessage()| will be able to enqueue the given message
// (with the given set of dispatchers). |dispatchers| should be non-null only
// if it's nonempty. Returns |MOJO_RESULT_OK| if it will and an appropriate
@@ -77,8 +76,7 @@ class MOJO_SYSTEM_IMPL_EXPORT MessagePipeEndpoint {
// they should never be called.
virtual void Attach(scoped_refptr<Channel> channel,
MessageInTransit::EndpointId local_id);
- // Returns false if the endpoint should be closed and destroyed, else true.
- virtual bool Run(MessageInTransit::EndpointId remote_id);
+ virtual void Run(MessageInTransit::EndpointId remote_id);
protected:
MessagePipeEndpoint() {}