Skip to content

Commit 1ac20ec

Browse files
donny-dontphiln
authored andcommitted
Guard USE(LIBWEBRTC) includes
https://bugs.webkit.org/show_bug.cgi?id=247833 Reviewed by Eric Carlson. Only add `libwebrtc` include directories if `USE_LIBWEBRTC` is `ON`. Guard includes and sources with `USE(LIBWEBRTC)`. Remove includes that aren't necessary. * Source/WebCore/CMakeLists.txt: * Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp: * Source/WebCore/Modules/mediastream/PeerConnectionBackend.h: * Source/WebCore/Modules/mediastream/RTCIceCandidate.h: * Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp: * Source/WebCore/Modules/mediastream/RTCStatsReport.h: * Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCCertificateGenerator.cpp: * Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCCertificateGenerator.h: * Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp: * Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h: * Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCIceTransportBackend.cpp: * Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: * Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h: * Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCObservers.h: * Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: * Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h: * Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.cpp: * Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h: * Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCRtpTransformableFrame.h: * Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp: * Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.h: * Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp: * Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCUtils.h: * Source/WebCore/editing/markup.cpp: * Source/WebCore/loader/EmptyClients.cpp: * Source/WebCore/platform/mediastream/AudioTrackPrivateMediaStream.cpp: * Source/WebCore/platform/mediastream/libwebrtc/gstreamer/LibWebRTCProviderGStreamer.h: * Source/WebCore/svg/graphics/SVGImage.cpp: * Source/WebCore/testing/Internals.cpp: Canonical link: https://commits.webkit.org/256664@main
1 parent b024c61 commit 1ac20ec

29 files changed

Lines changed: 68 additions & 53 deletions

