Replaces SynchronousMethodCall with rtc::Thread::Invoke.
Given that we already have Thread:.Invoke that can be used with lambda,
SynchronousMethodCall doesn't add any value.
This simplification prepares for simulated time peer connection tests.
Bug: webrtc:11255
Change-Id: I478a11f15e30e009dae4a3fee2120f6d7a03355f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/165683
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30217}
diff --git a/pc/peer_connection_factory.cc b/pc/peer_connection_factory.cc
index 4523121..606d32c 100644
--- a/pc/peer_connection_factory.cc
+++ b/pc/peer_connection_factory.cc
@@ -55,9 +55,8 @@
std::move(dependencies)));
// Call Initialize synchronously but make sure it is executed on
// |signaling_thread|.
- MethodCall<PeerConnectionFactory, bool> call(
- pc_factory.get(), &PeerConnectionFactory::Initialize);
- bool result = call.Marshal(RTC_FROM_HERE, pc_factory->signaling_thread());
+ bool result = pc_factory->signaling_thread()->Invoke<bool>(
+ RTC_FROM_HERE, [&] { return pc_factory->Initialize(); });
if (!result) {
return nullptr;