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_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 "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "mojo/edk/system/dispatcher.h" | 10 #include "mojo/edk/system/dispatcher.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 | 66 |
67 // Gets a dumb pointer to |message_pipe_|. This must be called under the | 67 // Gets a dumb pointer to |message_pipe_|. This must be called under the |
68 // |Dispatcher| lock (that it's a dumb pointer is okay since it's under lock). | 68 // |Dispatcher| lock (that it's a dumb pointer is okay since it's under lock). |
69 // This is needed when sending handles across processes, where nontrivial, | 69 // This is needed when sending handles across processes, where nontrivial, |
70 // invasive work needs to be done. | 70 // invasive work needs to be done. |
71 MessagePipe* GetMessagePipeNoLock() const; | 71 MessagePipe* GetMessagePipeNoLock() const; |
72 // Similarly for the port. | 72 // Similarly for the port. |
73 unsigned GetPortNoLock() const; | 73 unsigned GetPortNoLock() const; |
74 | 74 |
75 // |Dispatcher| protected methods: | 75 // |Dispatcher| protected methods: |
76 void CancelAllWaitersNoLock() override; | 76 void CancelAllAwakablesNoLock() override; |
77 void CloseImplNoLock() override; | 77 void CloseImplNoLock() override; |
78 scoped_refptr<Dispatcher> CreateEquivalentDispatcherAndCloseImplNoLock() | 78 scoped_refptr<Dispatcher> CreateEquivalentDispatcherAndCloseImplNoLock() |
79 override; | 79 override; |
80 MojoResult WriteMessageImplNoLock( | 80 MojoResult WriteMessageImplNoLock( |
81 UserPointer<const void> bytes, | 81 UserPointer<const void> bytes, |
82 uint32_t num_bytes, | 82 uint32_t num_bytes, |
83 std::vector<DispatcherTransport>* transports, | 83 std::vector<DispatcherTransport>* transports, |
84 MojoWriteMessageFlags flags) override; | 84 MojoWriteMessageFlags flags) override; |
85 MojoResult ReadMessageImplNoLock(UserPointer<void> bytes, | 85 MojoResult ReadMessageImplNoLock(UserPointer<void> bytes, |
86 UserPointer<uint32_t> num_bytes, | 86 UserPointer<uint32_t> num_bytes, |
87 DispatcherVector* dispatchers, | 87 DispatcherVector* dispatchers, |
88 uint32_t* num_dispatchers, | 88 uint32_t* num_dispatchers, |
89 MojoReadMessageFlags flags) override; | 89 MojoReadMessageFlags flags) override; |
90 HandleSignalsState GetHandleSignalsStateImplNoLock() const override; | 90 HandleSignalsState GetHandleSignalsStateImplNoLock() const override; |
91 MojoResult AddWaiterImplNoLock(Waiter* waiter, | 91 MojoResult AddAwakableImplNoLock(Awakable* awakable, |
92 MojoHandleSignals signals, | 92 MojoHandleSignals signals, |
93 uint32_t context, | 93 uint32_t context, |
94 HandleSignalsState* signals_state) override; | 94 HandleSignalsState* signals_state) override; |
95 void RemoveWaiterImplNoLock(Waiter* waiter, | 95 void RemoveAwakableImplNoLock(Awakable* awakable, |
96 HandleSignalsState* signals_state) override; | 96 HandleSignalsState* signals_state) override; |
97 void StartSerializeImplNoLock(Channel* channel, | 97 void StartSerializeImplNoLock(Channel* channel, |
98 size_t* max_size, | 98 size_t* max_size, |
99 size_t* max_platform_handles) override; | 99 size_t* max_platform_handles) override; |
100 bool EndSerializeAndCloseImplNoLock( | 100 bool EndSerializeAndCloseImplNoLock( |
101 Channel* channel, | 101 Channel* channel, |
102 void* destination, | 102 void* destination, |
103 size_t* actual_size, | 103 size_t* actual_size, |
104 embedder::PlatformHandleVector* platform_handles) override; | 104 embedder::PlatformHandleVector* platform_handles) override; |
105 | 105 |
106 // Protected by |lock()|: | 106 // Protected by |lock()|: |
(...skipping 17 matching lines...) Expand all Loading... |
124 return static_cast<MessagePipeDispatcher*>(dispatcher()); | 124 return static_cast<MessagePipeDispatcher*>(dispatcher()); |
125 } | 125 } |
126 | 126 |
127 // Copy and assign allowed. | 127 // Copy and assign allowed. |
128 }; | 128 }; |
129 | 129 |
130 } // namespace system | 130 } // namespace system |
131 } // namespace mojo | 131 } // namespace mojo |
132 | 132 |
133 #endif // MOJO_EDK_SYSTEM_MESSAGE_PIPE_DISPATCHER_H_ | 133 #endif // MOJO_EDK_SYSTEM_MESSAGE_PIPE_DISPATCHER_H_ |
OLD | NEW |