| 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 // These are used by |Channel|. | 98 // These are used by |Channel|. |
| 99 // TODO(vtl): Remove |Attach()|. | |
| 100 bool Attach(unsigned port, ChannelEndpoint* channel_endpoint); | |
| 101 void Run(unsigned port); | 99 void Run(unsigned port); |
| 102 void OnRemove(unsigned port); | 100 void OnRemove(unsigned port); |
| 103 | 101 |
| 104 private: | 102 private: |
| 105 MessagePipe(); | 103 MessagePipe(); |
| 106 | 104 |
| 107 friend class base::RefCountedThreadSafe<MessagePipe>; | 105 friend class base::RefCountedThreadSafe<MessagePipe>; |
| 108 virtual ~MessagePipe(); | 106 virtual ~MessagePipe(); |
| 109 | 107 |
| 110 // This is used internally by |WriteMessage()| and by |EnqueueMessage()|. | 108 // This is used internally by |WriteMessage()| and by |EnqueueMessage()|. |
| (...skipping 18 matching lines...) Expand all Loading... |
| 129 base::Lock lock_; // Protects the following members. | 127 base::Lock lock_; // Protects the following members. |
| 130 scoped_ptr<MessagePipeEndpoint> endpoints_[2]; | 128 scoped_ptr<MessagePipeEndpoint> endpoints_[2]; |
| 131 | 129 |
| 132 DISALLOW_COPY_AND_ASSIGN(MessagePipe); | 130 DISALLOW_COPY_AND_ASSIGN(MessagePipe); |
| 133 }; | 131 }; |
| 134 | 132 |
| 135 } // namespace system | 133 } // namespace system |
| 136 } // namespace mojo | 134 } // namespace mojo |
| 137 | 135 |
| 138 #endif // MOJO_SYSTEM_MESSAGE_PIPE_H_ | 136 #endif // MOJO_SYSTEM_MESSAGE_PIPE_H_ |
| OLD | NEW |