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

Side by Side Diff: mojo/system/message_pipe.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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « mojo/system/message_in_transit.cc ('k') | mojo/system/message_pipe.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MOJO_SYSTEM_MESSAGE_PIPE_H_ 5 #ifndef MOJO_SYSTEM_MESSAGE_PIPE_H_
6 #define MOJO_SYSTEM_MESSAGE_PIPE_H_ 6 #define MOJO_SYSTEM_MESSAGE_PIPE_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 // This is used internally by |WriteMessage()| and by |Channel| to enqueue 74 // This is used internally by |WriteMessage()| and by |Channel| to enqueue
75 // messages (typically to a |LocalMessagePipeEndpoint|). Unlike 75 // messages (typically to a |LocalMessagePipeEndpoint|). Unlike
76 // |WriteMessage()|, |port| is the *destination* port. |transports| should be 76 // |WriteMessage()|, |port| is the *destination* port. |transports| should be
77 // non-null only if it's nonempty, and only if |message| has no dispatchers 77 // non-null only if it's nonempty, and only if |message| has no dispatchers
78 // attached. 78 // attached.
79 MojoResult EnqueueMessage(unsigned port, 79 MojoResult EnqueueMessage(unsigned port,
80 scoped_ptr<MessageInTransit> message, 80 scoped_ptr<MessageInTransit> message,
81 std::vector<DispatcherTransport>* transports); 81 std::vector<DispatcherTransport>* transports);
82 82
83 // These are used by |Channel|. 83 // These are used by |Channel|.
84 void Attach(unsigned port, 84 bool Attach(unsigned port,
85 scoped_refptr<Channel> channel, 85 scoped_refptr<Channel> channel,
86 MessageInTransit::EndpointId local_id); 86 MessageInTransit::EndpointId local_id);
87 void Run(unsigned port, MessageInTransit::EndpointId remote_id); 87 void Run(unsigned port, MessageInTransit::EndpointId remote_id);
88 void OnRemove(unsigned port);
88 89
89 private: 90 private:
90 friend class base::RefCountedThreadSafe<MessagePipe>; 91 friend class base::RefCountedThreadSafe<MessagePipe>;
91 virtual ~MessagePipe(); 92 virtual ~MessagePipe();
92 93
93 // Used by |EnqueueMessage()| to handle control messages that are actually 94 // Used by |EnqueueMessage()| to handle control messages that are actually
94 // meant for us. 95 // meant for us.
95 MojoResult HandleControlMessage(unsigned port, 96 MojoResult HandleControlMessage(unsigned port,
96 scoped_ptr<MessageInTransit> message); 97 scoped_ptr<MessageInTransit> message);
97 98
98 base::Lock lock_; // Protects the following members. 99 base::Lock lock_; // Protects the following members.
99 scoped_ptr<MessagePipeEndpoint> endpoints_[2]; 100 scoped_ptr<MessagePipeEndpoint> endpoints_[2];
100 101
101 DISALLOW_COPY_AND_ASSIGN(MessagePipe); 102 DISALLOW_COPY_AND_ASSIGN(MessagePipe);
102 }; 103 };
103 104
104 } // namespace system 105 } // namespace system
105 } // namespace mojo 106 } // namespace mojo
106 107
107 #endif // MOJO_SYSTEM_MESSAGE_PIPE_H_ 108 #endif // MOJO_SYSTEM_MESSAGE_PIPE_H_
OLDNEW
« no previous file with comments | « mojo/system/message_in_transit.cc ('k') | mojo/system/message_pipe.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698