WebKit Bugzilla
Attachment 348591 Details for
Bug 189181
: Move session observers outside LibWebRTCMediaEndpoint
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-189181-20180830212432.patch (text/plain), 10.79 KB, created by
youenn fablet
on 2018-08-30 21:24:33 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
youenn fablet
Created:
2018-08-30 21:24:33 PDT
Size:
10.79 KB
patch
obsolete
>Subversion Revision: 235524 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index afecf50effeafa1126e5695c74c3f117e1d6eabc..685b7c9eddcd04fdfebb20424ee8440ea10860a8 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,17 @@ >+2018-08-30 Youenn Fablet <youenn@apple.com> >+ >+ Move session observers outside LibWebRTCMediaEndpoint >+ https://bugs.webkit.org/show_bug.cgi?id=189181 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Move classes of LibWebRTCMediaEndpoint to a separate file. >+ No change of behavior. >+ >+ * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h: >+ * Modules/mediastream/libwebrtc/LibWebRTCObservers.h: Added. >+ * WebCore.xcodeproj/project.pbxproj: >+ > 2018-08-30 Youenn Fablet <youenn@apple.com> > > Introduce LibWebRTC backends for sender and receiver >diff --git a/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h b/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h >index 903e45bb830316b87c8740f1268cbfd3374a3068..474b4759aa3cb212b62a3652f17818d7c660c4a3 100644 >--- a/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h >+++ b/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h >@@ -26,6 +26,7 @@ > > #if USE(LIBWEBRTC) > >+#include "LibWebRTCObservers.h" > #include "LibWebRTCProvider.h" > #include "PeerConnectionBackend.h" > #include "RTCRtpReceiver.h" >@@ -154,55 +155,18 @@ private: > Seconds statsLogInterval(int64_t) const; > #endif > >- class CreateSessionDescriptionObserver final : public webrtc::CreateSessionDescriptionObserver { >- public: >- explicit CreateSessionDescriptionObserver(LibWebRTCMediaEndpoint &endpoint) : m_endpoint(endpoint) { } >- >- void OnSuccess(webrtc::SessionDescriptionInterface* sessionDescription) final { m_endpoint.createSessionDescriptionSucceeded(std::unique_ptr<webrtc::SessionDescriptionInterface>(sessionDescription)); } >- void OnFailure(const std::string& error) final { m_endpoint.createSessionDescriptionFailed(error); } >- >- void AddRef() const { m_endpoint.AddRef(); } >- rtc::RefCountReleaseStatus Release() const { return m_endpoint.Release(); } >- >- private: >- LibWebRTCMediaEndpoint& m_endpoint; >- }; >- >- class SetLocalSessionDescriptionObserver final : public webrtc::SetSessionDescriptionObserver { >- public: >- explicit SetLocalSessionDescriptionObserver(LibWebRTCMediaEndpoint &endpoint) : m_endpoint(endpoint) { } >- >- void OnSuccess() final { m_endpoint.setLocalSessionDescriptionSucceeded(); } >- void OnFailure(const std::string& error) final { m_endpoint.setLocalSessionDescriptionFailed(error); } >- >- void AddRef() const { m_endpoint.AddRef(); } >- rtc::RefCountReleaseStatus Release() const { return m_endpoint.Release(); } >- >- private: >- LibWebRTCMediaEndpoint& m_endpoint; >- }; >- >- class SetRemoteSessionDescriptionObserver final : public webrtc::SetSessionDescriptionObserver { >- public: >- explicit SetRemoteSessionDescriptionObserver(LibWebRTCMediaEndpoint &endpoint) : m_endpoint(endpoint) { } >- >- void OnSuccess() final { m_endpoint.setRemoteSessionDescriptionSucceeded(); } >- void OnFailure(const std::string& error) final { m_endpoint.setRemoteSessionDescriptionFailed(error); } >- >- void AddRef() const { m_endpoint.AddRef(); } >- rtc::RefCountReleaseStatus Release() const { return m_endpoint.Release(); } >- >- private: >- LibWebRTCMediaEndpoint& m_endpoint; >- }; >- > LibWebRTCPeerConnectionBackend& m_peerConnectionBackend; > webrtc::PeerConnectionFactoryInterface& m_peerConnectionFactory; > rtc::scoped_refptr<webrtc::PeerConnectionInterface> m_backend; > >- CreateSessionDescriptionObserver m_createSessionDescriptionObserver; >- SetLocalSessionDescriptionObserver m_setLocalSessionDescriptionObserver; >- SetRemoteSessionDescriptionObserver m_setRemoteSessionDescriptionObserver; >+ friend CreateSessionDescriptionObserver<LibWebRTCMediaEndpoint>; >+ friend SetLocalSessionDescriptionObserver<LibWebRTCMediaEndpoint>; >+ friend SetRemoteSessionDescriptionObserver<LibWebRTCMediaEndpoint>; >+ >+ CreateSessionDescriptionObserver<LibWebRTCMediaEndpoint> m_createSessionDescriptionObserver; >+ SetLocalSessionDescriptionObserver<LibWebRTCMediaEndpoint> m_setLocalSessionDescriptionObserver; >+ SetRemoteSessionDescriptionObserver<LibWebRTCMediaEndpoint> m_setRemoteSessionDescriptionObserver; >+ > HashMap<webrtc::MediaStreamInterface*, RefPtr<MediaStream>> m_streams; > HashMap<RTCRtpSender*, rtc::scoped_refptr<webrtc::RtpSenderInterface>> m_senders; > >diff --git a/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCObservers.h b/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCObservers.h >new file mode 100644 >index 0000000000000000000000000000000000000000..526a11808fa0161b0a11b02e7dc57f6bb71ac2fd >--- /dev/null >+++ b/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCObservers.h >@@ -0,0 +1,96 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED >+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE >+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY >+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES >+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; >+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON >+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS >+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#if USE(LIBWEBRTC) >+ >+#include "LibWebRTCMacros.h" >+ >+#pragma GCC diagnostic push >+#pragma GCC diagnostic ignored "-Wunused-parameter" >+ >+#include <webrtc/api/peerconnectioninterface.h> >+ >+#pragma GCC diagnostic pop >+ >+namespace WebCore { >+ >+template<typename Endpoint> >+class CreateSessionDescriptionObserver final : public webrtc::CreateSessionDescriptionObserver { >+public: >+ explicit CreateSessionDescriptionObserver(Endpoint &endpoint) >+ : m_endpoint(endpoint) >+ { >+ } >+ >+ void OnSuccess(webrtc::SessionDescriptionInterface* sessionDescription) final { m_endpoint.createSessionDescriptionSucceeded(std::unique_ptr<webrtc::SessionDescriptionInterface>(sessionDescription)); } >+ void OnFailure(const std::string& error) final { m_endpoint.createSessionDescriptionFailed(error); } >+ >+ void AddRef() const { m_endpoint.AddRef(); } >+ rtc::RefCountReleaseStatus Release() const { return m_endpoint.Release(); } >+ >+private: >+ Endpoint& m_endpoint; >+}; >+ >+template<typename Endpoint> >+class SetLocalSessionDescriptionObserver final : public webrtc::SetSessionDescriptionObserver { >+public: >+ explicit SetLocalSessionDescriptionObserver(Endpoint &endpoint) >+ : m_endpoint(endpoint) >+ { >+ } >+ >+ void OnSuccess() final { m_endpoint.setLocalSessionDescriptionSucceeded(); } >+ void OnFailure(const std::string& error) final { m_endpoint.setLocalSessionDescriptionFailed(error); } >+ >+ void AddRef() const { m_endpoint.AddRef(); } >+ rtc::RefCountReleaseStatus Release() const { return m_endpoint.Release(); } >+ >+private: >+ Endpoint& m_endpoint; >+}; >+ >+template<typename Endpoint> >+class SetRemoteSessionDescriptionObserver final : public webrtc::SetSessionDescriptionObserver { >+public: >+ explicit SetRemoteSessionDescriptionObserver(Endpoint &endpoint) >+ : m_endpoint(endpoint) >+ { >+ } >+ >+ void OnSuccess() final { m_endpoint.setRemoteSessionDescriptionSucceeded(); } >+ void OnFailure(const std::string& error) final { m_endpoint.setRemoteSessionDescriptionFailed(error); } >+ >+ void AddRef() const { m_endpoint.AddRef(); } >+ rtc::RefCountReleaseStatus Release() const { return m_endpoint.Release(); } >+ >+private: >+ Endpoint& m_endpoint; >+}; >+ >+} // namespace WebCore >+ >+#endif // USE(LIBWEBRTC) >diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >index 4394005a3b15b5ea2ab397106a024eeaaab01599..668e11637d4c40339823624e2ccfcd70cc93cf34 100644 >--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj >+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >@@ -7236,6 +7236,7 @@ > 415747441E38699E00E914D8 /* LibWebRTCProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LibWebRTCProvider.h; path = libwebrtc/LibWebRTCProvider.h; sourceTree = "<group>"; }; > 4157EBF81E3AB06800AC9FE9 /* MockLibWebRTCPeerConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MockLibWebRTCPeerConnection.h; sourceTree = "<group>"; }; > 4157EBF91E3AB06800AC9FE9 /* MockLibWebRTCPeerConnection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MockLibWebRTCPeerConnection.cpp; sourceTree = "<group>"; }; >+ 415A3B732138E264001B4BAA /* LibWebRTCObservers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LibWebRTCObservers.h; path = libwebrtc/LibWebRTCObservers.h; sourceTree = "<group>"; }; > 415CDAF61E6CE0D3004F11EE /* JSMediaStreamTrackCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMediaStreamTrackCustom.cpp; sourceTree = "<group>"; }; > 41614A761DA64236004AD06F /* HTTPHeaderValues.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTTPHeaderValues.cpp; sourceTree = "<group>"; }; > 41614A771DA64236004AD06F /* HTTPHeaderValues.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTTPHeaderValues.h; sourceTree = "<group>"; }; >@@ -16848,6 +16849,7 @@ > 5CDD83401E43253D00621E92 /* LibWebRTCDataChannelHandler.h */, > 417612AB1E3A993B00C3D81D /* LibWebRTCMediaEndpoint.cpp */, > 417612AC1E3A993B00C3D81D /* LibWebRTCMediaEndpoint.h */, >+ 415A3B732138E264001B4BAA /* LibWebRTCObservers.h */, > 417612AD1E3A993B00C3D81D /* LibWebRTCPeerConnectionBackend.cpp */, > 417612AE1E3A993B00C3D81D /* LibWebRTCPeerConnectionBackend.h */, > 41C23FF52138A68100C5DF27 /* LibWebRTCRtpReceiverBackend.cpp */,
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 189181
:
348591
|
348599