OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
161 // Uses Send() internally, which blocks the current thread until execution | 161 // Uses Send() internally, which blocks the current thread until execution |
162 // is complete. | 162 // is complete. |
163 // Ex: bool result = thread.Invoke<bool>(RTC_FROM_HERE, | 163 // Ex: bool result = thread.Invoke<bool>(RTC_FROM_HERE, |
164 // &MyFunctionReturningBool); | 164 // &MyFunctionReturningBool); |
165 // NOTE: This function can only be called when synchronous calls are allowed. | 165 // NOTE: This function can only be called when synchronous calls are allowed. |
166 // See ScopedDisallowBlockingCalls for details. | 166 // See ScopedDisallowBlockingCalls for details. |
167 template <class ReturnT, class FunctorT> | 167 template <class ReturnT, class FunctorT> |
168 ReturnT Invoke(const Location& posted_from, const FunctorT& functor) { | 168 ReturnT Invoke(const Location& posted_from, const FunctorT& functor) { |
169 FunctorMessageHandler<ReturnT, FunctorT> handler(functor); | 169 FunctorMessageHandler<ReturnT, FunctorT> handler(functor); |
170 InvokeInternal(posted_from, &handler); | 170 InvokeInternal(posted_from, &handler); |
171 return handler.result(); | 171 return handler.moved_result(); |
pthatcher1
2017/02/08 01:33:49
This seems like a big enough change to warrant its
Taylor Brandstetter
2017/02/10 00:19:45
Done.
| |
172 } | 172 } |
173 | 173 |
174 // From MessageQueue | 174 // From MessageQueue |
175 void Clear(MessageHandler* phandler, | 175 void Clear(MessageHandler* phandler, |
176 uint32_t id = MQID_ANY, | 176 uint32_t id = MQID_ANY, |
177 MessageList* removed = NULL) override; | 177 MessageList* removed = NULL) override; |
178 void ReceiveSends() override; | 178 void ReceiveSends() override; |
179 | 179 |
180 // ProcessMessages will process I/O and dispatch messages until: | 180 // ProcessMessages will process I/O and dispatch messages until: |
181 // 1) cms milliseconds have elapsed (returns true) | 181 // 1) cms milliseconds have elapsed (returns true) |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
325 | 325 |
326 private: | 326 private: |
327 SocketServer* old_ss_; | 327 SocketServer* old_ss_; |
328 | 328 |
329 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(SocketServerScope); | 329 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(SocketServerScope); |
330 }; | 330 }; |
331 | 331 |
332 } // namespace rtc | 332 } // namespace rtc |
333 | 333 |
334 #endif // WEBRTC_BASE_THREAD_H_ | 334 #endif // WEBRTC_BASE_THREAD_H_ |
OLD | NEW |