Source/WebCore/CMakeLists.txt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ set(WebCore_PRIVATE_INCLUDE_DIRECTORIES
4848
"${WEBCORE_DIR}/Modules/mediasession"
4949
"${WEBCORE_DIR}/Modules/mediasource"
5050
"${WEBCORE_DIR}/Modules/mediastream"
51-
"${WEBCORE_DIR}/Modules/mediastream/libwebrtc"
5251
"${WEBCORE_DIR}/Modules/model-element"
5352
"${WEBCORE_DIR}/Modules/model-element/dummy"
5453
"${WEBCORE_DIR}/Modules/navigatorcontentutils"
@@ -155,7 +154,6 @@ set(WebCore_PRIVATE_INCLUDE_DIRECTORIES
155154
"${WEBCORE_DIR}/platform/mediacapabilities"
156155
"${WEBCORE_DIR}/platform/mediarecorder"
157156
"${WEBCORE_DIR}/platform/mediastream"
158-
"${WEBCORE_DIR}/platform/mediastream/libwebrtc"
159157
"${WEBCORE_DIR}/platform/mediarecorder"
160158
"${WEBCORE_DIR}/platform/mock"
161159
"${WEBCORE_DIR}/platform/mock/mediasource"
@@ -2038,10 +2036,16 @@ if (USE_XDGMIME)
20382036
endif ()
20392037

20402038
if (USE_LIBWEBRTC)
2041-
list(APPEND WebCore_SYSTEM_INCLUDE_DIRECTORIES "${THIRDPARTY_DIR}/libwebrtc/Source/"
2039+
list(APPEND WebCore_SYSTEM_INCLUDE_DIRECTORIES
2040+
"${THIRDPARTY_DIR}/libwebrtc/Source"
20422041
"${THIRDPARTY_DIR}/libwebrtc/Source/webrtc"
20432042
"${THIRDPARTY_DIR}/libwebrtc/Source/third_party/libvpx/source/libvpx"
2044-
"${THIRDPARTY_DIR}/libwebrtc/Source/third_party/abseil-cpp")
2043+
"${THIRDPARTY_DIR}/libwebrtc/Source/third_party/abseil-cpp"
2044+
)
2045+
list(APPEND WebCore_PRIVATE_INCLUDE_DIRECTORIES
2046+
"${WEBCORE_DIR}/Modules/mediastream/libwebrtc"
2047+
"${WEBCORE_DIR}/platform/mediastream/libwebrtc"
2048+
)
20452049
list(APPEND WebCore_LIBRARIES webrtc)
20462050
list(APPEND WebCore_SOURCES
20472051
Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp

Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636

3737
#include "EventNames.h"
3838
#include "JSRTCCertificate.h"
39-
#include "LibWebRTCCertificateGenerator.h"
4039
#include "Logging.h"
4140
#include "Page.h"
4241
#include "RTCDataChannelEvent.h"
@@ -57,6 +56,11 @@
5756
#include "GStreamerWebRTCUtils.h"
5857
#endif
5958

59+
#if USE(LIBWEBRTC)
60+
#include "LibWebRTCCertificateGenerator.h"
61+
#include "LibWebRTCProvider.h"
62+
#endif
63+
6064
namespace WebCore {
6165

6266
#if USE(LIBWEBRTC) || USE(GSTREAMER_WEBRTC)

Source/WebCore/Modules/mediastream/PeerConnectionBackend.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
#if ENABLE(WEB_RTC)
3535

3636
#include "IDLTypes.h"
37-
#include "LibWebRTCProvider.h"
3837
#include "RTCIceGatheringState.h"
3938
#include "RTCRtpCapabilities.h"
4039
#include "RTCRtpSendParameters.h"

Source/WebCore/Modules/mediastream/RTCIceCandidate.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
#if ENABLE(WEB_RTC)
3434

3535
#include "ExceptionOr.h"
36-
#include "LibWebRTCUtils.h"
3736
#include "RTCIceCandidateFields.h"
3837
#include "ScriptWrappable.h"
3938

Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@
7272
#include <wtf/UUID.h>
7373
#include <wtf/text/Base64.h>
7474

75+
#if USE(LIBWEBRTC)
76+
#include "LibWebRTCProvider.h"
77+
#endif
78+
7579
namespace WebCore {
7680

7781
using namespace PeerConnection;

Source/WebCore/Modules/mediastream/RTCStatsReport.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525

2626
#pragma once
2727

28-
#include "LibWebRTCStatsCollector.h"
2928
#include "RTCIceCandidateType.h"
3029

3130
namespace WebCore {

Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCCertificateGenerator.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,20 @@
2525
#include "config.h"
2626
#include "LibWebRTCCertificateGenerator.h"
2727

28-
#if USE(LIBWEBRTC)
28+
#if ENABLE(WEB_RTC) && USE(LIBWEBRTC)
2929

3030
#include "LibWebRTCMacros.h"
31+
#include "LibWebRTCProvider.h"
3132
#include "RTCCertificate.h"
3233

3334
ALLOW_UNUSED_PARAMETERS_BEGIN
35+
ALLOW_COMMA_BEGIN
3436

37+
#include <webrtc/rtc_base/ref_counted_object.h>
3538
#include <webrtc/rtc_base/rtc_certificate_generator.h>
39+
#include <webrtc/rtc_base/ssl_certificate.h>
3640

41+
ALLOW_COMMA_END
3742
ALLOW_UNUSED_PARAMETERS_END
3843

3944
namespace WebCore {
@@ -121,4 +126,4 @@ void generateCertificate(Ref<SecurityOrigin>&& origin, LibWebRTCProvider& provid
121126

122127
} // namespace WebCore
123128

124-
#endif // USE(LIBWEBRTC)
129+
#endif // ENABLE(WEB_RTC) && USE(LIBWEBRTC)

Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCCertificateGenerator.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
#pragma once
2626

27-
#if USE(LIBWEBRTC)
27+
#if ENABLE(WEB_RTC) && USE(LIBWEBRTC)
2828

2929
#include "PeerConnectionBackend.h"
3030

@@ -41,4 +41,4 @@ void generateCertificate(Ref<SecurityOrigin>&&, LibWebRTCProvider&, const PeerCo
4141

4242
} // namespace WebCore
4343

44-
#endif // USE(LIBWEBRTC)
44+
#endif // ENABLE(WEB_RTC) && USE(LIBWEBRTC)

Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#include "config.h"
2626
#include "LibWebRTCDataChannelHandler.h"
2727

28-
#if USE(LIBWEBRTC)
28+
#if ENABLE(WEB_RTC) && USE(LIBWEBRTC)
2929

3030
#include "EventNames.h"
3131
#include "LibWebRTCUtils.h"
@@ -226,4 +226,4 @@ void LibWebRTCDataChannelHandler::postTask(Function<void()>&& function)
226226

227227
} // namespace WebCore
228228

229-
#endif // USE(LIBWEBRTC)
229+
#endif // ENABLE(WEB_RTC) && USE(LIBWEBRTC)

Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
#pragma once
2626

27-
#if USE(LIBWEBRTC)
27+
#if ENABLE(WEB_RTC) && USE(LIBWEBRTC)
2828

2929
#include "LibWebRTCMacros.h"
3030
#include "ProcessQualified.h"
@@ -103,4 +103,4 @@ class LibWebRTCDataChannelHandler final : public RTCDataChannelHandler, private
103103

104104
} // namespace WebCore
105105

106-
#endif // USE(LIBWEBRTC)
106+
#endif // ENABLE(WEB_RTC) && USE(LIBWEBRTC)

0 commit comments

Comments
 (0)