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

Unified Diff: talk/app/webrtc/proxy.h

Issue 1269843005: Added DtlsCertificate, a ref counted object owning an SSLIdentity (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Merge with master Created 5 years, 4 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: talk/app/webrtc/proxy.h
diff --git a/talk/app/webrtc/proxy.h b/talk/app/webrtc/proxy.h
index 76a5c1eff2819e398983143f2c5e2fbbf452100e..5da8eff28a25ff0e00ee1cfbd4876d00f932c59d 100644
--- a/talk/app/webrtc/proxy.h
+++ b/talk/app/webrtc/proxy.h
@@ -81,6 +81,11 @@ class ReturnType {
void Invoke(C* c, M m, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5) {
r_ = (c->*m)(a1, a2, a3, a4, a5);
}
+ template<typename C, typename M, typename T1, typename T2, typename T3,
tommi (sloooow) - chröme 2015/08/18 14:49:35 do you want to land this change in a separate cl f
+ typename T4, typename T5, typename T6>
+ void Invoke(C* c, M m, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6) {
+ r_ = (c->*m)(a1, a2, a3, a4, a5, a6);
+ }
R value() { return r_; }
@@ -312,6 +317,36 @@ class MethodCall5 : public rtc::Message,
T5 a5_;
};
+template <typename C, typename R, typename T1, typename T2, typename T3,
+ typename T4, typename T5, typename T6>
+class MethodCall6 : public rtc::Message,
+ public rtc::MessageHandler {
+ public:
+ typedef R (C::*Method)(T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6);
+ MethodCall6(C* c, Method m, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6)
+ : c_(c), m_(m), a1_(a1), a2_(a2), a3_(a3), a4_(a4), a5_(a5), a6_(a6) {}
+
+ R Marshal(rtc::Thread* t) {
+ internal::SynchronousMethodCall(this).Invoke(t);
+ return r_.value();
+ }
+
+ private:
+ void OnMessage(rtc::Message*) {
+ r_.Invoke(c_, m_, a1_, a2_, a3_, a4_, a5_, a6_);
+ }
+
+ C* c_;
+ Method m_;
+ ReturnType<R> r_;
+ T1 a1_;
+ T2 a2_;
+ T3 a3_;
+ T4 a4_;
+ T5 a5_;
+ T6 a6_;
+};
+
#define BEGIN_PROXY_MAP(c) \
class c##Proxy : public c##Interface { \
protected: \
@@ -377,6 +412,13 @@ class MethodCall5 : public rtc::Message,
return call.Marshal(owner_thread_); \
}
+#define PROXY_METHOD6(r, method, t1, t2, t3, t4, t5, t6) \
+ r method(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5, t6 a6) override { \
+ MethodCall6<C, r, t1, t2, t3, t4, t5, t6> call(c_.get(), &C::method, a1, \
+ a2, a3, a4, a5, a6); \
+ return call.Marshal(owner_thread_); \
+ }
+
#define END_PROXY() \
private:\
void Release_s() {\

Powered by Google App Engine
This is Rietveld 408576698