Add missing RTC_EXPORT for the component build.

Bug: webrtc:9419
Change-Id: I3225259fb4cc55e9820f590928795f4587f1e3cb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153884
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29479}
This commit is contained in:
Mirko Bonadei 2019-09-23 14:54:28 +02:00 committed by Commit Bot
parent ef0627fb50
commit 35214fcfe2
58 changed files with 172 additions and 104 deletions

View file

@ -33,6 +33,9 @@ rtc_source_set("callfactory_api") {
sources = [ sources = [
"call/call_factory_interface.h", "call/call_factory_interface.h",
] ]
deps = [
"../rtc_base/system:rtc_export",
]
} }
if (!build_with_chromium) { if (!build_with_chromium) {

View file

@ -13,6 +13,8 @@
#include <memory> #include <memory>
#include "rtc_base/system/rtc_export.h"
namespace webrtc { namespace webrtc {
// These classes are not part of the API, and are treated as opaque pointers. // These classes are not part of the API, and are treated as opaque pointers.
@ -29,7 +31,7 @@ class CallFactoryInterface {
virtual Call* CreateCall(const CallConfig& config) = 0; virtual Call* CreateCall(const CallConfig& config) = 0;
}; };
std::unique_ptr<CallFactoryInterface> CreateCallFactory(); RTC_EXPORT std::unique_ptr<CallFactoryInterface> CreateCallFactory();
} // namespace webrtc } // namespace webrtc

View file

@ -24,6 +24,7 @@ rtc_source_set("options") {
] ]
deps = [ deps = [
"../../rtc_base:rtc_base", "../../rtc_base:rtc_base",
"../../rtc_base/system:rtc_export",
] ]
} }

View file

