Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(575)

Side by Side Diff: webrtc/api/proxy.h

Issue 2675173003: Adding "adapter" ORTC objects on top of ChannelManager/BaseChannel/etc. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 WORKER_PROXY_MAP_BOILERPLATE(c) \ 425 WORKER_PROXY_MAP_BOILERPLATE(c) \
426 REFCOUNTED_PROXY_MAP_BOILERPLATE(c) \ 426 REFCOUNTED_PROXY_MAP_BOILERPLATE(c) \
427 public: \ 427 public: \
428 static rtc::scoped_refptr<c##ProxyWithInternal> Create( \ 428 static rtc::scoped_refptr<c##ProxyWithInternal> Create( \
429 rtc::Thread* signaling_thread, rtc::Thread* worker_thread, \ 429 rtc::Thread* signaling_thread, rtc::Thread* worker_thread, \
430 INTERNAL_CLASS* c) { \ 430 INTERNAL_CLASS* c) { \
431 return new rtc::RefCountedObject<c##ProxyWithInternal>(signaling_thread, \ 431 return new rtc::RefCountedObject<c##ProxyWithInternal>(signaling_thread, \
432 worker_thread, c); \ 432 worker_thread, c); \
433 } 433 }
434 434
435 #define BEGIN_OWNED_PROXY_MAP(c) \ 435 #define BEGIN_OWNED_PROXY_MAP(c) \
436 PROXY_MAP_BOILERPLATE(c) \ 436 PROXY_MAP_BOILERPLATE(c) \
437 WORKER_PROXY_MAP_BOILERPLATE(c) \ 437 WORKER_PROXY_MAP_BOILERPLATE(c) \
438 OWNED_PROXY_MAP_BOILERPLATE(c) \ 438 OWNED_PROXY_MAP_BOILERPLATE(c) \
439 public: \ 439 public: \
440 static std::unique_ptr<c##ProxyWithInternal> Create( \ 440 static std::unique_ptr<c##Interface> Create(rtc::Thread* signaling_thread, \
441 rtc::Thread* signaling_thread, rtc::Thread* worker_thread, \ 441 rtc::Thread* worker_thread, \
442 INTERNAL_CLASS* c) { \ 442 INTERNAL_CLASS* c) { \
443 return std::unique_ptr<c##ProxyWithInternal>( \ 443 return std::unique_ptr<c##Interface>( \
444 new c##ProxyWithInternal(signaling_thread, worker_thread, c)); \ 444 new c##ProxyWithInternal(signaling_thread, worker_thread, c)); \
445 } 445 }
446 446
447 #define PROXY_SIGNALING_THREAD_DESTRUCTOR() \ 447 #define PROXY_SIGNALING_THREAD_DESTRUCTOR() \
448 private: \ 448 private: \
449 rtc::Thread* destructor_thread() const { return signaling_thread_; } \ 449 rtc::Thread* destructor_thread() const { return signaling_thread_; } \
450 \ 450 \
451 public: 451 public:
452 452
453 #define PROXY_WORKER_THREAD_DESTRUCTOR() \ 453 #define PROXY_WORKER_THREAD_DESTRUCTOR() \
454 private: \ 454 private: \
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
542 return call.Marshal(RTC_FROM_HERE, worker_thread_); \ 542 return call.Marshal(RTC_FROM_HERE, worker_thread_); \
543 } 543 }
544 544
545 #define PROXY_WORKER_CONSTMETHOD2(r, method, t1, t2) \ 545 #define PROXY_WORKER_CONSTMETHOD2(r, method, t1, t2) \
546 r method(t1 a1, t2 a2) const override { \ 546 r method(t1 a1, t2 a2) const override { \
547 ConstMethodCall2<C, r, t1, t2> call(c_.get(), &C::method, std::move(a1), \ 547 ConstMethodCall2<C, r, t1, t2> call(c_.get(), &C::method, std::move(a1), \
548 std::move(a2)); \ 548 std::move(a2)); \
549 return call.Marshal(RTC_FROM_HERE, worker_thread_); \ 549 return call.Marshal(RTC_FROM_HERE, worker_thread_); \
550 } 550 }
551 551
552 #define PROXY_WORKER_METHOD3(r, method, t1, t2, t3) \
553 r method(t1 a1, t2 a2, t3 a3) override { \
554 MethodCall3<C, r, t1, t2, t3> call(c_.get(), &C::method, std::move(a1), \
555 std::move(a2), std::move(a3)); \
556 return call.Marshal(RTC_FROM_HERE, worker_thread_); \
557 }
558
559 #define PROXY_WORKER_CONSTMETHOD3(r, method, t1, t2) \
560 r method(t1 a1, t2 a2, t3 a3) const override { \
561 ConstMethodCall3<C, r, t1, t2, t3> call( \
562 c_.get(), &C::method, std::move(a1), std::move(a2), std::move(a3)); \
563 return call.Marshal(RTC_FROM_HERE, worker_thread_); \
564 }
565
552 #define END_PROXY_MAP() \ 566 #define END_PROXY_MAP() \
553 } \ 567 } \
554 ; 568 ;
555 569
556 } // namespace webrtc 570 } // namespace webrtc
557 571
558 #endif // WEBRTC_API_PROXY_H_ 572 #endif // WEBRTC_API_PROXY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698