Delete SignalThread class.
Rewrite AsyncResolver to use PlatformThread directly, not
SignalThread, and update includes of peerconnection client to not
depend on signalthread.h.
BUG=webrtc:6424,webrtc:7723
Review-Url: https://codereview.webrtc.org/2915253002
Cr-Commit-Position: refs/heads/master@{#18833}
diff --git a/webrtc/rtc_base/messagequeue.cc b/webrtc/rtc_base/messagequeue.cc
index cafb70b..fce1906 100644
--- a/webrtc/rtc_base/messagequeue.cc
+++ b/webrtc/rtc_base/messagequeue.cc
@@ -44,6 +44,16 @@
RTC_DISALLOW_COPY_AND_ASSIGN(DebugNonReentrantCritScope);
};
+
+class FunctorPostMessageHandler : public MessageHandler {
+ public:
+ void OnMessage(Message* msg) override {
+ RunnableData* data = static_cast<RunnableData*>(msg->pdata);
+ data->Run();
+ delete data;
+ }
+};
+
} // namespace
//------------------------------------------------------------------
@@ -529,4 +539,12 @@
}
}
+void MessageQueue::PostFunctorInternal(const Location& posted_from,
+ RunnableData* message_data) {
+ // Use static to ensure it outlives this scope. Safe since
+ // FunctorPostMessageHandler keeps no state.
+ static FunctorPostMessageHandler handler;
+ Post(posted_from, &handler, 0, message_data);
+}
+
} // namespace rtc