@ -13,12 +13,14 @@
#include <vector> #include <vector>
#include "rtc_base/system/rtc_export.h"
namespace webrtc { namespace webrtc {
// CryptoOptions defines advanced cryptographic settings for native WebRTC. // CryptoOptions defines advanced cryptographic settings for native WebRTC.
// These settings must be passed into PeerConnectionFactoryInterface::Options // These settings must be passed into PeerConnectionFactoryInterface::Options
// and are only applicable to native use cases of WebRTC. // and are only applicable to native use cases of WebRTC.
struct CryptoOptions { struct RTC_EXPORT CryptoOptions {
CryptoOptions(); CryptoOptions();
CryptoOptions(const CryptoOptions& other); CryptoOptions(const CryptoOptions& other);
~CryptoOptions(); ~CryptoOptions();

View file

@ -23,6 +23,7 @@
#include "rtc_base/checks.h" #include "rtc_base/checks.h"
#include "rtc_base/copy_on_write_buffer.h" #include "rtc_base/copy_on_write_buffer.h"
#include "rtc_base/ref_count.h" #include "rtc_base/ref_count.h"
#include "rtc_base/system/rtc_export.h"
namespace webrtc { namespace webrtc {
@ -96,7 +97,7 @@ class DataChannelObserver {
virtual ~DataChannelObserver() = default; virtual ~DataChannelObserver() = default;
}; };
class DataChannelInterface : public rtc::RefCountInterface { class RTC_EXPORT DataChannelInterface : public rtc::RefCountInterface {
public: public:
// C++ version of: https://www.w3.org/TR/webrtc/#idl-def-rtcdatachannelstate // C++ version of: https://www.w3.org/TR/webrtc/#idl-def-rtcdatachannelstate
// Unlikely to change, but keep in sync with DataChannel.java:State and // Unlikely to change, but keep in sync with DataChannel.java:State and

View file

@ -20,6 +20,7 @@
#include "api/scoped_refptr.h" #include "api/scoped_refptr.h"
#include "rtc_base/ref_count.h" #include "rtc_base/ref_count.h"
#include "rtc_base/ssl_certificate.h" #include "rtc_base/ssl_certificate.h"
#include "rtc_base/system/rtc_export.h"
namespace webrtc { namespace webrtc {
@ -37,7 +38,7 @@ enum class DtlsTransportState {
// This object gives snapshot information about the changeable state of a // This object gives snapshot information about the changeable state of a
// DTLSTransport. // DTLSTransport.
class DtlsTransportInformation { class RTC_EXPORT DtlsTransportInformation {
public: public:
DtlsTransportInformation(); DtlsTransportInformation();
explicit DtlsTransportInformation(DtlsTransportState state); explicit DtlsTransportInformation(DtlsTransportState state);

View file

@ -52,7 +52,7 @@ struct SdpParseError {
// a time and is therefore not expected to be thread safe. // a time and is therefore not expected to be thread safe.
// //
// An instance can be created by CreateIceCandidate. // An instance can be created by CreateIceCandidate.
class IceCandidateInterface { class RTC_EXPORT IceCandidateInterface {
public: public:
virtual ~IceCandidateInterface() {} virtual ~IceCandidateInterface() {}
// If present, this is the value of the "a=mid" attribute of the candidate's // If present, this is the value of the "a=mid" attribute of the candidate's

View file

@ -145,8 +145,9 @@ class VideoTrackSourceInterface : public MediaSourceInterface,
// PeerConnectionFactory::CreateVideoTrack can be used for creating a VideoTrack // PeerConnectionFactory::CreateVideoTrack can be used for creating a VideoTrack
// that ensures thread safety and that all methods are called on the right // that ensures thread safety and that all methods are called on the right
// thread. // thread.
class VideoTrackInterface : public MediaStreamTrackInterface, class RTC_EXPORT VideoTrackInterface
public rtc::VideoSourceInterface<VideoFrame> { : public MediaStreamTrackInterface,
public rtc::VideoSourceInterface<VideoFrame> {
public: public:
// Video track content hint, used to override the source is_screencast // Video track content hint, used to override the source is_screencast
// property. // property.
@ -235,7 +236,7 @@ class AudioProcessorInterface : public rtc::RefCountInterface {
~AudioProcessorInterface() override = default; ~AudioProcessorInterface() override = default;
}; };
class AudioTrackInterface : public MediaStreamTrackInterface { class RTC_EXPORT AudioTrackInterface : public MediaStreamTrackInterface {
public: public:
// TODO(deadbeef): Figure out if the following interface should be const or // TODO(deadbeef): Figure out if the following interface should be const or
// not. // not.

View file

@ -1253,7 +1253,7 @@ class PeerConnectionObserver {
// All new dependencies should be added as a unique_ptr to allow the // All new dependencies should be added as a unique_ptr to allow the
// PeerConnection object to be the definitive owner of the dependencies // PeerConnection object to be the definitive owner of the dependencies
// lifetime making injection safer. // lifetime making injection safer.
struct PeerConnectionDependencies final { struct RTC_EXPORT PeerConnectionDependencies final {
explicit PeerConnectionDependencies(PeerConnectionObserver* observer_in); explicit PeerConnectionDependencies(PeerConnectionObserver* observer_in);
// This object is not copyable or assignable. // This object is not copyable or assignable.
PeerConnectionDependencies(const PeerConnectionDependencies&) = delete; PeerConnectionDependencies(const PeerConnectionDependencies&) = delete;
@ -1284,7 +1284,7 @@ struct PeerConnectionDependencies final {
// clear which are mandatory and optional. If possible please allow the peer // clear which are mandatory and optional. If possible please allow the peer
// connection factory to take ownership of the dependency by adding a unique_ptr // connection factory to take ownership of the dependency by adding a unique_ptr
// to this structure. // to this structure.
struct PeerConnectionFactoryDependencies final { struct RTC_EXPORT PeerConnectionFactoryDependencies final {
PeerConnectionFactoryDependencies(); PeerConnectionFactoryDependencies();
// This object is not copyable or assignable. // This object is not copyable or assignable.
PeerConnectionFactoryDependencies(const PeerConnectionFactoryDependencies&) = PeerConnectionFactoryDependencies(const PeerConnectionFactoryDependencies&) =
@ -1457,7 +1457,7 @@ class PeerConnectionFactoryInterface : public rtc::RefCountInterface {
// will create the necessary thread internally. If |signaling_thread| is null, // will create the necessary thread internally. If |signaling_thread| is null,
// the PeerConnectionFactory will use the thread on which this method is called // the PeerConnectionFactory will use the thread on which this method is called
// as the signaling thread, wrapping it in an rtc::Thread object if needed. // as the signaling thread, wrapping it in an rtc::Thread object if needed.
rtc::scoped_refptr<PeerConnectionFactoryInterface> RTC_EXPORT rtc::scoped_refptr<PeerConnectionFactoryInterface>
CreateModularPeerConnectionFactory( CreateModularPeerConnectionFactory(
PeerConnectionFactoryDependencies dependencies); PeerConnectionFactoryDependencies dependencies);

View file

@ -61,6 +61,7 @@
#include "rtc_base/message_handler.h" #include "rtc_base/message_handler.h"
#include "rtc_base/message_queue.h" #include "rtc_base/message_queue.h"
#include "rtc_base/ref_counted_object.h" #include "rtc_base/ref_counted_object.h"
#include "rtc_base/system/rtc_export.h"
#include "rtc_base/thread.h" #include "rtc_base/thread.h"
namespace rtc { namespace rtc {
@ -140,8 +141,8 @@ class ReturnType<void> {
namespace internal { namespace internal {
class SynchronousMethodCall : public rtc::MessageData, class RTC_EXPORT SynchronousMethodCall : public rtc::MessageData,
public rtc::MessageHandler { public rtc::MessageHandler {
public: public:
explicit SynchronousMethodCall(rtc::MessageHandler* proxy); explicit SynchronousMethodCall(rtc::MessageHandler* proxy);
~SynchronousMethodCall() override; ~SynchronousMethodCall() override;

View file

@ -131,7 +131,7 @@ class RTC_EXPORT RTCError {
// //
// Only intended to be used for logging/diagnostics. The returned char* points // Only intended to be used for logging/diagnostics. The returned char* points
// to literal string that lives for the whole duration of the program. // to literal string that lives for the whole duration of the program.
const char* ToString(RTCErrorType error); RTC_EXPORT const char* ToString(RTCErrorType error);
#ifdef UNIT_TEST #ifdef UNIT_TEST
inline std::ostream& operator<<( // no-presubmit-check TODO(webrtc:8982) inline std::ostream& operator<<( // no-presubmit-check TODO(webrtc:8982)

View file

@ -36,6 +36,7 @@ rtc_source_set("rtc_event_log_factory") {
deps = [ deps = [
":rtc_event_log", ":rtc_event_log",
"../../rtc_base:checks", "../../rtc_base:checks",
"../../rtc_base/system:rtc_export",
"../task_queue", "../task_queue",
] ]

View file

@ -16,10 +16,11 @@
#include "api/rtc_event_log/rtc_event_log.h" #include "api/rtc_event_log/rtc_event_log.h"
#include "api/rtc_event_log/rtc_event_log_factory_interface.h" #include "api/rtc_event_log/rtc_event_log_factory_interface.h"
#include "api/task_queue/task_queue_factory.h" #include "api/task_queue/task_queue_factory.h"
#include "rtc_base/system/rtc_export.h"
namespace webrtc { namespace webrtc {
class RtcEventLogFactory : public RtcEventLogFactoryInterface { class RTC_EXPORT RtcEventLogFactory : public RtcEventLogFactoryInterface {
public: public:
explicit RtcEventLogFactory(TaskQueueFactory* task_queue_factory); explicit RtcEventLogFactory(TaskQueueFactory* task_queue_factory);
~RtcEventLogFactory() override {} ~RtcEventLogFactory() override {}

View file

@ -91,7 +91,7 @@ enum class DegradationPreference {
RTC_EXPORT extern const double kDefaultBitratePriority; RTC_EXPORT extern const double kDefaultBitratePriority;
struct RtcpFeedback { struct RTC_EXPORT RtcpFeedback {
RtcpFeedbackType type = RtcpFeedbackType::CCM; RtcpFeedbackType type = RtcpFeedbackType::CCM;
// Equivalent to ORTC "parameter" field with slight differences: // Equivalent to ORTC "parameter" field with slight differences:
@ -116,7 +116,7 @@ struct RtcpFeedback {
// RtpCodecCapability is to RtpCodecParameters as RtpCapabilities is to // RtpCodecCapability is to RtpCodecParameters as RtpCapabilities is to
// RtpParameters. This represents the static capabilities of an endpoint's // RtpParameters. This represents the static capabilities of an endpoint's
// implementation of a codec. // implementation of a codec.
struct RtpCodecCapability { struct RTC_EXPORT RtpCodecCapability {
RtpCodecCapability(); RtpCodecCapability();
~RtpCodecCapability(); ~RtpCodecCapability();
@ -230,7 +230,7 @@ struct RtpHeaderExtensionCapability {
}; };
// RTP header extension, see RFC8285. // RTP header extension, see RFC8285.
struct RtpExtension { struct RTC_EXPORT RtpExtension {
RtpExtension(); RtpExtension();
RtpExtension(const std::string& uri, int id); RtpExtension(const std::string& uri, int id);
RtpExtension(const std::string& uri, int id, bool encrypt); RtpExtension(const std::string& uri, int id, bool encrypt);
@ -332,7 +332,7 @@ struct RtpExtension {
// TODO(deadbeef): This is missing the "encrypt" flag, which is unimplemented. // TODO(deadbeef): This is missing the "encrypt" flag, which is unimplemented.
typedef RtpExtension RtpHeaderExtensionParameters; typedef RtpExtension RtpHeaderExtensionParameters;
struct RtpFecParameters { struct RTC_EXPORT RtpFecParameters {
// If unset, a value is chosen by the implementation. // If unset, a value is chosen by the implementation.
// Works just like RtpEncodingParameters::ssrc. // Works just like RtpEncodingParameters::ssrc.
absl::optional<uint32_t> ssrc; absl::optional<uint32_t> ssrc;
@ -352,7 +352,7 @@ struct RtpFecParameters {
bool operator!=(const RtpFecParameters& o) const { return !(*this == o); } bool operator!=(const RtpFecParameters& o) const { return !(*this == o); }
}; };
struct RtpRtxParameters { struct RTC_EXPORT RtpRtxParameters {
// If unset, a value is chosen by the implementation. // If unset, a value is chosen by the implementation.
// Works just like RtpEncodingParameters::ssrc. // Works just like RtpEncodingParameters::ssrc.
absl::optional<uint32_t> ssrc; absl::optional<uint32_t> ssrc;
@ -502,7 +502,7 @@ struct RTC_EXPORT RtpEncodingParameters {
} }
}; };
struct RtpCodecParameters { struct RTC_EXPORT RtpCodecParameters {
RtpCodecParameters(); RtpCodecParameters();
RtpCodecParameters(const RtpCodecParameters&); RtpCodecParameters(const RtpCodecParameters&);
~RtpCodecParameters(); ~RtpCodecParameters();

View file

@ -27,6 +27,7 @@
#include "api/transport/rtp/rtp_source.h" #include "api/transport/rtp/rtp_source.h"
#include "rtc_base/deprecation.h" #include "rtc_base/deprecation.h"
#include "rtc_base/ref_count.h" #include "rtc_base/ref_count.h"
#include "rtc_base/system/rtc_export.h"
namespace webrtc { namespace webrtc {
@ -44,7 +45,7 @@ class RtpReceiverObserverInterface {
virtual ~RtpReceiverObserverInterface() {} virtual ~RtpReceiverObserverInterface() {}
}; };
class RtpReceiverInterface : public rtc::RefCountInterface { class RTC_EXPORT RtpReceiverInterface : public rtc::RefCountInterface {
public: public:
virtual rtc::scoped_refptr<MediaStreamTrackInterface> track() const = 0; virtual rtc::scoped_refptr<MediaStreamTrackInterface> track() const = 0;

View file

@ -27,10 +27,11 @@
#include "api/rtp_parameters.h" #include "api/rtp_parameters.h"
#include "api/scoped_refptr.h" #include "api/scoped_refptr.h"
#include "rtc_base/ref_count.h" #include "rtc_base/ref_count.h"
#include "rtc_base/system/rtc_export.h"
namespace webrtc { namespace webrtc {
class RtpSenderInterface : public rtc::RefCountInterface { class RTC_EXPORT RtpSenderInterface : public rtc::RefCountInterface {
public: public:
// Returns true if successful in setting the track. // Returns true if successful in setting the track.
// Fails if an audio track is set on a video RtpSender, or vice-versa. // Fails if an audio track is set on a video RtpSender, or vice-versa.

View file

@ -65,7 +65,7 @@ struct RTC_EXPORT RtpTransceiverInit final {
// //
// WebRTC specification for RTCRtpTransceiver, the JavaScript analog: // WebRTC specification for RTCRtpTransceiver, the JavaScript analog:
// https://w3c.github.io/webrtc-pc/#dom-rtcrtptransceiver // https://w3c.github.io/webrtc-pc/#dom-rtcrtptransceiver
class RtpTransceiverInterface : public rtc::RefCountInterface { class RTC_EXPORT RtpTransceiverInterface : public rtc::RefCountInterface {
public: public:
// Media type of the transceiver. Any sender(s)/receiver(s) will have this // Media type of the transceiver. Any sender(s)/receiver(s) will have this
// type as well. // type as well.

View file

@ -24,11 +24,12 @@
#include "rtc_base/constructor_magic.h" #include "rtc_base/constructor_magic.h"
#include "rtc_base/ref_count.h" #include "rtc_base/ref_count.h"
#include "rtc_base/string_encode.h" #include "rtc_base/string_encode.h"
#include "rtc_base/system/rtc_export.h"
#include "rtc_base/thread_checker.h" #include "rtc_base/thread_checker.h"
namespace webrtc { namespace webrtc {
class StatsReport { class RTC_EXPORT StatsReport {
public: public:
// Indicates whether a track is for sending or receiving. // Indicates whether a track is for sending or receiving.
// Used in reports for audio/video tracks. // Used in reports for audio/video tracks.

View file

@ -26,6 +26,7 @@ rtc_source_set("video_rtp_headers") {
deps = [ deps = [
"..:array_view", "..:array_view",
"../../rtc_base:rtc_base_approved", "../../rtc_base:rtc_base_approved",
"../../rtc_base/system:rtc_export",
"//third_party/abseil-cpp/absl/types:optional", "//third_party/abseil-cpp/absl/types:optional",
] ]
} }

View file

@ -15,6 +15,7 @@
#include "absl/types/optional.h" #include "absl/types/optional.h"
#include "api/video/hdr_metadata.h" #include "api/video/hdr_metadata.h"
#include "rtc_base/system/rtc_export.h"
namespace webrtc { namespace webrtc {
@ -31,7 +32,7 @@ namespace webrtc {
// E.2.1, "VUI parameters semantics", available from // E.2.1, "VUI parameters semantics", available from
// https://www.itu.int/rec/T-REC-H.264. // https://www.itu.int/rec/T-REC-H.264.
class ColorSpace { class RTC_EXPORT ColorSpace {
public: public:
enum class PrimaryID : uint8_t { enum class PrimaryID : uint8_t {
// The indices are equal to the values specified in T-REC H.273 Table 2. // The indices are equal to the values specified in T-REC H.273 Table 2.

View file

@ -15,6 +15,7 @@
#include "api/scoped_refptr.h" #include "api/scoped_refptr.h"
#include "rtc_base/ref_count.h" #include "rtc_base/ref_count.h"
#include "rtc_base/system/rtc_export.h"
namespace webrtc { namespace webrtc {
@ -38,7 +39,7 @@ class I010BufferInterface;
// performance by providing an optimized path without intermediate conversions. // performance by providing an optimized path without intermediate conversions.
// Frame metadata such as rotation and timestamp are stored in // Frame metadata such as rotation and timestamp are stored in
// webrtc::VideoFrame, and not here. // webrtc::VideoFrame, and not here.
class VideoFrameBuffer : public rtc::RefCountInterface { class RTC_EXPORT VideoFrameBuffer : public rtc::RefCountInterface {
public: public:
// New frame buffer types will be added conservatively when there is an // New frame buffer types will be added conservatively when there is an
// opportunity to optimize the path between some pair of video source and // opportunity to optimize the path between some pair of video source and
@ -113,7 +114,7 @@ class PlanarYuv8Buffer : public PlanarYuvBuffer {
~PlanarYuv8Buffer() override {} ~PlanarYuv8Buffer() override {}
}; };
class I420BufferInterface : public PlanarYuv8Buffer { class RTC_EXPORT I420BufferInterface : public PlanarYuv8Buffer {
public: public:
Type type() const override; Type type() const override;
@ -127,7 +128,7 @@ class I420BufferInterface : public PlanarYuv8Buffer {
~I420BufferInterface() override {} ~I420BufferInterface() override {}
}; };
class I420ABufferInterface : public I420BufferInterface { class RTC_EXPORT I420ABufferInterface : public I420BufferInterface {
public: public:
Type type() const final; Type type() const final;
virtual const uint8_t* DataA() const = 0; virtual const uint8_t* DataA() const = 0;

View file

@ -27,6 +27,7 @@
#include "media/base/media_engine.h" #include "media/base/media_engine.h"
#include "modules/audio_device/include/audio_device.h" #include "modules/audio_device/include/audio_device.h"
#include "modules/audio_processing/include/audio_processing.h" #include "modules/audio_processing/include/audio_processing.h"
#include "rtc_base/system/rtc_export.h"
namespace cricket { namespace cricket {
@ -52,7 +53,7 @@ struct MediaEngineDependencies {
// CreateMediaEngine may be called on any thread, though the engine is // CreateMediaEngine may be called on any thread, though the engine is
// only expected to be used on one thread, internally called the "worker // only expected to be used on one thread, internally called the "worker
// thread". This is the thread Init must be called on. // thread". This is the thread Init must be called on.
std::unique_ptr<MediaEngineInterface> CreateMediaEngine( RTC_EXPORT std::unique_ptr<MediaEngineInterface> CreateMediaEngine(
MediaEngineDependencies dependencies); MediaEngineDependencies dependencies);
// Verify that extension IDs are within 1-byte extension range and are not // Verify that extension IDs are within 1-byte extension range and are not

View file

@ -226,7 +226,7 @@ struct ExperimentalNs {
// // Close the application... // // Close the application...
// delete apm; // delete apm;
// //
class AudioProcessing : public rtc::RefCountInterface { class RTC_EXPORT AudioProcessing : public rtc::RefCountInterface {
public: public:
// The struct below constitutes the new parameter scheme for the audio // The struct below constitutes the new parameter scheme for the audio
// processing. It is being introduced gradually and until it is fully // processing. It is being introduced gradually and until it is fully

View file

@ -174,7 +174,7 @@ class RTC_EXPORT BasicDesktopFrame : public DesktopFrame {
}; };
// A DesktopFrame that stores data in shared memory. // A DesktopFrame that stores data in shared memory.
class SharedMemoryDesktopFrame : public DesktopFrame { class RTC_EXPORT SharedMemoryDesktopFrame : public DesktopFrame {
public: public:
// May return nullptr if |shared_memory_factory| failed to create a // May return nullptr if |shared_memory_factory| failed to create a
// SharedMemory instance. // SharedMemory instance.

View file

@ -20,6 +20,7 @@
#include <memory> #include <memory>
#include "rtc_base/constructor_magic.h" #include "rtc_base/constructor_magic.h"
#include "rtc_base/system/rtc_export.h"
namespace webrtc { namespace webrtc {
@ -29,7 +30,7 @@ namespace webrtc {
// for video frames must extend this class with creation and destruction logic // for video frames must extend this class with creation and destruction logic
// specific for the target platform and then call // specific for the target platform and then call
// DesktopCapturer::SetSharedMemoryFactory(). // DesktopCapturer::SetSharedMemoryFactory().
class SharedMemory { class RTC_EXPORT SharedMemory {
public: public:
#if defined(WEBRTC_WIN) #if defined(WEBRTC_WIN)
typedef HANDLE Handle; typedef HANDLE Handle;

View file

@ -119,6 +119,7 @@ rtc_static_library("rtc_pc_base") {
"../rtc_base:rtc_task_queue", "../rtc_base:rtc_task_queue",
"../rtc_base:stringutils", "../rtc_base:stringutils",
"../rtc_base/system:file_wrapper", "../rtc_base/system:file_wrapper",
"../rtc_base/system:rtc_export",
"../rtc_base/third_party/base64", "../rtc_base/third_party/base64",
"../rtc_base/third_party/sigslot", "../rtc_base/third_party/sigslot",
"../system_wrappers:field_trial", "../system_wrappers:field_trial",

View file

@ -33,6 +33,7 @@
#include "pc/simulcast_description.h" #include "pc/simulcast_description.h"
#include "rtc_base/deprecation.h" #include "rtc_base/deprecation.h"
#include "rtc_base/socket_address.h" #include "rtc_base/socket_address.h"
#include "rtc_base/system/rtc_export.h"
namespace cricket { namespace cricket {
@ -420,7 +421,7 @@ constexpr MediaProtocolType NS_JINGLE_DRAFT_SCTP = MediaProtocolType::kSctp;
// Represents a session description section. Most information about the section // Represents a session description section. Most information about the section
// is stored in the description, which is a subclass of MediaContentDescription. // is stored in the description, which is a subclass of MediaContentDescription.
// Owns the description. // Owns the description.
class ContentInfo { class RTC_EXPORT ContentInfo {
public: public:
explicit ContentInfo(MediaProtocolType type) : type(type) {} explicit ContentInfo(MediaProtocolType type) : type(type) {}
~ContentInfo(); ~ContentInfo();

View file

@ -58,6 +58,7 @@ rtc_source_set("rtc_base_approved") {
"../api:array_view", "../api:array_view",
"../api:scoped_refptr", "../api:scoped_refptr",
"system:arch", "system:arch",
"system:rtc_export",
"system:unused", "system:unused",
"third_party/base64", "third_party/base64",
"//third_party/abseil-cpp/absl/types:optional", "//third_party/abseil-cpp/absl/types:optional",
@ -311,6 +312,7 @@ rtc_source_set("checks") {
deps = [ deps = [
":safe_compare", ":safe_compare",
"system:inline", "system:inline",
"system:rtc_export",
"//third_party/abseil-cpp/absl/meta:type_traits", "//third_party/abseil-cpp/absl/meta:type_traits",
"//third_party/abseil-cpp/absl/strings", "//third_party/abseil-cpp/absl/strings",
] ]
@ -390,6 +392,7 @@ rtc_source_set("timeutils") {
":checks", ":checks",
":safe_conversions", ":safe_conversions",
":stringutils", ":stringutils",
"system:rtc_export",
] ]
libs = [] libs = []
if (is_win) { if (is_win) {
@ -762,6 +765,7 @@ rtc_static_library("rtc_base") {
"../api:scoped_refptr", "../api:scoped_refptr",
"network:sent_packet", "network:sent_packet",
"system:file_wrapper", "system:file_wrapper",
"system:rtc_export",
"third_party/base64", "third_party/base64",
"third_party/sigslot", "third_party/sigslot",
"//third_party/abseil-cpp/absl/algorithm:container", "//third_party/abseil-cpp/absl/algorithm:container",

View file

@ -15,6 +15,7 @@
#include "rtc_base/dscp.h" #include "rtc_base/dscp.h"
#include "rtc_base/network/sent_packet.h" #include "rtc_base/network/sent_packet.h"
#include "rtc_base/socket.h" #include "rtc_base/socket.h"
#include "rtc_base/system/rtc_export.h"
#include "rtc_base/third_party/sigslot/sigslot.h" #include "rtc_base/third_party/sigslot/sigslot.h"
#include "rtc_base/time_utils.h" #include "rtc_base/time_utils.h"
@ -36,7 +37,7 @@ struct PacketTimeUpdateParams {
// This structure holds meta information for the packet which is about to send // This structure holds meta information for the packet which is about to send
// over network. // over network.
struct PacketOptions { struct RTC_EXPORT PacketOptions {
PacketOptions(); PacketOptions();
explicit PacketOptions(DiffServCodePoint dscp); explicit PacketOptions(DiffServCodePoint dscp);
PacketOptions(const PacketOptions& other); PacketOptions(const PacketOptions& other);
@ -53,7 +54,7 @@ struct PacketOptions {
// Provides the ability to receive packets asynchronously. Sends are not // Provides the ability to receive packets asynchronously. Sends are not
// buffered since it is acceptable to drop packets under high load. // buffered since it is acceptable to drop packets under high load.
class AsyncPacketSocket : public sigslot::has_slots<> { class RTC_EXPORT AsyncPacketSocket : public sigslot::has_slots<> {
public: public:
enum State { enum State {
STATE_CLOSED, STATE_CLOSED,

View file

@ -12,12 +12,13 @@
#define RTC_BASE_ASYNC_RESOLVER_INTERFACE_H_ #define RTC_BASE_ASYNC_RESOLVER_INTERFACE_H_
#include "rtc_base/socket_address.h" #include "rtc_base/socket_address.h"
#include "rtc_base/system/rtc_export.h"
#include "rtc_base/third_party/sigslot/sigslot.h" #include "rtc_base/third_party/sigslot/sigslot.h"
namespace rtc { namespace rtc {
// This interface defines the methods to resolve the address asynchronously. // This interface defines the methods to resolve the address asynchronously.
class AsyncResolverInterface { class RTC_EXPORT AsyncResolverInterface {
public: public:
AsyncResolverInterface(); AsyncResolverInterface();
virtual ~AsyncResolverInterface(); virtual ~AsyncResolverInterface();

View file

@ -46,6 +46,7 @@ RTC_NORETURN void rtc_FatalMessage(const char* file, int line, const char* msg);
#include "absl/strings/string_view.h" #include "absl/strings/string_view.h"
#include "rtc_base/numerics/safe_compare.h" #include "rtc_base/numerics/safe_compare.h"
#include "rtc_base/system/inline.h" #include "rtc_base/system/inline.h"
#include "rtc_base/system/rtc_export.h"
// The macros here print a message to stderr and abort under various // The macros here print a message to stderr and abort under various
// conditions. All will accept additional stream messages. For example: // conditions. All will accept additional stream messages. For example:
@ -108,11 +109,11 @@ enum class CheckArgType : int8_t {
kCheckOp, kCheckOp,
}; };
RTC_NORETURN void FatalLog(const char* file, RTC_NORETURN RTC_EXPORT void FatalLog(const char* file,
int line, int line,
const char* message, const char* message,
const CheckArgType* fmt, const CheckArgType* fmt,
...); ...);
// Wrapper for log arguments. Only ever make values of this type with the // Wrapper for log arguments. Only ever make values of this type with the
// MakeVal() functions. // MakeVal() functions.

View file

@ -23,10 +23,11 @@
#include "rtc_base/buffer.h" #include "rtc_base/buffer.h"
#include "rtc_base/checks.h" #include "rtc_base/checks.h"
#include "rtc_base/ref_counted_object.h" #include "rtc_base/ref_counted_object.h"
#include "rtc_base/system/rtc_export.h"
namespace rtc { namespace rtc {
class CopyOnWriteBuffer { class RTC_EXPORT CopyOnWriteBuffer {
public: public:
// An empty buffer. // An empty buffer.
CopyOnWriteBuffer(); CopyOnWriteBuffer();

View file

@ -13,6 +13,8 @@
#include <stddef.h> #include <stddef.h>
#include "rtc_base/system/rtc_export.h"
namespace rtc { namespace rtc {
// Limits the rate of use to a certain maximum quantity per period of // Limits the rate of use to a certain maximum quantity per period of
@ -21,7 +23,7 @@ namespace rtc {
// It's implemented like a diet plan: You have so many calories per // It's implemented like a diet plan: You have so many calories per
// day. If you hit the limit, you can't eat any more until the next // day. If you hit the limit, you can't eat any more until the next
// day. // day.
class DataRateLimiter { class RTC_EXPORT DataRateLimiter {
public: public:
// For example, 100kb per second. // For example, 100kb per second.
DataRateLimiter(size_t max, double period) DataRateLimiter(size_t max, double period)

View file

@ -16,6 +16,8 @@
#include <string> #include <string>
#include "rtc_base/system/rtc_export.h"
namespace rtc { namespace rtc {
// For testing, we can return predictable data. // For testing, we can return predictable data.
@ -27,21 +29,21 @@ bool InitRandom(const char* seed, size_t len);
// Generates a (cryptographically) random string of the given length. // Generates a (cryptographically) random string of the given length.
// We generate base64 values so that they will be printable. // We generate base64 values so that they will be printable.
std::string CreateRandomString(size_t length); RTC_EXPORT std::string CreateRandomString(size_t length);
// Generates a (cryptographically) random string of the given length. // Generates a (cryptographically) random string of the given length.
// We generate base64 values so that they will be printable. // We generate base64 values so that they will be printable.
// Return false if the random number generator failed. // Return false if the random number generator failed.
bool CreateRandomString(size_t length, std::string* str); RTC_EXPORT bool CreateRandomString(size_t length, std::string* str);
// Generates a (cryptographically) random string of the given length, // Generates a (cryptographically) random string of the given length,
// with characters from the given table. Return false if the random // with characters from the given table. Return false if the random
// number generator failed. // number generator failed.
// For ease of implementation, the function requires that the table // For ease of implementation, the function requires that the table
// size evenly divide 256; otherwise, it returns false. // size evenly divide 256; otherwise, it returns false.
bool CreateRandomString(size_t length, RTC_EXPORT bool CreateRandomString(size_t length,
const std::string& table, const std::string& table,
std::string* str); std::string* str);
// Generates (cryptographically) random data of the given length. // Generates (cryptographically) random data of the given length.
// Return false if the random number generator failed. // Return false if the random number generator failed.
@ -54,7 +56,7 @@ std::string CreateRandomUuid();
uint32_t CreateRandomId(); uint32_t CreateRandomId();
// Generates a 64 bit random id. // Generates a 64 bit random id.
uint64_t CreateRandomId64(); RTC_EXPORT uint64_t CreateRandomId64();
// Generates a random id > 0. // Generates a random id > 0.
uint32_t CreateRandomNonZeroId(); uint32_t CreateRandomNonZeroId();

View file

@ -29,6 +29,7 @@
#if defined(WEBRTC_WIN) #if defined(WEBRTC_WIN)
#include "rtc_base/win32.h" #include "rtc_base/win32.h"
#endif #endif
#include "rtc_base/system/rtc_export.h"
namespace rtc { namespace rtc {
@ -46,7 +47,7 @@ enum IPv6AddressFlag {
}; };
// Version-agnostic IP address class, wraps a union of in_addr and in6_addr. // Version-agnostic IP address class, wraps a union of in_addr and in6_addr.
class IPAddress { class RTC_EXPORT IPAddress {
public: public:
IPAddress() : family_(AF_UNSPEC) { ::memset(&u_, 0, sizeof(u_)); } IPAddress() : family_(AF_UNSPEC) { ::memset(&u_, 0, sizeof(u_)); }
@ -123,7 +124,7 @@ class IPAddress {
// IP class which could represent IPv6 address flags which is only // IP class which could represent IPv6 address flags which is only
// meaningful in IPv6 case. // meaningful in IPv6 case.
class InterfaceAddress : public IPAddress { class RTC_EXPORT InterfaceAddress : public IPAddress {
public: public:
InterfaceAddress() : ipv6_flags_(IPV6_ADDRESS_FLAG_NONE) {} InterfaceAddress() : ipv6_flags_(IPV6_ADDRESS_FLAG_NONE) {}
@ -150,8 +151,10 @@ class InterfaceAddress : public IPAddress {
}; };
bool IPFromAddrInfo(struct addrinfo* info, IPAddress* out); bool IPFromAddrInfo(struct addrinfo* info, IPAddress* out);
bool IPFromString(const std::string& str, IPAddress* out); RTC_EXPORT bool IPFromString(const std::string& str, IPAddress* out);
bool IPFromString(const std::string& str, int flags, InterfaceAddress* out); RTC_EXPORT bool IPFromString(const std::string& str,
int flags,
InterfaceAddress* out);
bool IPIsAny(const IPAddress& ip); bool IPIsAny(const IPAddress& ip);
bool IPIsLoopback(const IPAddress& ip); bool IPIsLoopback(const IPAddress& ip);
bool IPIsLinkLocal(const IPAddress& ip); bool IPIsLinkLocal(const IPAddress& ip);
@ -164,14 +167,14 @@ bool IPIsSharedNetwork(const IPAddress& ip);
// Identify if an IP is "private", that is a loopback // Identify if an IP is "private", that is a loopback
// or an address belonging to a link-local, a private network or a shared // or an address belonging to a link-local, a private network or a shared
// network. // network.
bool IPIsPrivate(const IPAddress& ip); RTC_EXPORT bool IPIsPrivate(const IPAddress& ip);
bool IPIsUnspec(const IPAddress& ip); bool IPIsUnspec(const IPAddress& ip);
size_t HashIP(const IPAddress& ip); size_t HashIP(const IPAddress& ip);
// These are only really applicable for IPv6 addresses. // These are only really applicable for IPv6 addresses.
bool IPIs6Bone(const IPAddress& ip); bool IPIs6Bone(const IPAddress& ip);
bool IPIs6To4(const IPAddress& ip); bool IPIs6To4(const IPAddress& ip);
bool IPIsMacBased(const IPAddress& ip); RTC_EXPORT bool IPIsMacBased(const IPAddress& ip);
bool IPIsSiteLocal(const IPAddress& ip); bool IPIsSiteLocal(const IPAddress& ip);
bool IPIsTeredo(const IPAddress& ip); bool IPIsTeredo(const IPAddress& ip);
bool IPIsULA(const IPAddress& ip); bool IPIsULA(const IPAddress& ip);
@ -182,7 +185,7 @@ bool IPIsV4Mapped(const IPAddress& ip);
int IPAddressPrecedence(const IPAddress& ip); int IPAddressPrecedence(const IPAddress& ip);
// Returns 'ip' truncated to be 'length' bits long. // Returns 'ip' truncated to be 'length' bits long.
IPAddress TruncateIP(const IPAddress& ip, int length); RTC_EXPORT IPAddress TruncateIP(const IPAddress& ip, int length);
IPAddress GetLoopbackIP(int family); IPAddress GetLoopbackIP(int family);
IPAddress GetAnyIP(int family); IPAddress GetAnyIP(int family);

View file

@ -14,6 +14,7 @@
#include <string> #include <string>
#include "rtc_base/stringize_macros.h" #include "rtc_base/stringize_macros.h"
#include "rtc_base/system/rtc_export.h"
namespace rtc { namespace rtc {
@ -21,7 +22,7 @@ namespace rtc {
// significantly brought to life. // significantly brought to life.
// This is a stripped down version of: // This is a stripped down version of:
// https://code.google.com/p/chromium/codesearch#chromium/src/base/location.h // https://code.google.com/p/chromium/codesearch#chromium/src/base/location.h
class Location { class RTC_EXPORT Location {
public: public:
// Constructor should be called with a long-lived char*, such as __FILE__. // Constructor should be called with a long-lived char*, such as __FILE__.
// It assumes the provided value will persist as a global constant, and it // It assumes the provided value will persist as a global constant, and it

View file

@ -14,6 +14,7 @@
#include <utility> #include <utility>
#include "rtc_base/constructor_magic.h" #include "rtc_base/constructor_magic.h"
#include "rtc_base/system/rtc_export.h"
namespace rtc { namespace rtc {
@ -21,7 +22,7 @@ struct Message;
// Messages get dispatched to a MessageHandler // Messages get dispatched to a MessageHandler
class MessageHandler { class RTC_EXPORT MessageHandler {
public: public:
virtual ~MessageHandler(); virtual ~MessageHandler();
virtual void OnMessage(Message* msg) = 0; virtual void OnMessage(Message* msg) = 0;

View file

@ -25,6 +25,7 @@
#include "rtc_base/location.h" #include "rtc_base/location.h"
#include "rtc_base/message_handler.h" #include "rtc_base/message_handler.h"
#include "rtc_base/socket_server.h" #include "rtc_base/socket_server.h"
#include "rtc_base/system/rtc_export.h"
#include "rtc_base/third_party/sigslot/sigslot.h" #include "rtc_base/third_party/sigslot/sigslot.h"
#include "rtc_base/thread_annotations.h" #include "rtc_base/thread_annotations.h"
@ -35,7 +36,7 @@ class MessageQueue;
// MessageQueueManager does cleanup of of message queues // MessageQueueManager does cleanup of of message queues
class MessageQueueManager { class RTC_EXPORT MessageQueueManager {
public: public:
static void Add(MessageQueue* message_queue); static void Add(MessageQueue* message_queue);
static void Remove(MessageQueue* message_queue); static void Remove(MessageQueue* message_queue);
@ -188,7 +189,7 @@ class DelayedMessage {
Message msg_; Message msg_;
}; };
class MessageQueue { class RTC_EXPORT MessageQueue {
public: public:
static const int kForever = -1; static const int kForever = -1;

View file

@ -23,12 +23,14 @@
#include "rtc_base/ip_address.h" #include "rtc_base/ip_address.h"
#include "rtc_base/signal_thread.h" #include "rtc_base/signal_thread.h"
#include "rtc_base/socket_address.h" #include "rtc_base/socket_address.h"
#include "rtc_base/system/rtc_export.h"
namespace rtc { namespace rtc {
// AsyncResolver will perform async DNS resolution, signaling the result on // AsyncResolver will perform async DNS resolution, signaling the result on
// the SignalDone from AsyncResolverInterface when the operation completes. // the SignalDone from AsyncResolverInterface when the operation completes.
class AsyncResolver : public SignalThread, public AsyncResolverInterface { class RTC_EXPORT AsyncResolver : public SignalThread,
public AsyncResolverInterface {
public: public:
AsyncResolver(); AsyncResolver();
~AsyncResolver() override; ~AsyncResolver() override;

View file

@ -23,6 +23,7 @@
#include "rtc_base/mdns_responder_interface.h" #include "rtc_base/mdns_responder_interface.h"
#include "rtc_base/message_handler.h" #include "rtc_base/message_handler.h"
#include "rtc_base/network_monitor.h" #include "rtc_base/network_monitor.h"
#include "rtc_base/system/rtc_export.h"
#include "rtc_base/third_party/sigslot/sigslot.h" #include "rtc_base/third_party/sigslot/sigslot.h"
#if defined(WEBRTC_POSIX) #if defined(WEBRTC_POSIX)
@ -52,7 +53,7 @@ std::string MakeNetworkKey(const std::string& name,
// Utility function that attempts to determine an adapter type by an interface // Utility function that attempts to determine an adapter type by an interface
// name (e.g., "wlan0"). Can be used by NetworkManager subclasses when other // name (e.g., "wlan0"). Can be used by NetworkManager subclasses when other
// mechanisms fail to determine the type. // mechanisms fail to determine the type.
AdapterType GetAdapterTypeFromName(const char* network_name); RTC_EXPORT AdapterType GetAdapterTypeFromName(const char* network_name);
class DefaultLocalAddressProvider { class DefaultLocalAddressProvider {
public: public:
@ -84,8 +85,8 @@ class MdnsResponderProvider {
// //
// This allows constructing a NetworkManager subclass on one thread and // This allows constructing a NetworkManager subclass on one thread and
// passing it into an object that uses it on a different thread. // passing it into an object that uses it on a different thread.
class NetworkManager : public DefaultLocalAddressProvider, class RTC_EXPORT NetworkManager : public DefaultLocalAddressProvider,
public MdnsResponderProvider { public MdnsResponderProvider {
public: public:
typedef std::vector<Network*> NetworkList; typedef std::vector<Network*> NetworkList;
@ -157,7 +158,7 @@ class NetworkManager : public DefaultLocalAddressProvider,
}; };
// Base class for NetworkManager implementations. // Base class for NetworkManager implementations.
class NetworkManagerBase : public NetworkManager { class RTC_EXPORT NetworkManagerBase : public NetworkManager {
public: public:
NetworkManagerBase(); NetworkManagerBase();
~NetworkManagerBase() override; ~NetworkManagerBase() override;
@ -215,9 +216,9 @@ class NetworkManagerBase : public NetworkManager {
// Basic implementation of the NetworkManager interface that gets list // Basic implementation of the NetworkManager interface that gets list
// of networks using OS APIs. // of networks using OS APIs.
class BasicNetworkManager : public NetworkManagerBase, class RTC_EXPORT BasicNetworkManager : public NetworkManagerBase,
public MessageHandler, public MessageHandler,
public sigslot::has_slots<> { public sigslot::has_slots<> {
public: public:
BasicNetworkManager(); BasicNetworkManager();
~BasicNetworkManager() override; ~BasicNetworkManager() override;
@ -290,7 +291,7 @@ class BasicNetworkManager : public NetworkManagerBase,
}; };
// Represents a Unix-type network interface, with a name and single address. // Represents a Unix-type network interface, with a name and single address.
class Network { class RTC_EXPORT Network {
public: public:
Network(const std::string& name, Network(const std::string& name,
const std::string& description, const std::string& description,

View file

@ -14,6 +14,7 @@ rtc_source_set("sent_packet") {
"sent_packet.h", "sent_packet.h",
] ]
deps = [ deps = [
"../system:rtc_export",
"//third_party/abseil-cpp/absl/types:optional", "//third_party/abseil-cpp/absl/types:optional",
] ]
} }

View file

@ -15,6 +15,7 @@
#include <stdint.h> #include <stdint.h>
#include "absl/types/optional.h" #include "absl/types/optional.h"
#include "rtc_base/system/rtc_export.h"
namespace rtc { namespace rtc {
@ -35,7 +36,7 @@ enum class PacketInfoProtocolType {
kTls, kTls,
}; };
struct PacketInfo { struct RTC_EXPORT PacketInfo {
PacketInfo(); PacketInfo();
PacketInfo(const PacketInfo& info); PacketInfo(const PacketInfo& info);
~PacketInfo(); ~PacketInfo();
@ -51,7 +52,7 @@ struct PacketInfo {
size_t ip_overhead_bytes = 0; size_t ip_overhead_bytes = 0;
}; };
struct SentPacket { struct RTC_EXPORT SentPacket {
SentPacket(); SentPacket();
SentPacket(int64_t packet_id, int64_t send_time_ms); SentPacket(int64_t packet_id, int64_t send_time_ms);
SentPacket(int64_t packet_id, SentPacket(int64_t packet_id,

View file

@ -23,6 +23,7 @@
#include "rtc_base/critical_section.h" #include "rtc_base/critical_section.h"
#include "rtc_base/net_helpers.h" #include "rtc_base/net_helpers.h"
#include "rtc_base/socket_server.h" #include "rtc_base/socket_server.h"
#include "rtc_base/system/rtc_export.h"
#if defined(WEBRTC_POSIX) #if defined(WEBRTC_POSIX)
typedef int SOCKET; typedef int SOCKET;
@ -61,7 +62,7 @@ class Dispatcher {
}; };
// A socket server that provides the real sockets of the underlying OS. // A socket server that provides the real sockets of the underlying OS.
class PhysicalSocketServer : public SocketServer { class RTC_EXPORT PhysicalSocketServer : public SocketServer {
public: public:
PhysicalSocketServer(); PhysicalSocketServer();
~PhysicalSocketServer() override; ~PhysicalSocketServer() override;

View file

@ -18,6 +18,7 @@
#include "api/scoped_refptr.h" #include "api/scoped_refptr.h"
#include "rtc_base/ref_count.h" #include "rtc_base/ref_count.h"
#include "rtc_base/system/rtc_export.h"
namespace rtc { namespace rtc {
@ -48,7 +49,7 @@ class RTCCertificatePEM {
// A thin abstraction layer between "lower level crypto stuff" like // A thin abstraction layer between "lower level crypto stuff" like
// SSLCertificate and WebRTC usage. Takes ownership of some lower level objects, // SSLCertificate and WebRTC usage. Takes ownership of some lower level objects,
// reference counting protects these from premature destruction. // reference counting protects these from premature destruction.
class RTCCertificate : public RefCountInterface { class RTC_EXPORT RTCCertificate : public RefCountInterface {
public: public:
// Takes ownership of |identity|. // Takes ownership of |identity|.
static scoped_refptr<RTCCertificate> Create( static scoped_refptr<RTCCertificate> Create(

View file

@ -18,6 +18,7 @@
#include "rtc_base/ref_count.h" #include "rtc_base/ref_count.h"
#include "rtc_base/rtc_certificate.h" #include "rtc_base/rtc_certificate.h"
#include "rtc_base/ssl_identity.h" #include "rtc_base/ssl_identity.h"
#include "rtc_base/system/rtc_export.h"
#include "rtc_base/thread.h" #include "rtc_base/thread.h"
namespace rtc { namespace rtc {
@ -53,7 +54,8 @@ class RTCCertificateGeneratorInterface {
// The static function |GenerateCertificate| generates a certificate on the // The static function |GenerateCertificate| generates a certificate on the
// current thread. The |RTCCertificateGenerator| instance generates certificates // current thread. The |RTCCertificateGenerator| instance generates certificates
// asynchronously on the worker thread with |GenerateCertificateAsync|. // asynchronously on the worker thread with |GenerateCertificateAsync|.
class RTCCertificateGenerator : public RTCCertificateGeneratorInterface { class RTC_EXPORT RTCCertificateGenerator
: public RTCCertificateGeneratorInterface {
public: public:
// Generates a certificate on the current thread. Returns null on failure. // Generates a certificate on the current thread. Returns null on failure.
// If |expires_ms| is specified, the certificate will expire in approximately // If |expires_ms| is specified, the certificate will expire in approximately

View file

@ -16,6 +16,7 @@
#include <ostream> // no-presubmit-check TODO(webrtc:8982) #include <ostream> // no-presubmit-check TODO(webrtc:8982)
#endif // UNIT_TEST #endif // UNIT_TEST
#include "rtc_base/ip_address.h" #include "rtc_base/ip_address.h"
#include "rtc_base/system/rtc_export.h"
#undef SetPort #undef SetPort
@ -25,7 +26,7 @@ struct sockaddr_storage;
namespace rtc { namespace rtc {
// Records an IP address and port. // Records an IP address and port.
class SocketAddress { class RTC_EXPORT SocketAddress {
public: public:
// Creates a nil address. // Creates a nil address.
SocketAddress(); SocketAddress();
@ -193,8 +194,8 @@ class SocketAddress {
bool literal_; // Indicates that 'hostname_' contains a literal IP string. bool literal_; // Indicates that 'hostname_' contains a literal IP string.
}; };
bool SocketAddressFromSockAddrStorage(const sockaddr_storage& saddr, RTC_EXPORT bool SocketAddressFromSockAddrStorage(const sockaddr_storage& saddr,
SocketAddress* out); SocketAddress* out);
SocketAddress EmptySocketAddressWithFamily(int family); SocketAddress EmptySocketAddressWithFamily(int family);
} // namespace rtc } // namespace rtc

View file

@ -18,6 +18,7 @@
#include "rtc_base/ssl_certificate.h" #include "rtc_base/ssl_certificate.h"
#include "rtc_base/ssl_identity.h" #include "rtc_base/ssl_identity.h"
#include "rtc_base/ssl_stream_adapter.h" #include "rtc_base/ssl_stream_adapter.h"
#include "rtc_base/system/rtc_export.h"
namespace rtc { namespace rtc {
@ -96,10 +97,10 @@ class SSLAdapter : public AsyncSocketAdapter {
// Call this on the main thread, before using SSL. // Call this on the main thread, before using SSL.
// Call CleanupSSL when finished with SSL. // Call CleanupSSL when finished with SSL.
bool InitializeSSL(); RTC_EXPORT bool InitializeSSL();
// Call to cleanup additional threads, and also the main thread. // Call to cleanup additional threads, and also the main thread.
bool CleanupSSL(); RTC_EXPORT bool CleanupSSL();
} // namespace rtc } // namespace rtc

View file

@ -23,10 +23,11 @@
#include "rtc_base/buffer.h" #include "rtc_base/buffer.h"
#include "rtc_base/constructor_magic.h" #include "rtc_base/constructor_magic.h"
#include "rtc_base/system/rtc_export.h"
namespace rtc { namespace rtc {
struct SSLCertificateStats { struct RTC_EXPORT SSLCertificateStats {
SSLCertificateStats(std::string&& fingerprint, SSLCertificateStats(std::string&& fingerprint,
std::string&& fingerprint_algorithm, std::string&& fingerprint_algorithm,
std::string&& base64_certificate, std::string&& base64_certificate,
@ -46,7 +47,7 @@ struct SSLCertificateStats {
// The SSLCertificate object is pretty much immutable once created. // The SSLCertificate object is pretty much immutable once created.
// (The OpenSSL implementation only does reference counting and // (The OpenSSL implementation only does reference counting and
// possibly caching of intermediate results.) // possibly caching of intermediate results.)
class SSLCertificate { class RTC_EXPORT SSLCertificate {
public: public:
// Parses and builds a certificate from a PEM encoded string. // Parses and builds a certificate from a PEM encoded string.
// Returns null on failure. // Returns null on failure.
@ -90,7 +91,7 @@ class SSLCertificate {
// SSLCertChain is a simple wrapper for a vector of SSLCertificates. It serves // SSLCertChain is a simple wrapper for a vector of SSLCertificates. It serves
// primarily to ensure proper memory management (especially deletion) of the // primarily to ensure proper memory management (especially deletion) of the
// SSLCertificate pointers. // SSLCertificate pointers.
class SSLCertChain final { class RTC_EXPORT SSLCertChain final {
public: public:
explicit SSLCertChain(std::unique_ptr<SSLCertificate> single_cert); explicit SSLCertChain(std::unique_ptr<SSLCertificate> single_cert);
explicit SSLCertChain(std::vector<std::unique_ptr<SSLCertificate>> certs); explicit SSLCertChain(std::vector<std::unique_ptr<SSLCertificate>> certs);

View file

@ -16,6 +16,7 @@
#include <string> #include <string>
#include "rtc_base/copy_on_write_buffer.h" #include "rtc_base/copy_on_write_buffer.h"
#include "rtc_base/system/rtc_export.h"
namespace rtc { namespace rtc {
@ -23,7 +24,7 @@ class RTCCertificate;
class SSLCertificate; class SSLCertificate;
class SSLIdentity; class SSLIdentity;
struct SSLFingerprint { struct RTC_EXPORT SSLFingerprint {
// TODO(steveanton): Remove once downstream projects have moved off of this. // TODO(steveanton): Remove once downstream projects have moved off of this.
static SSLFingerprint* Create(const std::string& algorithm, static SSLFingerprint* Create(const std::string& algorithm,
const rtc::SSLIdentity* identity); const rtc::SSLIdentity* identity);

View file

@ -17,6 +17,8 @@
#include <ctime> #include <ctime>
#include <string> #include <string>
#include "rtc_base/system/rtc_export.h"
namespace rtc { namespace rtc {
class SSLCertChain; class SSLCertChain;
@ -46,7 +48,7 @@ struct RSAParams {
enum ECCurve { EC_NIST_P256, /* EC_FANCY, */ EC_LAST }; enum ECCurve { EC_NIST_P256, /* EC_FANCY, */ EC_LAST };
class KeyParams { class RTC_EXPORT KeyParams {
public: public:
// Generate a KeyParams object from a simple KeyType, using default params. // Generate a KeyParams object from a simple KeyType, using default params.
explicit KeyParams(KeyType key_type = KT_DEFAULT); explicit KeyParams(KeyType key_type = KT_DEFAULT);
@ -95,7 +97,7 @@ struct SSLIdentityParams {
// Our identity in an SSL negotiation: a keypair and certificate (both // Our identity in an SSL negotiation: a keypair and certificate (both
// with the same public key). // with the same public key).
// This too is pretty much immutable once created. // This too is pretty much immutable once created.
class SSLIdentity { class RTC_EXPORT SSLIdentity {
public: public:
// Generates an identity (keypair and self-signed certificate). If // Generates an identity (keypair and self-signed certificate). If
// |common_name| is non-empty, it will be used for the certificate's subject // |common_name| is non-empty, it will be used for the certificate's subject

View file

@ -18,6 +18,7 @@
#include "rtc_base/critical_section.h" #include "rtc_base/critical_section.h"
#include "rtc_base/message_handler.h" #include "rtc_base/message_handler.h"
#include "rtc_base/message_queue.h" #include "rtc_base/message_queue.h"
#include "rtc_base/system/rtc_export.h"
#include "rtc_base/third_party/sigslot/sigslot.h" #include "rtc_base/third_party/sigslot/sigslot.h"
namespace rtc { namespace rtc {
@ -55,7 +56,7 @@ struct StreamEventData : public MessageData {
StreamEventData(int ev, int er) : events(ev), error(er) {} StreamEventData(int ev, int er) : events(ev), error(er) {}
}; };
class StreamInterface : public MessageHandler { class RTC_EXPORT StreamInterface : public MessageHandler {
public: public:
enum { MSG_POST_EVENT = 0xF1F1, MSG_MAX = MSG_POST_EVENT }; enum { MSG_POST_EVENT = 0xF1F1, MSG_MAX = MSG_POST_EVENT };

View file

@ -47,6 +47,7 @@ rtc_source_set("sequence_checker") {
"..:macromagic", "..:macromagic",
"..:platform_thread_types", "..:platform_thread_types",
"../../api/task_queue", "../../api/task_queue",
"../system:rtc_export",
] ]
} }

View file

@ -13,6 +13,7 @@
#include "api/task_queue/task_queue_base.h" #include "api/task_queue/task_queue_base.h"
#include "rtc_base/critical_section.h" #include "rtc_base/critical_section.h"
#include "rtc_base/platform_thread_types.h" #include "rtc_base/platform_thread_types.h"
#include "rtc_base/system/rtc_export.h"
#include "rtc_base/thread_annotations.h" #include "rtc_base/thread_annotations.h"
namespace webrtc { namespace webrtc {
@ -22,7 +23,7 @@ namespace webrtc {
// //
// Note: You should almost always use the SequenceChecker class to get the // Note: You should almost always use the SequenceChecker class to get the
// right version for your build configuration. // right version for your build configuration.
class SequenceCheckerImpl { class RTC_EXPORT SequenceCheckerImpl {
public: public:
SequenceCheckerImpl(); SequenceCheckerImpl();
~SequenceCheckerImpl(); ~SequenceCheckerImpl();

View file

@ -14,4 +14,7 @@ rtc_source_set("base64") {
"base64.cc", "base64.cc",
"base64.h", "base64.h",
] ]
deps = [
"../../system:rtc_export",
]
} }

View file

@ -15,6 +15,8 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "rtc_base/system/rtc_export.h"
namespace rtc { namespace rtc {
class Base64 { class Base64 {
@ -56,14 +58,14 @@ class Base64 {
// encoded characters. // encoded characters.
static bool IsBase64Encoded(const std::string& str); static bool IsBase64Encoded(const std::string& str);
static void EncodeFromArray(const void* data, RTC_EXPORT static void EncodeFromArray(const void* data,
size_t len, size_t len,
std::string* result); std::string* result);
static bool DecodeFromArray(const char* data, RTC_EXPORT static bool DecodeFromArray(const char* data,
size_t len, size_t len,
DecodeFlags flags, DecodeFlags flags,
std::string* result, std::string* result,
size_t* data_used); size_t* data_used);
static bool DecodeFromArray(const char* data, static bool DecodeFromArray(const char* data,
size_t len, size_t len,
DecodeFlags flags, DecodeFlags flags,

View file

@ -27,6 +27,7 @@
#include "rtc_base/message_queue.h" #include "rtc_base/message_queue.h"
#include "rtc_base/platform_thread_types.h" #include "rtc_base/platform_thread_types.h"
#include "rtc_base/socket_server.h" #include "rtc_base/socket_server.h"
#include "rtc_base/system/rtc_export.h"
#include "rtc_base/thread_annotations.h" #include "rtc_base/thread_annotations.h"
#if defined(WEBRTC_WIN) #if defined(WEBRTC_WIN)
@ -77,7 +78,7 @@ class MessageHandlerWithTask final : public MessageHandler {
} // namespace rtc_thread_internal } // namespace rtc_thread_internal
class ThreadManager { class RTC_EXPORT ThreadManager {
public: public:
static const int kForever = -1; static const int kForever = -1;
@ -132,7 +133,7 @@ struct _SendMessage {
// WARNING! SUBCLASSES MUST CALL Stop() IN THEIR DESTRUCTORS! See ~Thread(). // WARNING! SUBCLASSES MUST CALL Stop() IN THEIR DESTRUCTORS! See ~Thread().
class RTC_LOCKABLE Thread : public MessageQueue { class RTC_EXPORT RTC_LOCKABLE Thread : public MessageQueue {
public: public:
explicit Thread(SocketServer* ss); explicit Thread(SocketServer* ss);
explicit Thread(std::unique_ptr<SocketServer> ss); explicit Thread(std::unique_ptr<SocketServer> ss);

View file

@ -18,6 +18,7 @@
#include "rtc_base/checks.h" #include "rtc_base/checks.h"
#include "rtc_base/strings/string_builder.h" #include "rtc_base/strings/string_builder.h"
#include "rtc_base/system/rtc_export.h"
namespace rtc { namespace rtc {
@ -54,10 +55,10 @@ class ClockInterface {
// TODO(deadbeef): Instead of having functions that access this global // TODO(deadbeef): Instead of having functions that access this global
// ClockInterface, we may want to pass the ClockInterface into everything // ClockInterface, we may want to pass the ClockInterface into everything
// that uses it, eliminating the need for a global variable and this function. // that uses it, eliminating the need for a global variable and this function.
ClockInterface* SetClockForTesting(ClockInterface* clock); RTC_EXPORT ClockInterface* SetClockForTesting(ClockInterface* clock);
// Returns previously set clock, or nullptr if no custom clock is being used. // Returns previously set clock, or nullptr if no custom clock is being used.
ClockInterface* GetClockForTesting(); RTC_EXPORT ClockInterface* GetClockForTesting();
#if defined(WINUWP) #if defined(WINUWP)
// Synchronizes the current clock based upon an NTP server's epoch in // Synchronizes the current clock based upon an NTP server's epoch in
@ -74,17 +75,17 @@ int64_t SystemTimeMillis();
uint32_t Time32(); uint32_t Time32();
// Returns the current time in milliseconds in 64 bits. // Returns the current time in milliseconds in 64 bits.
int64_t TimeMillis(); RTC_EXPORT int64_t TimeMillis();
// Deprecated. Do not use this in any new code. // Deprecated. Do not use this in any new code.
inline int64_t Time() { inline int64_t Time() {
return TimeMillis(); return TimeMillis();
} }
// Returns the current time in microseconds. // Returns the current time in microseconds.
int64_t TimeMicros(); RTC_EXPORT int64_t TimeMicros();
// Returns the current time in nanoseconds. // Returns the current time in nanoseconds.
int64_t TimeNanos(); RTC_EXPORT int64_t TimeNanos();
// Returns a future timestamp, 'elapsed' milliseconds from now. // Returns a future timestamp, 'elapsed' milliseconds from now.
int64_t TimeAfter(int64_t elapsed); int64_t TimeAfter(int64_t elapsed);

View file

@ -14,6 +14,7 @@
#include <stdint.h> #include <stdint.h>
#include "rtc_base/constructor_magic.h" #include "rtc_base/constructor_magic.h"
#include "rtc_base/system/rtc_export.h"
namespace rtc { namespace rtc {
@ -28,7 +29,7 @@ namespace rtc {
// This class is not thread safe, so all calls to it must be synchronized // This class is not thread safe, so all calls to it must be synchronized
// externally. // externally.
class TimestampAligner { class RTC_EXPORT TimestampAligner {
public: public:
TimestampAligner(); TimestampAligner();
~TimestampAligner(); ~TimestampAligner();