前言

image.png

分析代码

H:\webrtc-20210315\webrtc-20210315\webrtc\webrtc-checkout\src\api\proxy.h

  1. // Helper macros to reduce code duplication.
  2. #define PROXY_MAP_BOILERPLATE(c) \
  3. template <class INTERNAL_CLASS> \
  4. class c##ProxyWithInternal; \
  5. typedef c##ProxyWithInternal<c##Interface> c##Proxy; \
  6. template <class INTERNAL_CLASS> \
  7. class c##ProxyWithInternal : public c##Interface { \
  8. protected: \
  9. typedef c##Interface C; \
  10. \
  11. public: \
  12. const INTERNAL_CLASS* internal() const { return c_; } \
  13. INTERNAL_CLASS* internal() { return c_; }
  1. #define PROXY_METHOD0(r, method) \
  2. r method() override { \
  3. MethodCall<C, r> call(c_, &C::method); \
  4. return call.Marshal(RTC_FROM_HERE, primary_thread_); \
  5. }