Replace Thread::Invoke with Thread::BlockingCall
BlockingCall doesn't take rtc::Location parameter and thus most of the dependencies on location can be removed
Bug: webrtc:11318
Change-Id: I91a17e342dd9a9e3e2c8f7fbe267474c98a8d0e5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/274620
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38045}
diff --git a/sdk/objc/api/peerconnection/RTCPeerConnection.mm b/sdk/objc/api/peerconnection/RTCPeerConnection.mm
index f4db472..df99030 100644
--- a/sdk/objc/api/peerconnection/RTCPeerConnection.mm
+++ b/sdk/objc/api/peerconnection/RTCPeerConnection.mm
@@ -392,26 +392,22 @@
- (RTC_OBJC_TYPE(RTCSessionDescription) *)localDescription {
// It's only safe to operate on SessionDescriptionInterface on the signaling thread.
- return _peerConnection->signaling_thread()->Invoke<RTC_OBJC_TYPE(RTCSessionDescription) *>(
- RTC_FROM_HERE, [self] {
- const webrtc::SessionDescriptionInterface *description =
- _peerConnection->local_description();
- return description ?
- [[RTC_OBJC_TYPE(RTCSessionDescription) alloc] initWithNativeDescription:description] :
- nil;
- });
+ return _peerConnection->signaling_thread()->BlockingCall([self] {
+ const webrtc::SessionDescriptionInterface *description = _peerConnection->local_description();
+ return description ?
+ [[RTC_OBJC_TYPE(RTCSessionDescription) alloc] initWithNativeDescription:description] :
+ nil;
+ });
}
- (RTC_OBJC_TYPE(RTCSessionDescription) *)remoteDescription {
// It's only safe to operate on SessionDescriptionInterface on the signaling thread.
- return _peerConnection->signaling_thread()->Invoke<RTC_OBJC_TYPE(RTCSessionDescription) *>(
- RTC_FROM_HERE, [self] {
- const webrtc::SessionDescriptionInterface *description =
- _peerConnection->remote_description();
- return description ?
- [[RTC_OBJC_TYPE(RTCSessionDescription) alloc] initWithNativeDescription:description] :
- nil;
- });
+ return _peerConnection->signaling_thread()->BlockingCall([self] {
+ const webrtc::SessionDescriptionInterface *description = _peerConnection->remote_description();
+ return description ?
+ [[RTC_OBJC_TYPE(RTCSessionDescription) alloc] initWithNativeDescription:description] :
+ nil;
+ });
}
- (RTCSignalingState)signalingState {