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

Unified Diff: mojo/system/message_pipe_endpoint.h

Issue 240133005: Mojo: Make some attempts towards fixing remote message pipe closure. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix some locking issues Created 6 years, 8 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 | « mojo/system/message_pipe_dispatcher.cc ('k') | mojo/system/message_pipe_endpoint.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/system/message_pipe_endpoint.h
diff --git a/mojo/system/message_pipe_endpoint.h b/mojo/system/message_pipe_endpoint.h
index b7b9589450a92923015b928295f1e1d1c4ec099d..d14c58a6274f3a4ac2eefbb0311ac4c9ad7c1064 100644
--- a/mojo/system/message_pipe_endpoint.h
+++ b/mojo/system/message_pipe_endpoint.h
@@ -42,8 +42,8 @@ class MOJO_SYSTEM_IMPL_EXPORT MessagePipeEndpoint {
virtual Type GetType() const = 0;
// All implementations must implement these.
- virtual void Close() = 0;
- virtual void OnPeerClose() = 0;
+ // Returns false if the endpoint should be closed and destroyed, else true.
+ virtual bool OnPeerClose() = 0;
// Implements |MessagePipe::EnqueueMessage()|. The major differences are that:
// a) Dispatchers have been vetted and cloned/attached to the message.
// b) At this point, we cannot report failure (if, e.g., a channel is torn
@@ -58,6 +58,7 @@ class MOJO_SYSTEM_IMPL_EXPORT MessagePipeEndpoint {
// These methods implement the methods of the same name in |MessagePipe|,
// though |MessagePipe|'s implementation may have to do a little more if the
// operation involves both endpoints.
+ virtual void Close();
virtual void CancelAllWaiters();
virtual MojoResult ReadMessage(
void* bytes, uint32_t* num_bytes,
@@ -74,7 +75,9 @@ class MOJO_SYSTEM_IMPL_EXPORT MessagePipeEndpoint {
// they should never be called.
virtual void Attach(scoped_refptr<Channel> channel,
MessageInTransit::EndpointId local_id);
- virtual void Run(MessageInTransit::EndpointId remote_id);
+ // Returns false if the endpoint should be closed and destroyed, else true.
+ virtual bool Run(MessageInTransit::EndpointId remote_id);
+ virtual void OnRemove();
protected:
MessagePipeEndpoint() {}
« no previous file with comments | « mojo/system/message_pipe_dispatcher.cc ('k') | mojo/system/message_pipe_endpoint.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698