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_H_ | 5 #ifndef MOJO_EDK_SYSTEM_MESSAGE_PIPE_H_ |
6 #define MOJO_EDK_SYSTEM_MESSAGE_PIPE_H_ | 6 #define MOJO_EDK_SYSTEM_MESSAGE_PIPE_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 Channel* channel, | 110 Channel* channel, |
111 size_t* max_size, | 111 size_t* max_size, |
112 size_t* max_platform_handles); | 112 size_t* max_platform_handles); |
113 bool EndSerialize( | 113 bool EndSerialize( |
114 unsigned port, | 114 unsigned port, |
115 Channel* channel, | 115 Channel* channel, |
116 void* destination, | 116 void* destination, |
117 size_t* actual_size, | 117 size_t* actual_size, |
118 std::vector<platform::ScopedPlatformHandle>* platform_handles); | 118 std::vector<platform::ScopedPlatformHandle>* platform_handles); |
119 | 119 |
| 120 // This "implements" |CancelAllAwakables()|, but assumes that |mutex_| is |
| 121 // already held. This is for use by |
| 122 // |MessagePipeDispatcher::CreateEquivalentDispatcherAndCloseImplNoLock()|. |
| 123 void CancelAllAwakablesNoLock(unsigned port) |
| 124 MOJO_EXCLUSIVE_LOCKS_REQUIRED(mutex_); |
| 125 |
120 // |ChannelEndpointClient| methods: | 126 // |ChannelEndpointClient| methods: |
121 bool OnReadMessage(unsigned port, MessageInTransit* message) override; | 127 bool OnReadMessage(unsigned port, MessageInTransit* message) override; |
122 void OnDetachFromChannel(unsigned port) override; | 128 void OnDetachFromChannel(unsigned port) override; |
123 | 129 |
124 private: | 130 private: |
125 MessagePipe(); | 131 MessagePipe(); |
126 ~MessagePipe() override; | 132 ~MessagePipe() override; |
127 | 133 |
128 // This is used internally by |WriteMessage()| and by |OnReadMessage()|. | 134 // This is used internally by |WriteMessage()| and by |OnReadMessage()|. |
129 // |transports| may be non-null only if it's nonempty and |message| has no | 135 // |transports| may be non-null only if it's nonempty and |message| has no |
(...skipping 13 matching lines...) Expand all Loading... |
143 mutable util::Mutex mutex_; | 149 mutable util::Mutex mutex_; |
144 std::unique_ptr<MessagePipeEndpoint> endpoints_[2] MOJO_GUARDED_BY(mutex_); | 150 std::unique_ptr<MessagePipeEndpoint> endpoints_[2] MOJO_GUARDED_BY(mutex_); |
145 | 151 |
146 MOJO_DISALLOW_COPY_AND_ASSIGN(MessagePipe); | 152 MOJO_DISALLOW_COPY_AND_ASSIGN(MessagePipe); |
147 }; | 153 }; |
148 | 154 |
149 } // namespace system | 155 } // namespace system |
150 } // namespace mojo | 156 } // namespace mojo |
151 | 157 |
152 #endif // MOJO_EDK_SYSTEM_MESSAGE_PIPE_H_ | 158 #endif // MOJO_EDK_SYSTEM_MESSAGE_PIPE_H_ |
OLD | NEW |