| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_MESSAGE_PIPE_DISPATCHER_H_ | 5 #ifndef MOJO_EDK_SYSTEM_MESSAGE_PIPE_DISPATCHER_H_ |
| 6 #define MOJO_EDK_SYSTEM_MESSAGE_PIPE_DISPATCHER_H_ | 6 #define MOJO_EDK_SYSTEM_MESSAGE_PIPE_DISPATCHER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <queue> | 11 #include <queue> |
| 12 | 12 |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "mojo/edk/system/atomic_flag.h" | 14 #include "mojo/edk/system/atomic_flag.h" |
| 15 #include "mojo/edk/system/awakable_list.h" | 15 #include "mojo/edk/system/awakable_list.h" |
| 16 #include "mojo/edk/system/dispatcher.h" | 16 #include "mojo/edk/system/dispatcher.h" |
| 17 #include "mojo/edk/system/message_for_transit.h" | 17 #include "mojo/edk/system/message_for_transit.h" |
| 18 #include "mojo/edk/system/ports/port_ref.h" | 18 #include "mojo/edk/system/ports/port_ref.h" |
| 19 | 19 |
| 20 namespace mojo { | 20 namespace mojo { |
| 21 namespace edk { | 21 namespace edk { |
| 22 | 22 |
| 23 class NodeController; | 23 class NodeController; |
| 24 class PortsMessage; | |
| 25 | 24 |
| 26 class MessagePipeDispatcher : public Dispatcher { | 25 class MessagePipeDispatcher : public Dispatcher { |
| 27 public: | 26 public: |
| 28 // Constructs a MessagePipeDispatcher permanently tied to a specific port. | 27 // Constructs a MessagePipeDispatcher permanently tied to a specific port. |
| 29 // |connected| must indicate the state of the port at construction time; if | 28 // |connected| must indicate the state of the port at construction time; if |
| 30 // the port is initialized with a peer, |connected| must be true. Otherwise it | 29 // the port is initialized with a peer, |connected| must be true. Otherwise it |
| 31 // must be false. | 30 // must be false. |
| 32 // | 31 // |
| 33 // A MessagePipeDispatcher may not be transferred while in a disconnected | 32 // A MessagePipeDispatcher may not be transferred while in a disconnected |
| 34 // state, and one can never return to a disconnected once connected. | 33 // state, and one can never return to a disconnected once connected. |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 AtomicFlag port_closed_; | 112 AtomicFlag port_closed_; |
| 114 AwakableList awakables_; | 113 AwakableList awakables_; |
| 115 | 114 |
| 116 DISALLOW_COPY_AND_ASSIGN(MessagePipeDispatcher); | 115 DISALLOW_COPY_AND_ASSIGN(MessagePipeDispatcher); |
| 117 }; | 116 }; |
| 118 | 117 |
| 119 } // namespace edk | 118 } // namespace edk |
| 120 } // namespace mojo | 119 } // namespace mojo |
| 121 | 120 |
| 122 #endif // MOJO_EDK_SYSTEM_MESSAGE_PIPE_DISPATCHER_H_ | 121 #endif // MOJO_EDK_SYSTEM_MESSAGE_PIPE_DISPATCHER_H_ |
| OLD | NEW |