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

Unified Diff: webrtc/api/proxy.h

Issue 1871833002: Rename BEGIN_PROXY_MAP --> BEGIN_SIGNALLING_PROXY_MAP. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 8 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
Index: webrtc/api/proxy.h
diff --git a/webrtc/api/proxy.h b/webrtc/api/proxy.h
index b5a8071bcfbbcdddf21e459a22802c7a88498e8c..e59970620a5ecf229abc12070e5f89dd4a8b922c 100644
--- a/webrtc/api/proxy.h
+++ b/webrtc/api/proxy.h
@@ -18,7 +18,7 @@
// public:
// std::string FooA() = 0;
// std::string FooB(bool arg1) const = 0;
-// std::string FooC(bool arg1)= 0;
+// std::string FooC(bool arg1) = 0;
// };
//
// Note that return types can not be a const reference.
@@ -30,10 +30,19 @@
// BEGIN_PROXY_MAP(Test)
// PROXY_METHOD0(std::string, FooA)
// PROXY_CONSTMETHOD1(std::string, FooB, arg1)
-// PROXY_METHOD1(std::string, FooC, arg1)
+// PROXY_WORKER_METHOD1(std::string, FooC, arg1)
// END_PROXY()
//
-// The proxy can be created using TestProxy::Create(Thread*, TestInterface*).
+// where the first two methods are invoked on the signalling thread,
+// and the third is invoked on the worker thread.
+//
+// The proxy can be created using
+//
+// TestProxy::Create(Thread* signalling_thread, Thread* worker_thread,
+// TestInterface*).
+//
+// The variant defined with BEGIN_SIGNALLING_PROXY_MAP is unaware of
+// the worker thread, and invokes all methods on the signalling thread.
#ifndef WEBRTC_API_PROXY_H_
#define WEBRTC_API_PROXY_H_
@@ -295,26 +304,25 @@ class MethodCall5 : public rtc::Message,
T5 a5_;
};
-// TODO(nisse): Rename this to {BEGIN|END}_SIGNALLING_PROXY_MAP, and
-// the below to {BEGIN|END}_PROXY_MAP. Also rename the class to
-// c##SignallingProxy.
-#define BEGIN_PROXY_MAP(c) \
- class c##Proxy : public c##Interface { \
+#define BEGIN_SIGNALLING_PROXY_MAP(c) \
+ class c##SignallingProxy : public c##Interface { \
perkj_webrtc 2016/04/08 11:05:35 - I dont like the Signalling part here either. Ple
nisse-webrtc 2016/04/11 09:21:20 Reverted now.
protected: \
typedef c##Interface C; \
- c##Proxy(rtc::Thread* signaling_thread, C* c) \
+ c##SignallingProxy(rtc::Thread* signaling_thread, C* c) \
: signaling_thread_(signaling_thread), c_(c) {} \
- ~c##Proxy() { \
- MethodCall0<c##Proxy, void> call(this, &c##Proxy::Release_s); \
+ ~c##SignallingProxy() { \
+ MethodCall0<c##SignallingProxy, void> call( \
+ this, &c##SignallingProxy::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); \
+ return new rtc::RefCountedObject<c##SignallingProxy>( \
+ signaling_thread, c); \
}
-#define BEGIN_WORKER_PROXY_MAP(c) \
+#define BEGIN_PROXY_MAP(c) \
class c##Proxy : public c##Interface { \
protected: \
typedef c##Interface C; \
@@ -397,16 +405,16 @@ class MethodCall5 : public rtc::Message,
return call.Marshal(worker_thread_); \
}
-#define END_PROXY() \
+#define END_SIGNALLING_PROXY() \
private:\
void Release_s() {\
c_ = NULL;\
}\
mutable rtc::Thread* signaling_thread_;\
rtc::scoped_refptr<C> c_;\
- };\
+ };
-#define END_WORKER_PROXY() \
+#define END_PROXY() \
private: \
void Release_s() { \
c_ = NULL; \

Powered by Google App Engine
This is Rietveld 408576698