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

Unified Diff: webrtc/api/proxy.h

Issue 2023373002: Separating internal and external methods of RtpSender/RtpReceiver. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Renaming "ProxyTo<X>" to "ProxyWithInternal<X>" Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/api/peerconnectioninterface_unittest.cc ('k') | webrtc/api/proxy_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/proxy.h
diff --git a/webrtc/api/proxy.h b/webrtc/api/proxy.h
index 2df85c4bf46f4adb2f03196f2487287ab9a31d56..20a5b494a5a03d53db8da4a91e3419ebb499f8b8 100644
--- a/webrtc/api/proxy.h
+++ b/webrtc/api/proxy.h
@@ -306,43 +306,62 @@ class MethodCall5 : public rtc::Message,
T5 a5_;
};
-#define BEGIN_SIGNALING_PROXY_MAP(c) \
- class c##Proxy : public c##Interface { \
- protected: \
- typedef c##Interface C; \
- c##Proxy(rtc::Thread* signaling_thread, C* c) \
- : signaling_thread_(signaling_thread), c_(c) {} \
- ~c##Proxy() { \
- MethodCall0<c##Proxy, void> call( \
- this, &c##Proxy::Release_s); \
- call.Marshal(signaling_thread_); \
- } \
- \
- public: \
- static rtc::scoped_refptr<C> Create(rtc::Thread* signaling_thread, C* c) { \
- return new rtc::RefCountedObject<c##Proxy>( \
- signaling_thread, c); \
- }
-
-#define BEGIN_PROXY_MAP(c) \
- class c##Proxy : public c##Interface { \
- protected: \
- typedef c##Interface C; \
- c##Proxy(rtc::Thread* signaling_thread, rtc::Thread* worker_thread, C* c) \
- : signaling_thread_(signaling_thread), \
- worker_thread_(worker_thread), \
- c_(c) {} \
- ~c##Proxy() { \
- MethodCall0<c##Proxy, void> call(this, &c##Proxy::Release_s); \
- call.Marshal(signaling_thread_); \
- } \
- \
- public: \
- static rtc::scoped_refptr<C> Create( \
- rtc::Thread* signaling_thread, rtc::Thread* worker_thread, C* c) { \
- return new rtc::RefCountedObject<c##Proxy>( \
- signaling_thread, worker_thread, c); \
- }
+#define BEGIN_SIGNALING_PROXY_MAP(c) \
+ template <class INTERNAL_CLASS> \
+ class c##ProxyWithInternal; \
+ typedef c##ProxyWithInternal<c##Interface> c##Proxy; \
+ template <class INTERNAL_CLASS> \
+ class c##ProxyWithInternal : public c##Interface { \
+ protected: \
+ typedef c##Interface C; \
+ c##ProxyWithInternal(rtc::Thread* signaling_thread, INTERNAL_CLASS* c) \
+ : signaling_thread_(signaling_thread), c_(c) {} \
+ ~c##ProxyWithInternal() { \
+ MethodCall0<c##ProxyWithInternal, void> call( \
+ this, &c##ProxyWithInternal::Release_s); \
+ call.Marshal(signaling_thread_); \
+ } \
+ \
+ public: \
+ static rtc::scoped_refptr<c##ProxyWithInternal> Create( \
+ rtc::Thread* signaling_thread, \
+ INTERNAL_CLASS* c) { \
+ return new rtc::RefCountedObject<c##ProxyWithInternal>(signaling_thread, \
+ c); \
+ } \
+ const INTERNAL_CLASS* internal() const { return c_.get(); } \
+ INTERNAL_CLASS* internal() { return c_.get(); }
+
+#define BEGIN_PROXY_MAP(c) \
+ template <class INTERNAL_CLASS> \
+ class c##ProxyWithInternal; \
+ typedef c##ProxyWithInternal<c##Interface> c##Proxy; \
+ template <class INTERNAL_CLASS> \
+ class c##ProxyWithInternal : public c##Interface { \
+ protected: \
+ typedef c##Interface C; \
+ c##ProxyWithInternal(rtc::Thread* signaling_thread, \
+ rtc::Thread* worker_thread, \
+ INTERNAL_CLASS* c) \
+ : signaling_thread_(signaling_thread), \
+ worker_thread_(worker_thread), \
+ c_(c) {} \
+ ~c##ProxyWithInternal() { \
+ MethodCall0<c##ProxyWithInternal, void> call( \
+ this, &c##ProxyWithInternal::Release_s); \
+ call.Marshal(signaling_thread_); \
+ } \
+ \
+ public: \
+ static rtc::scoped_refptr<c##ProxyWithInternal> Create( \
+ rtc::Thread* signaling_thread, \
+ rtc::Thread* worker_thread, \
+ INTERNAL_CLASS* c) { \
+ return new rtc::RefCountedObject<c##ProxyWithInternal>( \
+ signaling_thread, worker_thread, c); \
+ } \
+ const INTERNAL_CLASS* internal() const { return c_.get(); } \
+ INTERNAL_CLASS* internal() { return c_.get(); }
#define PROXY_METHOD0(r, method) \
r method() override { \
@@ -407,24 +426,22 @@ class MethodCall5 : public rtc::Message,
return call.Marshal(worker_thread_); \
}
-#define END_SIGNALING_PROXY() \
- private:\
- void Release_s() {\
- c_ = NULL;\
- }\
- mutable rtc::Thread* signaling_thread_;\
- rtc::scoped_refptr<C> c_;\
- };
-
-#define END_PROXY() \
- private: \
- void Release_s() { \
- c_ = NULL; \
- } \
- mutable rtc::Thread* signaling_thread_; \
- mutable rtc::Thread* worker_thread_; \
- rtc::scoped_refptr<C> c_; \
- }; \
+#define END_SIGNALING_PROXY() \
+ private: \
+ void Release_s() { c_ = NULL; } \
+ mutable rtc::Thread* signaling_thread_; \
+ rtc::scoped_refptr<INTERNAL_CLASS> c_; \
+ } \
+ ;
+
+#define END_PROXY() \
+ private: \
+ void Release_s() { c_ = NULL; } \
+ mutable rtc::Thread* signaling_thread_; \
+ mutable rtc::Thread* worker_thread_; \
+ rtc::scoped_refptr<INTERNAL_CLASS> c_; \
+ } \
+ ;
} // namespace webrtc
« no previous file with comments | « webrtc/api/peerconnectioninterface_unittest.cc ('k') | webrtc/api/proxy_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698