OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_EDK_SYSTEM_CHANNEL_ENDPOINT_H_ | 5 #ifndef MOJO_EDK_SYSTEM_CHANNEL_ENDPOINT_H_ |
6 #define MOJO_EDK_SYSTEM_CHANNEL_ENDPOINT_H_ | 6 #define MOJO_EDK_SYSTEM_CHANNEL_ENDPOINT_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 | 124 |
125 // TODO(vtl): This currently only works if we're "running". We'll move the | 125 // TODO(vtl): This currently only works if we're "running". We'll move the |
126 // "paused message queue" here (will this be needed when we have | 126 // "paused message queue" here (will this be needed when we have |
127 // locally-allocated remote IDs?). | 127 // locally-allocated remote IDs?). |
128 bool EnqueueMessage(scoped_ptr<MessageInTransit> message); | 128 bool EnqueueMessage(scoped_ptr<MessageInTransit> message); |
129 | 129 |
130 void DetachFromMessagePipe(); | 130 void DetachFromMessagePipe(); |
131 | 131 |
132 // Methods called by |Channel|: | 132 // Methods called by |Channel|: |
133 | 133 |
134 // TODO(vtl): Remove these once we've switched over to |AttachAndRun()|. | |
135 void AttachToChannel(Channel* channel, ChannelEndpointId local_id); | |
136 void Run(ChannelEndpointId remote_id); | |
137 | |
138 // Called by |Channel| when it takes a reference to this object. It will send | 134 // Called by |Channel| when it takes a reference to this object. It will send |
139 // all queue messages (in |paused_message_queue_|). | 135 // all queue messages (in |paused_message_queue_|). |
140 // TODO(vtl): Maybe rename this "OnAttach"? | 136 // TODO(vtl): Maybe rename this "OnAttach"? |
141 void AttachAndRun(Channel* channel, | 137 void AttachAndRun(Channel* channel, |
142 ChannelEndpointId local_id, | 138 ChannelEndpointId local_id, |
143 ChannelEndpointId remote_id); | 139 ChannelEndpointId remote_id); |
144 | 140 |
145 // Called by |Channel| when it receives a message for the message pipe. | 141 // Called by |Channel| when it receives a message for the message pipe. |
146 bool OnReadMessage(const MessageInTransit::View& message_view, | 142 bool OnReadMessage(const MessageInTransit::View& message_view, |
147 embedder::ScopedPlatformHandleVectorPtr platform_handles); | 143 embedder::ScopedPlatformHandleVectorPtr platform_handles); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 // messages. | 185 // messages. |
190 MessageInTransitQueue paused_message_queue_; | 186 MessageInTransitQueue paused_message_queue_; |
191 | 187 |
192 DISALLOW_COPY_AND_ASSIGN(ChannelEndpoint); | 188 DISALLOW_COPY_AND_ASSIGN(ChannelEndpoint); |
193 }; | 189 }; |
194 | 190 |
195 } // namespace system | 191 } // namespace system |
196 } // namespace mojo | 192 } // namespace mojo |
197 | 193 |
198 #endif // MOJO_EDK_SYSTEM_CHANNEL_ENDPOINT_H_ | 194 #endif // MOJO_EDK_SYSTEM_CHANNEL_ENDPOINT_H_ |
OLD | NEW |