| OLD | NEW |
| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 // This is called by the dispatcher to convert a local endpoint to a proxy | 88 // This is called by the dispatcher to convert a local endpoint to a proxy |
| 89 // endpoint. | 89 // endpoint. |
| 90 scoped_refptr<ChannelEndpoint> ConvertLocalToProxy(unsigned port); | 90 scoped_refptr<ChannelEndpoint> ConvertLocalToProxy(unsigned port); |
| 91 | 91 |
| 92 // This is used by |Channel| to enqueue messages (typically to a | 92 // This is used by |Channel| to enqueue messages (typically to a |
| 93 // |LocalMessagePipeEndpoint|). Unlike |WriteMessage()|, |port| is the | 93 // |LocalMessagePipeEndpoint|). Unlike |WriteMessage()|, |port| is the |
| 94 // *destination* port. | 94 // *destination* port. |
| 95 MojoResult EnqueueMessage(unsigned port, | 95 MojoResult EnqueueMessage(unsigned port, |
| 96 scoped_ptr<MessageInTransit> message); | 96 scoped_ptr<MessageInTransit> message); |
| 97 | 97 |
| 98 // This is used by |Channel|. TODO(vtl): Rename it (and have the | |
| 99 // |ChannelEndpoint| call it instead). | |
| 100 void OnRemove(unsigned port); | |
| 101 | |
| 102 private: | 98 private: |
| 103 MessagePipe(); | 99 MessagePipe(); |
| 104 | 100 |
| 105 friend class base::RefCountedThreadSafe<MessagePipe>; | 101 friend class base::RefCountedThreadSafe<MessagePipe>; |
| 106 virtual ~MessagePipe(); | 102 virtual ~MessagePipe(); |
| 107 | 103 |
| 108 // This is used internally by |WriteMessage()| and by |EnqueueMessage()|. | 104 // This is used internally by |WriteMessage()| and by |EnqueueMessage()|. |
| 109 // |transports| may be non-null only if it's nonempty and |message| has no | 105 // |transports| may be non-null only if it's nonempty and |message| has no |
| 110 // dispatchers attached. | 106 // dispatchers attached. |
| 111 MojoResult EnqueueMessageInternal( | 107 MojoResult EnqueueMessageInternal( |
| (...skipping 15 matching lines...) Expand all Loading... |
| 127 base::Lock lock_; // Protects the following members. | 123 base::Lock lock_; // Protects the following members. |
| 128 scoped_ptr<MessagePipeEndpoint> endpoints_[2]; | 124 scoped_ptr<MessagePipeEndpoint> endpoints_[2]; |
| 129 | 125 |
| 130 DISALLOW_COPY_AND_ASSIGN(MessagePipe); | 126 DISALLOW_COPY_AND_ASSIGN(MessagePipe); |
| 131 }; | 127 }; |
| 132 | 128 |
| 133 } // namespace system | 129 } // namespace system |
| 134 } // namespace mojo | 130 } // namespace mojo |
| 135 | 131 |
| 136 #endif // MOJO_SYSTEM_MESSAGE_PIPE_H_ | 132 #endif // MOJO_SYSTEM_MESSAGE_PIPE_H_ |
| OLD | NEW |