Index: webrtc/api/proxy.h |
diff --git a/webrtc/api/proxy.h b/webrtc/api/proxy.h |
index 2df85c4bf46f4adb2f03196f2487287ab9a31d56..d90fe624a2779c388be8ff9a8c0f782b8eb2adb9 100644 |
--- a/webrtc/api/proxy.h |
+++ b/webrtc/api/proxy.h |
@@ -107,12 +107,12 @@ class SynchronousMethodCall |
: e_(), proxy_(proxy) {} |
~SynchronousMethodCall() {} |
- void Invoke(rtc::Thread* t) { |
+ void Invoke(const rtc::Location& posted_from, rtc::Thread* t) { |
if (t->IsCurrent()) { |
proxy_->OnMessage(NULL); |
} else { |
e_.reset(new rtc::Event(false, false)); |
- t->Post(this, 0); |
+ t->Post(posted_from, this, 0); |
e_->Wait(rtc::Event::kForever); |
} |
} |
@@ -132,8 +132,8 @@ class MethodCall0 : public rtc::Message, |
typedef R (C::*Method)(); |
MethodCall0(C* c, Method m) : c_(c), m_(m) {} |
- R Marshal(rtc::Thread* t) { |
- internal::SynchronousMethodCall(this).Invoke(t); |
+ R Marshal(const rtc::Location& posted_from, rtc::Thread* t) { |
+ internal::SynchronousMethodCall(this).Invoke(posted_from, t); |
return r_.value(); |
} |
@@ -152,8 +152,8 @@ class ConstMethodCall0 : public rtc::Message, |
typedef R (C::*Method)() const; |
ConstMethodCall0(C* c, Method m) : c_(c), m_(m) {} |
- R Marshal(rtc::Thread* t) { |
- internal::SynchronousMethodCall(this).Invoke(t); |
+ R Marshal(const rtc::Location& posted_from, rtc::Thread* t) { |
+ internal::SynchronousMethodCall(this).Invoke(posted_from, t); |
return r_.value(); |
} |
@@ -172,8 +172,8 @@ class MethodCall1 : public rtc::Message, |
typedef R (C::*Method)(T1 a1); |
MethodCall1(C* c, Method m, T1 a1) : c_(c), m_(m), a1_(a1) {} |
- R Marshal(rtc::Thread* t) { |
- internal::SynchronousMethodCall(this).Invoke(t); |
+ R Marshal(const rtc::Location& posted_from, rtc::Thread* t) { |
+ internal::SynchronousMethodCall(this).Invoke(posted_from, t); |
return r_.value(); |
} |
@@ -193,8 +193,8 @@ class ConstMethodCall1 : public rtc::Message, |
typedef R (C::*Method)(T1 a1) const; |
ConstMethodCall1(C* c, Method m, T1 a1) : c_(c), m_(m), a1_(a1) {} |
- R Marshal(rtc::Thread* t) { |
- internal::SynchronousMethodCall(this).Invoke(t); |
+ R Marshal(const rtc::Location& posted_from, rtc::Thread* t) { |
+ internal::SynchronousMethodCall(this).Invoke(posted_from, t); |
return r_.value(); |
} |
@@ -214,8 +214,8 @@ class MethodCall2 : public rtc::Message, |
typedef R (C::*Method)(T1 a1, T2 a2); |
MethodCall2(C* c, Method m, T1 a1, T2 a2) : c_(c), m_(m), a1_(a1), a2_(a2) {} |
- R Marshal(rtc::Thread* t) { |
- internal::SynchronousMethodCall(this).Invoke(t); |
+ R Marshal(const rtc::Location& posted_from, rtc::Thread* t) { |
+ internal::SynchronousMethodCall(this).Invoke(posted_from, t); |
return r_.value(); |
} |
@@ -237,8 +237,8 @@ class MethodCall3 : public rtc::Message, |
MethodCall3(C* c, Method m, T1 a1, T2 a2, T3 a3) |
: c_(c), m_(m), a1_(a1), a2_(a2), a3_(a3) {} |
- R Marshal(rtc::Thread* t) { |
- internal::SynchronousMethodCall(this).Invoke(t); |
+ R Marshal(const rtc::Location& posted_from, rtc::Thread* t) { |
+ internal::SynchronousMethodCall(this).Invoke(posted_from, t); |
return r_.value(); |
} |
@@ -262,8 +262,8 @@ class MethodCall4 : public rtc::Message, |
MethodCall4(C* c, Method m, T1 a1, T2 a2, T3 a3, T4 a4) |
: c_(c), m_(m), a1_(a1), a2_(a2), a3_(a3), a4_(a4) {} |
- R Marshal(rtc::Thread* t) { |
- internal::SynchronousMethodCall(this).Invoke(t); |
+ R Marshal(const rtc::Location& posted_from, rtc::Thread* t) { |
+ internal::SynchronousMethodCall(this).Invoke(posted_from, t); |
return r_.value(); |
} |
@@ -288,8 +288,8 @@ class MethodCall5 : public rtc::Message, |
MethodCall5(C* c, Method m, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5) |
: c_(c), m_(m), a1_(a1), a2_(a2), a3_(a3), a4_(a4), a5_(a5) {} |
- R Marshal(rtc::Thread* t) { |
- internal::SynchronousMethodCall(this).Invoke(t); |
+ R Marshal(const rtc::Location& posted_from, rtc::Thread* t) { |
+ internal::SynchronousMethodCall(this).Invoke(posted_from, t); |
return r_.value(); |
} |
@@ -306,105 +306,104 @@ 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: \ |
+#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(FROM_HERE, 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##Proxy>(signaling_thread, c); \ |
} |
-#define BEGIN_PROXY_MAP(c) \ |
- class c##Proxy : public c##Interface { \ |
- protected: \ |
- typedef c##Interface 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); \ |
+ : signaling_thread_(signaling_thread), \ |
+ worker_thread_(worker_thread), \ |
+ c_(c) {} \ |
+ ~c##Proxy() { \ |
+ MethodCall0<c##Proxy, void> call(this, &c##Proxy::Release_s); \ |
+ call.Marshal(FROM_HERE, 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 PROXY_METHOD0(r, method) \ |
- r method() override { \ |
- MethodCall0<C, r> call(c_.get(), &C::method); \ |
- return call.Marshal(signaling_thread_); \ |
+#define PROXY_METHOD0(r, method) \ |
+ r method() override { \ |
+ MethodCall0<C, r> call(c_.get(), &C::method); \ |
+ return call.Marshal(FROM_HERE, signaling_thread_); \ |
} |
#define PROXY_CONSTMETHOD0(r, method) \ |
r method() const override { \ |
ConstMethodCall0<C, r> call(c_.get(), &C::method); \ |
- return call.Marshal(signaling_thread_); \ |
+ return call.Marshal(FROM_HERE, signaling_thread_); \ |
} |
#define PROXY_METHOD1(r, method, t1) \ |
r method(t1 a1) override { \ |
MethodCall1<C, r, t1> call(c_.get(), &C::method, a1); \ |
- return call.Marshal(signaling_thread_); \ |
+ return call.Marshal(FROM_HERE, signaling_thread_); \ |
} |
#define PROXY_CONSTMETHOD1(r, method, t1) \ |
r method(t1 a1) const override { \ |
ConstMethodCall1<C, r, t1> call(c_.get(), &C::method, a1); \ |
- return call.Marshal(signaling_thread_); \ |
+ return call.Marshal(FROM_HERE, signaling_thread_); \ |
} |
#define PROXY_METHOD2(r, method, t1, t2) \ |
r method(t1 a1, t2 a2) override { \ |
MethodCall2<C, r, t1, t2> call(c_.get(), &C::method, a1, a2); \ |
- return call.Marshal(signaling_thread_); \ |
+ return call.Marshal(FROM_HERE, signaling_thread_); \ |
} |
#define PROXY_METHOD3(r, method, t1, t2, t3) \ |
r method(t1 a1, t2 a2, t3 a3) override { \ |
MethodCall3<C, r, t1, t2, t3> call(c_.get(), &C::method, a1, a2, a3); \ |
- return call.Marshal(signaling_thread_); \ |
+ return call.Marshal(FROM_HERE, signaling_thread_); \ |
} |
#define PROXY_METHOD4(r, method, t1, t2, t3, t4) \ |
r method(t1 a1, t2 a2, t3 a3, t4 a4) override { \ |
MethodCall4<C, r, t1, t2, t3, t4> call(c_.get(), &C::method, a1, a2, a3, \ |
a4); \ |
- return call.Marshal(signaling_thread_); \ |
+ return call.Marshal(FROM_HERE, signaling_thread_); \ |
} |
#define PROXY_METHOD5(r, method, t1, t2, t3, t4, t5) \ |
r method(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5) override { \ |
MethodCall5<C, r, t1, t2, t3, t4, t5> call(c_.get(), &C::method, a1, a2, \ |
a3, a4, a5); \ |
- return call.Marshal(signaling_thread_); \ |
+ return call.Marshal(FROM_HERE, signaling_thread_); \ |
} |
// Define methods which should be invoked on the worker thread. |
#define PROXY_WORKER_METHOD1(r, method, t1) \ |
r method(t1 a1) override { \ |
MethodCall1<C, r, t1> call(c_.get(), &C::method, a1); \ |
- return call.Marshal(worker_thread_); \ |
+ return call.Marshal(FROM_HERE, worker_thread_); \ |
} |
#define PROXY_WORKER_METHOD2(r, method, t1, t2) \ |
r method(t1 a1, t2 a2) override { \ |
MethodCall2<C, r, t1, t2> call(c_.get(), &C::method, a1, a2); \ |
- return call.Marshal(worker_thread_); \ |
+ return call.Marshal(FROM_HERE, worker_thread_); \ |
} |
#define END_SIGNALING_PROXY() \ |