| 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 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 | 299 |
| 300 private: | 300 private: |
| 301 RTC_DISALLOW_COPY_AND_ASSIGN(AutoThread); | 301 RTC_DISALLOW_COPY_AND_ASSIGN(AutoThread); |
| 302 }; | 302 }; |
| 303 | 303 |
| 304 // Win32 extension for threads that need to use COM | 304 // Win32 extension for threads that need to use COM |
| 305 #if defined(WEBRTC_WIN) | 305 #if defined(WEBRTC_WIN) |
| 306 class ComThread : public Thread { | 306 class ComThread : public Thread { |
| 307 public: | 307 public: |
| 308 ComThread() {} | 308 ComThread() {} |
| 309 ~ComThread() override { Stop(); } | 309 ~ComThread() override; |
| 310 | 310 |
| 311 protected: | 311 protected: |
| 312 void Run() override; | 312 void Run() override; |
| 313 | 313 |
| 314 private: | 314 private: |
| 315 RTC_DISALLOW_COPY_AND_ASSIGN(ComThread); | 315 RTC_DISALLOW_COPY_AND_ASSIGN(ComThread); |
| 316 }; | 316 }; |
| 317 #endif | 317 #endif |
| 318 | 318 |
| 319 // Provides an easy way to install/uninstall a socketserver on a thread. | 319 // Provides an easy way to install/uninstall a socketserver on a thread. |
| 320 class SocketServerScope { | 320 class SocketServerScope { |
| 321 public: | 321 public: |
| 322 explicit SocketServerScope(SocketServer* ss) { | 322 explicit SocketServerScope(SocketServer* ss) { |
| 323 old_ss_ = Thread::Current()->socketserver(); | 323 old_ss_ = Thread::Current()->socketserver(); |
| 324 Thread::Current()->set_socketserver(ss); | 324 Thread::Current()->set_socketserver(ss); |
| 325 } | 325 } |
| 326 ~SocketServerScope() { | 326 ~SocketServerScope() { |
| 327 Thread::Current()->set_socketserver(old_ss_); | 327 Thread::Current()->set_socketserver(old_ss_); |
| 328 } | 328 } |
| 329 | 329 |
| 330 private: | 330 private: |
| 331 SocketServer* old_ss_; | 331 SocketServer* old_ss_; |
| 332 | 332 |
| 333 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(SocketServerScope); | 333 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(SocketServerScope); |
| 334 }; | 334 }; |
| 335 | 335 |
| 336 } // namespace rtc | 336 } // namespace rtc |
| 337 | 337 |
| 338 #endif // WEBRTC_BASE_THREAD_H_ | 338 #endif // WEBRTC_BASE_THREAD_H_ |
| OLD | NEW |