| 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_EDK_SYSTEM_CHANNEL_H_ | 5 #ifndef MOJO_EDK_SYSTEM_CHANNEL_H_ |
| 6 #define MOJO_EDK_SYSTEM_CHANNEL_H_ | 6 #define MOJO_EDK_SYSTEM_CHANNEL_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 ~Channel() override; | 184 ~Channel() override; |
| 185 | 185 |
| 186 // Helper for |DetachEndpoint()| (returns true if a "remove" should be sent). | 186 // Helper for |DetachEndpoint()| (returns true if a "remove" should be sent). |
| 187 bool DetachEndpointInternal(ChannelEndpoint* endpoint, | 187 bool DetachEndpointInternal(ChannelEndpoint* endpoint, |
| 188 ChannelEndpointId local_id, | 188 ChannelEndpointId local_id, |
| 189 ChannelEndpointId remote_id); | 189 ChannelEndpointId remote_id); |
| 190 | 190 |
| 191 // |RawChannel::Delegate| implementation (only called on the creation thread): | 191 // |RawChannel::Delegate| implementation (only called on the creation thread): |
| 192 void OnReadMessage( | 192 void OnReadMessage( |
| 193 const MessageInTransit::View& message_view, | 193 const MessageInTransit::View& message_view, |
| 194 embedder::ScopedPlatformHandleVectorPtr platform_handles) override; | 194 std::unique_ptr<std::vector<embedder::ScopedPlatformHandle>> |
| 195 platform_handles) override; |
| 195 void OnError(Error error) override; | 196 void OnError(Error error) override; |
| 196 | 197 |
| 197 // Helpers for |OnReadMessage| (only called on the creation thread): | 198 // Helpers for |OnReadMessage| (only called on the creation thread): |
| 198 void OnReadMessageForEndpoint( | 199 void OnReadMessageForEndpoint( |
| 199 const MessageInTransit::View& message_view, | 200 const MessageInTransit::View& message_view, |
| 200 embedder::ScopedPlatformHandleVectorPtr platform_handles); | 201 std::unique_ptr<std::vector<embedder::ScopedPlatformHandle>> |
| 202 platform_handles); |
| 201 void OnReadMessageForChannel( | 203 void OnReadMessageForChannel( |
| 202 const MessageInTransit::View& message_view, | 204 const MessageInTransit::View& message_view, |
| 203 embedder::ScopedPlatformHandleVectorPtr platform_handles); | 205 std::unique_ptr<std::vector<embedder::ScopedPlatformHandle>> |
| 206 platform_handles); |
| 204 | 207 |
| 205 // Handles "attach and run endpoint" messages. | 208 // Handles "attach and run endpoint" messages. |
| 206 bool OnAttachAndRunEndpoint(ChannelEndpointId local_id, | 209 bool OnAttachAndRunEndpoint(ChannelEndpointId local_id, |
| 207 ChannelEndpointId remote_id); | 210 ChannelEndpointId remote_id); |
| 208 // Handles "remove endpoint" messages. | 211 // Handles "remove endpoint" messages. |
| 209 bool OnRemoveEndpoint(ChannelEndpointId local_id, | 212 bool OnRemoveEndpoint(ChannelEndpointId local_id, |
| 210 ChannelEndpointId remote_id); | 213 ChannelEndpointId remote_id); |
| 211 // Handles "remove endpoint ack" messages. | 214 // Handles "remove endpoint ack" messages. |
| 212 bool OnRemoveEndpointAck(ChannelEndpointId local_id); | 215 bool OnRemoveEndpointAck(ChannelEndpointId local_id); |
| 213 | 216 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 // if/when we wrap). | 281 // if/when we wrap). |
| 279 RemoteChannelEndpointIdGenerator remote_id_generator_ MOJO_GUARDED_BY(mutex_); | 282 RemoteChannelEndpointIdGenerator remote_id_generator_ MOJO_GUARDED_BY(mutex_); |
| 280 | 283 |
| 281 MOJO_DISALLOW_COPY_AND_ASSIGN(Channel); | 284 MOJO_DISALLOW_COPY_AND_ASSIGN(Channel); |
| 282 }; | 285 }; |
| 283 | 286 |
| 284 } // namespace system | 287 } // namespace system |
| 285 } // namespace mojo | 288 } // namespace mojo |
| 286 | 289 |
| 287 #endif // MOJO_EDK_SYSTEM_CHANNEL_H_ | 290 #endif // MOJO_EDK_SYSTEM_CHANNEL_H_ |
| OLD | NEW |