| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2013 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 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 WORKER_PROXY_MAP_BOILERPLATE(c) \ | 431 WORKER_PROXY_MAP_BOILERPLATE(c) \ |
| 432 REFCOUNTED_PROXY_MAP_BOILERPLATE(c) \ | 432 REFCOUNTED_PROXY_MAP_BOILERPLATE(c) \ |
| 433 public: \ | 433 public: \ |
| 434 static rtc::scoped_refptr<c##ProxyWithInternal> Create( \ | 434 static rtc::scoped_refptr<c##ProxyWithInternal> Create( \ |
| 435 rtc::Thread* signaling_thread, rtc::Thread* worker_thread, \ | 435 rtc::Thread* signaling_thread, rtc::Thread* worker_thread, \ |
| 436 INTERNAL_CLASS* c) { \ | 436 INTERNAL_CLASS* c) { \ |
| 437 return new rtc::RefCountedObject<c##ProxyWithInternal>(signaling_thread, \ | 437 return new rtc::RefCountedObject<c##ProxyWithInternal>(signaling_thread, \ |
| 438 worker_thread, c); \ | 438 worker_thread, c); \ |
| 439 } | 439 } |
| 440 | 440 |
| 441 #define BEGIN_OWNED_PROXY_MAP(c) \ | 441 #define BEGIN_OWNED_PROXY_MAP(c) \ |
| 442 PROXY_MAP_BOILERPLATE(c) \ | 442 PROXY_MAP_BOILERPLATE(c) \ |
| 443 WORKER_PROXY_MAP_BOILERPLATE(c) \ | 443 WORKER_PROXY_MAP_BOILERPLATE(c) \ |
| 444 OWNED_PROXY_MAP_BOILERPLATE(c) \ | 444 OWNED_PROXY_MAP_BOILERPLATE(c) \ |
| 445 public: \ | 445 public: \ |
| 446 static std::unique_ptr<c##ProxyWithInternal> Create( \ | 446 static std::unique_ptr<c##Interface> Create(rtc::Thread* signaling_thread, \ |
| 447 rtc::Thread* signaling_thread, rtc::Thread* worker_thread, \ | 447 rtc::Thread* worker_thread, \ |
| 448 INTERNAL_CLASS* c) { \ | 448 INTERNAL_CLASS* c) { \ |
| 449 return std::unique_ptr<c##ProxyWithInternal>( \ | 449 return std::unique_ptr<c##Interface>( \ |
| 450 new c##ProxyWithInternal(signaling_thread, worker_thread, c)); \ | 450 new c##ProxyWithInternal(signaling_thread, worker_thread, c)); \ |
| 451 } | 451 } |
| 452 | 452 |
| 453 #define PROXY_SIGNALING_THREAD_DESTRUCTOR() \ | 453 #define PROXY_SIGNALING_THREAD_DESTRUCTOR() \ |
| 454 private: \ | 454 private: \ |
| 455 rtc::Thread* destructor_thread() const { return signaling_thread_; } \ | 455 rtc::Thread* destructor_thread() const { return signaling_thread_; } \ |
| 456 \ | 456 \ |
| 457 public: // NOLINTNEXTLINE | 457 public: // NOLINTNEXTLINE |
| 458 | 458 |
| 459 #define PROXY_WORKER_THREAD_DESTRUCTOR() \ | 459 #define PROXY_WORKER_THREAD_DESTRUCTOR() \ |
| 460 private: \ | 460 private: \ |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 548 return call.Marshal(RTC_FROM_HERE, worker_thread_); \ | 548 return call.Marshal(RTC_FROM_HERE, worker_thread_); \ |
| 549 } | 549 } |
| 550 | 550 |
| 551 #define PROXY_WORKER_CONSTMETHOD2(r, method, t1, t2) \ | 551 #define PROXY_WORKER_CONSTMETHOD2(r, method, t1, t2) \ |
| 552 r method(t1 a1, t2 a2) const override { \ | 552 r method(t1 a1, t2 a2) const override { \ |
| 553 ConstMethodCall2<C, r, t1, t2> call(c_.get(), &C::method, std::move(a1), \ | 553 ConstMethodCall2<C, r, t1, t2> call(c_.get(), &C::method, std::move(a1), \ |
| 554 std::move(a2)); \ | 554 std::move(a2)); \ |
| 555 return call.Marshal(RTC_FROM_HERE, worker_thread_); \ | 555 return call.Marshal(RTC_FROM_HERE, worker_thread_); \ |
| 556 } | 556 } |
| 557 | 557 |
| 558 #define PROXY_WORKER_METHOD3(r, method, t1, t2, t3) \ |
| 559 r method(t1 a1, t2 a2, t3 a3) override { \ |
| 560 MethodCall3<C, r, t1, t2, t3> call(c_.get(), &C::method, std::move(a1), \ |
| 561 std::move(a2), std::move(a3)); \ |
| 562 return call.Marshal(RTC_FROM_HERE, worker_thread_); \ |
| 563 } |
| 564 |
| 565 #define PROXY_WORKER_CONSTMETHOD3(r, method, t1, t2) \ |
| 566 r method(t1 a1, t2 a2, t3 a3) const override { \ |
| 567 ConstMethodCall3<C, r, t1, t2, t3> call( \ |
| 568 c_.get(), &C::method, std::move(a1), std::move(a2), std::move(a3)); \ |
| 569 return call.Marshal(RTC_FROM_HERE, worker_thread_); \ |
| 570 } |
| 571 |
| 558 } // namespace webrtc | 572 } // namespace webrtc |
| 559 | 573 |
| 560 #endif // WEBRTC_API_PROXY_H_ | 574 #endif // WEBRTC_API_PROXY_H_ |
| OLD | NEW |