Bug 230262 - Migrate to libwebrtc non-racy setRemoteDescription/setLocalDescription variants
Summary: Migrate to libwebrtc non-racy setRemoteDescription/setLocalDescription variants
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebRTC (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: youenn fablet
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-09-14 06:20 PDT by youenn fablet
Modified: 2021-09-15 01:20 PDT (History)
11 users (show)

See Also:


Attachments
Patch (14.33 KB, patch)
2021-09-14 06:35 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch (18.00 KB, patch)
2021-09-14 09:22 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch for landing (17.75 KB, patch)
2021-09-15 00:20 PDT, youenn fablet
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description youenn fablet 2021-09-14 06:20:48 PDT
Migrate to libwebrtc non-racy setRemoteDescription/setLocalDescription variants
Comment 1 youenn fablet 2021-09-14 06:35:29 PDT
Created attachment 438129 [details]
Patch
Comment 2 youenn fablet 2021-09-14 09:22:39 PDT
Created attachment 438150 [details]
Patch
Comment 3 Darin Adler 2021-09-14 13:49:21 PDT
Comment on attachment 438150 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=438150&action=review

> Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:148
> +    rtc::scoped_refptr<webrtc::SetLocalDescriptionObserverInterface> observer(&m_setLocalSessionDescriptionObserver);

I wonder if we can leave out the <> here. If it was std::unique_ptr or WTF::RefPtr we could, but not sure about rtc::scoped_refptr.

> Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:182
> +    rtc::scoped_refptr<webrtc::SetRemoteDescriptionObserverInterface> observer(&m_setRemoteSessionDescriptionObserver);

Ditto.

> Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCObservers.h:69
> +    void OnSetLocalDescriptionComplete(webrtc::RTCError error) final

Not important, but seems like this can be private.

> Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCObservers.h:93
> +    void OnSetRemoteDescriptionComplete(webrtc::RTCError error) final

Not important, but seems like this can be private.
Comment 4 youenn fablet 2021-09-15 00:18:58 PDT
(In reply to Darin Adler from comment #3)
> Comment on attachment 438150 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=438150&action=review
> 
> > Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:148
> > +    rtc::scoped_refptr<webrtc::SetLocalDescriptionObserverInterface> observer(&m_setLocalSessionDescriptionObserver);
> 
> I wonder if we can leave out the <> here. If it was std::unique_ptr or
> WTF::RefPtr we could, but not sure about rtc::scoped_refptr.

We indeed can do it.
Thinking more about it, given the typed parameters, we can probably just pass a pointer to the methods and the scoped_refptr will be created for us.

> > Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:182
> > +    rtc::scoped_refptr<webrtc::SetRemoteDescriptionObserverInterface> observer(&m_setRemoteSessionDescriptionObserver);
> 
> Ditto.
> 
> > Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCObservers.h:69
> > +    void OnSetLocalDescriptionComplete(webrtc::RTCError error) final
> 
> Not important, but seems like this can be private.

OK.

> > Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCObservers.h:93
> > +    void OnSetRemoteDescriptionComplete(webrtc::RTCError error) final
> 
> Not important, but seems like this can be private.

OK.
Comment 5 youenn fablet 2021-09-15 00:20:07 PDT
Created attachment 438219 [details]
Patch for landing
Comment 6 EWS 2021-09-15 01:19:09 PDT
Committed r282444 (241697@main): <https://commits.webkit.org/241697@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 438219 [details].
Comment 7 Radar WebKit Bug Importer 2021-09-15 01:20:17 PDT
<rdar://problem/83135937>