| 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 |
| 134 // Called by |Channel| when it takes a reference to this object. It will send | 138 // Called by |Channel| when it takes a reference to this object. It will send |
| 135 // all queue messages (in |paused_message_queue_|). | 139 // all queue messages (in |paused_message_queue_|). |
| 136 // TODO(vtl): Maybe rename this "OnAttach"? | 140 // TODO(vtl): Maybe rename this "OnAttach"? |
| 137 void AttachAndRun(Channel* channel, | 141 void AttachAndRun(Channel* channel, |
| 138 ChannelEndpointId local_id, | 142 ChannelEndpointId local_id, |
| 139 ChannelEndpointId remote_id); | 143 ChannelEndpointId remote_id); |
| 140 | 144 |
| 141 // Called by |Channel| when it receives a message for the message pipe. | 145 // Called by |Channel| when it receives a message for the message pipe. |
| 142 bool OnReadMessage(const MessageInTransit::View& message_view, | 146 bool OnReadMessage(const MessageInTransit::View& message_view, |
| 143 embedder::ScopedPlatformHandleVectorPtr platform_handles); | 147 embedder::ScopedPlatformHandleVectorPtr platform_handles); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 // messages. | 189 // messages. |
| 186 MessageInTransitQueue paused_message_queue_; | 190 MessageInTransitQueue paused_message_queue_; |
| 187 | 191 |
| 188 DISALLOW_COPY_AND_ASSIGN(ChannelEndpoint); | 192 DISALLOW_COPY_AND_ASSIGN(ChannelEndpoint); |
| 189 }; | 193 }; |
| 190 | 194 |
| 191 } // namespace system | 195 } // namespace system |
| 192 } // namespace mojo | 196 } // namespace mojo |
| 193 | 197 |
| 194 #endif // MOJO_EDK_SYSTEM_CHANNEL_ENDPOINT_H_ | 198 #endif // MOJO_EDK_SYSTEM_CHANNEL_ENDPOINT_H_ |
| OLD | NEW |