- Revision
- 229169
- Author
- [email protected]
- Date
- 2018-03-02 01:23:10 -0800 (Fri, 02 Mar 2018)
Log Message
Make LibWebRTCProvider port agnostic again after r215424
https://bugs.webkit.org/show_bug.cgi?id=183080
Patch by Alejandro G. Castro <[email protected]> on 2018-03-02
Reviewed by Youenn Fablet.
In the r215424 commit the webRTCAvailable function started to use a function from the DARWIN platform,
we have moved that code to the cocoa class and created a glib implementation that will be used in the future
to implement the LibWebRTCProviderGlib class.
No new tests, this is a refactor.
* Sources.txt: Add the compilation of the new file.
* platform/mediastream/libwebrtc/LibWebRTCProvider.cpp: Remove the webRTCAvailable function from this file.
(WebCore::LibWebRTCProvider::create): We want to use this even when LIBWEBRTC is not used.
* platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
(WebCore::LibWebRTCProvider::webRTCAvailable): Moved the code from the LibWebRTCProvider class.
* platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp:
(WebCore::LibWebRTCProvider::webRTCAvailable): Add the glib implementation, basically true, we are always
linking libwebrtc for the moment in these situations.
Modified Paths
Added Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (229168 => 229169)
--- trunk/Source/WebCore/ChangeLog 2018-03-02 08:20:56 UTC (rev 229168)
+++ trunk/Source/WebCore/ChangeLog 2018-03-02 09:23:10 UTC (rev 229169)
@@ -1,3 +1,25 @@
+2018-03-02 Alejandro G. Castro <[email protected]>
+
+ Make LibWebRTCProvider port agnostic again after r215424
+ https://bugs.webkit.org/show_bug.cgi?id=183080
+
+ Reviewed by Youenn Fablet.
+
+ In the r215424 commit the webRTCAvailable function started to use a function from the DARWIN platform,
+ we have moved that code to the cocoa class and created a glib implementation that will be used in the future
+ to implement the LibWebRTCProviderGlib class.
+
+ No new tests, this is a refactor.
+
+ * Sources.txt: Add the compilation of the new file.
+ * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp: Remove the webRTCAvailable function from this file.
+ (WebCore::LibWebRTCProvider::create): We want to use this even when LIBWEBRTC is not used.
+ * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
+ (WebCore::LibWebRTCProvider::webRTCAvailable): Moved the code from the LibWebRTCProvider class.
+ * platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp:
+ (WebCore::LibWebRTCProvider::webRTCAvailable): Add the glib implementation, basically true, we are always
+ linking libwebrtc for the moment in these situations.
+
2018-03-01 Carlos Garcia Campos <[email protected]>
REGRESSION(r222843): [HarfBuzz] Combining enclosed keycap not correctly handled
Modified: trunk/Source/WebCore/SourcesGTK.txt (229168 => 229169)
--- trunk/Source/WebCore/SourcesGTK.txt 2018-03-02 08:20:56 UTC (rev 229168)
+++ trunk/Source/WebCore/SourcesGTK.txt 2018-03-02 09:23:10 UTC (rev 229169)
@@ -81,6 +81,8 @@
platform/gtk/ScrollAnimatorGtk.cpp
platform/gtk/SelectionData.cpp
+platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp
+
platform/text/Hyphenation.cpp
platform/text/LocaleICU.cpp
Modified: trunk/Source/WebCore/SourcesWPE.txt (229168 => 229169)
--- trunk/Source/WebCore/SourcesWPE.txt 2018-03-02 08:20:56 UTC (rev 229168)
+++ trunk/Source/WebCore/SourcesWPE.txt 2018-03-02 09:23:10 UTC (rev 229169)
@@ -56,6 +56,8 @@
platform/graphics/wpe/ImageWPE.cpp
platform/graphics/wpe/PlatformDisplayWPE.cpp
+platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp
+
platform/text/Hyphenation.cpp
platform/text/LocaleICU.cpp
Modified: trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProvider.cpp (229168 => 229169)
--- trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProvider.cpp 2018-03-02 08:20:56 UTC (rev 229168)
+++ trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProvider.cpp 2018-03-02 09:23:10 UTC (rev 229169)
@@ -26,15 +26,9 @@
#include "config.h"
#include "LibWebRTCProvider.h"
-#if PLATFORM(COCOA)
-#include "LibWebRTCProviderCocoa.h"
-#endif
-
#if USE(LIBWEBRTC)
#include "LibWebRTCAudioModule.h"
#include "Logging.h"
-#include "VideoToolBoxDecoderFactory.h"
-#include "VideoToolBoxEncoderFactory.h"
#include <dlfcn.h>
#include <webrtc/api/peerconnectionfactoryproxy.h>
#include <webrtc/base/physicalsocketserver.h>
@@ -42,19 +36,16 @@
#include <webrtc/pc/peerconnectionfactory.h>
#include <wtf/Function.h>
#include <wtf/NeverDestroyed.h>
-#include <wtf/darwin/WeakLinking.h>
#endif
namespace WebCore {
+#if !PLATFORM(COCOA) && !PLATFORM(GTK) && !PLATFORM(WPE)
UniqueRef<LibWebRTCProvider> LibWebRTCProvider::create()
{
-#if USE(LIBWEBRTC) && PLATFORM(COCOA)
- return makeUniqueRef<LibWebRTCProviderCocoa>();
-#else
return makeUniqueRef<LibWebRTCProvider>();
+}
#endif
-}
#if USE(LIBWEBRTC)
struct PeerConnectionFactoryAndThreads : public rtc::MessageHandler {
@@ -200,13 +191,4 @@
#endif // USE(LIBWEBRTC)
-bool LibWebRTCProvider::webRTCAvailable()
-{
-#if USE(LIBWEBRTC)
- return !isNullFunctionPointer(rtc::LogMessage::LogToDebug);
-#else
- return true;
-#endif
-}
-
} // namespace WebCore
Modified: trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp (229168 => 229169)
--- trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp 2018-03-02 08:20:56 UTC (rev 229168)
+++ trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp 2018-03-02 09:23:10 UTC (rev 229169)
@@ -27,12 +27,24 @@
#include "LibWebRTCProviderCocoa.h"
#if USE(LIBWEBRTC)
-
#include "VideoToolBoxDecoderFactory.h"
#include "VideoToolBoxEncoderFactory.h"
+#include <wtf/darwin/WeakLinking.h>
+#endif
namespace WebCore {
+UniqueRef<LibWebRTCProvider> LibWebRTCProvider::create()
+{
+#if USE(LIBWEBRTC) && PLATFORM(COCOA)
+ return makeUniqueRef<LibWebRTCProviderCocoa>();
+#else
+ return makeUniqueRef<LibWebRTCProvider>();
+#endif
+}
+
+#if USE(LIBWEBRTC)
+
std::unique_ptr<cricket::WebRtcVideoDecoderFactory> LibWebRTCProviderCocoa::createDecoderFactory()
{
ASSERT(!m_decoderFactory);
@@ -59,6 +71,15 @@
m_encoderFactory->setActive(value);
}
-} // namespace WebCore
+#endif // USE(LIBWEBRTC)
+bool LibWebRTCProvider::webRTCAvailable()
+{
+#if USE(LIBWEBRTC)
+ return !isNullFunctionPointer(rtc::LogMessage::LogToDebug);
+#else
+ return true;
#endif
+}
+
+} // namespace WebCore
Copied: trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp (from rev 229168, trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp) (0 => 229169)
--- trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp (rev 0)
+++ trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp 2018-03-02 09:23:10 UTC (rev 229169)
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2017 Igalia S.L. 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.
+ */
+
+namespace WebCore {
+
+UniqueRef<LibWebRTCProvider> LibWebRTCProvider::create()
+{
+#if USE(LIBWEBRTC) && (PLATFORM(GTK) || PLATFORM(WPE))
+ return makeUniqueRef<LibWebRTCProviderGlib>();
+#else
+ return makeUniqueRef<LibWebRTCProvider>();
+#endif
+}
+
+bool LibWebRTCProvider::webRTCAvailable()
+{
+ return true;
+}
+
+} // namespace WebCore