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 = [
"call/call_factory_interface.h",
]
deps = [
"../rtc_base/system:rtc_export",
]
}
if (!build_with_chromium) {

View file

@ -13,6 +13,8 @@
#include <memory>
#include "rtc_base/system/rtc_export.h"
namespace webrtc {
// 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;
};
std::unique_ptr<CallFactoryInterface> CreateCallFactory();
RTC_EXPORT std::unique_ptr<CallFactoryInterface> CreateCallFactory();
} // namespace webrtc

View file

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

View file

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

View file

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

View file

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

View file

@ -52,7 +52,7 @@ struct SdpParseError {
// a time and is therefore not expected to be thread safe.
//
// An instance can be created by CreateIceCandidate.
class IceCandidateInterface {
class RTC_EXPORT IceCandidateInterface {
public:
virtual ~IceCandidateInterface() {}
// 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
// that ensures thread safety and that all methods are called on the right
// thread.
class VideoTrackInterface : public MediaStreamTrackInterface,
public rtc::VideoSourceInterface<VideoFrame> {
class RTC_EXPORT VideoTrackInterface
: public MediaStreamTrackInterface,
public rtc::VideoSourceInterface<VideoFrame> {
public:
// Video track content hint, used to override the source is_screencast
// property.
@ -235,7 +236,7 @@ class AudioProcessorInterface : public rtc::RefCountInterface {
~AudioProcessorInterface() override = default;
};
class AudioTrackInterface : public MediaStreamTrackInterface {
class RTC_EXPORT AudioTrackInterface : public MediaStreamTrackInterface {
public:
// TODO(deadbeef): Figure out if the following interface should be const or
// not.

View file

@ -1253,7 +1253,7 @@ class PeerConnectionObserver {
// All new dependencies should be added as a unique_ptr to allow the
// PeerConnection object to be the definitive owner of the dependencies
// lifetime making injection safer.
struct PeerConnectionDependencies final {
struct RTC_EXPORT PeerConnectionDependencies final {
explicit PeerConnectionDependencies(PeerConnectionObserver* observer_in);
// This object is not copyable or assignable.
PeerConnectionDependencies(const PeerConnectionDependencies&) = delete;
@ -1284,7 +1284,7 @@ struct PeerConnectionDependencies final {
// 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
// to this structure.
struct PeerConnectionFactoryDependencies final {
struct RTC_EXPORT PeerConnectionFactoryDependencies final {
PeerConnectionFactoryDependencies();
// This object is not copyable or assignable.
PeerConnectionFactoryDependencies(const PeerConnectionFactoryDependencies&) =
@ -1457,7 +1457,7 @@ class PeerConnectionFactoryInterface : public rtc::RefCountInterface {
// will create the necessary thread internally. If |signaling_thread| is null,
// 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.
rtc::scoped_refptr<PeerConnectionFactoryInterface>
RTC_EXPORT rtc::scoped_refptr<PeerConnectionFactoryInterface>
CreateModularPeerConnectionFactory(
PeerConnectionFactoryDependencies dependencies);

View file

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

View file

@ -131,7 +131,7 @@ class RTC_EXPORT RTCError {
//
// Only intended to be used for logging/diagnostics. The returned char* points
// 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
inline std::ostream& operator<<( // no-presubmit-check TODO(webrtc:8982)

View file

@ -36,6 +36,7 @@ rtc_source_set("rtc_event_log_factory") {
deps = [
":rtc_event_log",
"../../rtc_base:checks",
"../../rtc_base/system:rtc_export",
"../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_factory_interface.h"
#include "api/task_queue/task_queue_factory.h"
#include "rtc_base/system/rtc_export.h"
namespace webrtc {
class RtcEventLogFactory : public RtcEventLogFactoryInterface {
class RTC_EXPORT RtcEventLogFactory : public RtcEventLogFactoryInterface {
public:
explicit RtcEventLogFactory(TaskQueueFactory* task_queue_factory);
~RtcEventLogFactory() override {}

View file

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

View file

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

View file

@ -27,10 +27,11 @@
#include "api/rtp_parameters.h"
#include "api/scoped_refptr.h"
#include "rtc_base/ref_count.h"
#include "rtc_base/system/rtc_export.h"
namespace webrtc {
class RtpSenderInterface : public rtc::RefCountInterface {
class RTC_EXPORT RtpSenderInterface : public rtc::RefCountInterface {
public:
// Returns true if successful in setting the track.
// 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:
// https://w3c.github.io/webrtc-pc/#dom-rtcrtptransceiver
class RtpTransceiverInterface : public rtc::RefCountInterface {
class RTC_EXPORT RtpTransceiverInterface : public rtc::RefCountInterface {
public:
// Media type of the transceiver. Any sender(s)/receiver(s) will have this
// type as well.

View file

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

View file

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

View file

@ -15,6 +15,7 @@
#include "absl/types/optional.h"
#include "api/video/hdr_metadata.h"
#include "rtc_base/system/rtc_export.h"
namespace webrtc {
@ -31,7 +32,7 @@ namespace webrtc {
// E.2.1, "VUI parameters semantics", available from
// https://www.itu.int/rec/T-REC-H.264.
class ColorSpace {
class RTC_EXPORT ColorSpace {
public:
enum class PrimaryID : uint8_t {
// 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 "rtc_base/ref_count.h"
#include "rtc_base/system/rtc_export.h"
namespace webrtc {
@ -38,7 +39,7 @@ class I010BufferInterface;
// performance by providing an optimized path without intermediate conversions.
// Frame metadata such as rotation and timestamp are stored in
// webrtc::VideoFrame, and not here.
class VideoFrameBuffer : public rtc::RefCountInterface {
class RTC_EXPORT VideoFrameBuffer : public rtc::RefCountInterface {
public:
// New frame buffer types will be added conservatively when there is an
// opportunity to optimize the path between some pair of video source and
@ -113,7 +114,7 @@ class PlanarYuv8Buffer : public PlanarYuvBuffer {
~PlanarYuv8Buffer() override {}
};
class I420BufferInterface : public PlanarYuv8Buffer {
class RTC_EXPORT I420BufferInterface : public PlanarYuv8Buffer {
public:
Type type() const override;
@ -127,7 +128,7 @@ class I420BufferInterface : public PlanarYuv8Buffer {
~I420BufferInterface() override {}
};
class I420ABufferInterface : public I420BufferInterface {
class RTC_EXPORT I420ABufferInterface : public I420BufferInterface {
public:
Type type() const final;
virtual const uint8_t* DataA() const = 0;

View file

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

View file

@ -226,7 +226,7 @@ struct ExperimentalNs {
// // Close the application...
// delete apm;
//
class AudioProcessing : public rtc::RefCountInterface {
class RTC_EXPORT AudioProcessing : public rtc::RefCountInterface {
public:
// The struct below constitutes the new parameter scheme for the audio
// 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.
class SharedMemoryDesktopFrame : public DesktopFrame {
class RTC_EXPORT SharedMemoryDesktopFrame : public DesktopFrame {
public:
// May return nullptr if |shared_memory_factory| failed to create a
// SharedMemory instance.

View file

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

View file

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

View file

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

View file

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

View file

@ -15,6 +15,7 @@
#include "rtc_base/dscp.h"
#include "rtc_base/network/sent_packet.h"
#include "rtc_base/socket.h"
#include "rtc_base/system/rtc_export.h"
#include "rtc_base/third_party/sigslot/sigslot.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
// over network.
struct PacketOptions {
struct RTC_EXPORT PacketOptions {
PacketOptions();
explicit PacketOptions(DiffServCodePoint dscp);
PacketOptions(const PacketOptions& other);
@ -53,7 +54,7 @@ struct PacketOptions {
// Provides the ability to receive packets asynchronously. Sends are not
// 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:
enum State {
STATE_CLOSED,

View file

@ -12,12 +12,13 @@
#define RTC_BASE_ASYNC_RESOLVER_INTERFACE_H_
#include "rtc_base/socket_address.h"
#include "rtc_base/system/rtc_export.h"
#include "rtc_base/third_party/sigslot/sigslot.h"
namespace rtc {
// This interface defines the methods to resolve the address asynchronously.
class AsyncResolverInterface {
class RTC_EXPORT AsyncResolverInterface {
public:
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 "rtc_base/numerics/safe_compare.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
// conditions. All will accept additional stream messages. For example:
@ -108,11 +109,11 @@ enum class CheckArgType : int8_t {
kCheckOp,
};
RTC_NORETURN void FatalLog(const char* file,
int line,
const char* message,
const CheckArgType* fmt,
...);
RTC_NORETURN RTC_EXPORT void FatalLog(const char* file,
int line,
const char* message,
const CheckArgType* fmt,
...);
// Wrapper for log arguments. Only ever make values of this type with the
// MakeVal() functions.

View file

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

View file

@ -13,6 +13,8 @@
#include <stddef.h>
#include "rtc_base/system/rtc_export.h"
namespace rtc {
// 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
// day. If you hit the limit, you can't eat any more until the next
// day.
class DataRateLimiter {
class RTC_EXPORT DataRateLimiter {
public:
// For example, 100kb per second.
DataRateLimiter(size_t max, double period)

View file

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

View file

@ -29,6 +29,7 @@
#if defined(WEBRTC_WIN)
#include "rtc_base/win32.h"
#endif
#include "rtc_base/system/rtc_export.h"
namespace rtc {
@ -46,7 +47,7 @@ enum IPv6AddressFlag {
};
// Version-agnostic IP address class, wraps a union of in_addr and in6_addr.
class IPAddress {
class RTC_EXPORT IPAddress {
public:
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
// meaningful in IPv6 case.
class InterfaceAddress : public IPAddress {
class RTC_EXPORT InterfaceAddress : public IPAddress {
public:
InterfaceAddress() : ipv6_flags_(IPV6_ADDRESS_FLAG_NONE) {}
@ -150,8 +151,10 @@ class InterfaceAddress : public IPAddress {
};
bool IPFromAddrInfo(struct addrinfo* info, IPAddress* out);
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, IPAddress* out);
RTC_EXPORT bool IPFromString(const std::string& str,
int flags,
InterfaceAddress* out);
bool IPIsAny(const IPAddress& ip);
bool IPIsLoopback(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
// or an address belonging to a link-local, a private network or a shared
// network.
bool IPIsPrivate(const IPAddress& ip);
RTC_EXPORT bool IPIsPrivate(const IPAddress& ip);
bool IPIsUnspec(const IPAddress& ip);
size_t HashIP(const IPAddress& ip);
// These are only really applicable for IPv6 addresses.
bool IPIs6Bone(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 IPIsTeredo(const IPAddress& ip);
bool IPIsULA(const IPAddress& ip);
@ -182,7 +185,7 @@ bool IPIsV4Mapped(const IPAddress& ip);
int IPAddressPrecedence(const IPAddress& ip);
// 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 GetAnyIP(int family);

View file

@ -14,6 +14,7 @@
#include <string>
#include "rtc_base/stringize_macros.h"
#include "rtc_base/system/rtc_export.h"
namespace rtc {
@ -21,7 +22,7 @@ namespace rtc {
// significantly brought to life.
// This is a stripped down version of:
// https://code.google.com/p/chromium/codesearch#chromium/src/base/location.h
class Location {
class RTC_EXPORT Location {
public:
// 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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -18,6 +18,7 @@
#include "rtc_base/ref_count.h"
#include "rtc_base/rtc_certificate.h"
#include "rtc_base/ssl_identity.h"
#include "rtc_base/system/rtc_export.h"
#include "rtc_base/thread.h"
namespace rtc {
@ -53,7 +54,8 @@ class RTCCertificateGeneratorInterface {
// The static function |GenerateCertificate| generates a certificate on the
// current thread. The |RTCCertificateGenerator| instance generates certificates
// asynchronously on the worker thread with |GenerateCertificateAsync|.
class RTCCertificateGenerator : public RTCCertificateGeneratorInterface {
class RTC_EXPORT RTCCertificateGenerator
: public RTCCertificateGeneratorInterface {
public:
// Generates a certificate on the current thread. Returns null on failure.
// 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)
#endif // UNIT_TEST
#include "rtc_base/ip_address.h"
#include "rtc_base/system/rtc_export.h"
#undef SetPort
@ -25,7 +26,7 @@ struct sockaddr_storage;
namespace rtc {
// Records an IP address and port.
class SocketAddress {
class RTC_EXPORT SocketAddress {
public:
// Creates a nil address.
SocketAddress();
@ -193,8 +194,8 @@ class SocketAddress {
bool literal_; // Indicates that 'hostname_' contains a literal IP string.
};
bool SocketAddressFromSockAddrStorage(const sockaddr_storage& saddr,
SocketAddress* out);
RTC_EXPORT bool SocketAddressFromSockAddrStorage(const sockaddr_storage& saddr,
SocketAddress* out);
SocketAddress EmptySocketAddressWithFamily(int family);
} // namespace rtc

View file

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

View file

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

View file

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

View file

@ -17,6 +17,8 @@
#include <ctime>
#include <string>
#include "rtc_base/system/rtc_export.h"
namespace rtc {
class SSLCertChain;
@ -46,7 +48,7 @@ struct RSAParams {
enum ECCurve { EC_NIST_P256, /* EC_FANCY, */ EC_LAST };
class KeyParams {
class RTC_EXPORT KeyParams {
public:
// Generate a KeyParams object from a simple KeyType, using default params.
explicit KeyParams(KeyType key_type = KT_DEFAULT);
@ -95,7 +97,7 @@ struct SSLIdentityParams {
// Our identity in an SSL negotiation: a keypair and certificate (both
// with the same public key).
// This too is pretty much immutable once created.
class SSLIdentity {
class RTC_EXPORT SSLIdentity {
public:
// Generates an identity (keypair and self-signed certificate). If
// |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/message_handler.h"
#include "rtc_base/message_queue.h"
#include "rtc_base/system/rtc_export.h"
#include "rtc_base/third_party/sigslot/sigslot.h"
namespace rtc {
@ -55,7 +56,7 @@ struct StreamEventData : public MessageData {
StreamEventData(int ev, int er) : events(ev), error(er) {}
};
class StreamInterface : public MessageHandler {
class RTC_EXPORT StreamInterface : public MessageHandler {
public:
enum { MSG_POST_EVENT = 0xF1F1, MSG_MAX = MSG_POST_EVENT };

View file

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

View file

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

View file

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

View file

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

View file

@ -27,6 +27,7 @@
#include "rtc_base/message_queue.h"
#include "rtc_base/platform_thread_types.h"
#include "rtc_base/socket_server.h"
#include "rtc_base/system/rtc_export.h"
#include "rtc_base/thread_annotations.h"
#if defined(WEBRTC_WIN)
@ -77,7 +78,7 @@ class MessageHandlerWithTask final : public MessageHandler {
} // namespace rtc_thread_internal
class ThreadManager {
class RTC_EXPORT ThreadManager {
public:
static const int kForever = -1;
@ -132,7 +133,7 @@ struct _SendMessage {
// 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:
explicit Thread(SocketServer* ss);
explicit Thread(std::unique_ptr<SocketServer> ss);

View file

@ -18,6 +18,7 @@
#include "rtc_base/checks.h"
#include "rtc_base/strings/string_builder.h"
#include "rtc_base/system/rtc_export.h"
namespace rtc {
@ -54,10 +55,10 @@ class ClockInterface {
// TODO(deadbeef): Instead of having functions that access this global
// ClockInterface, we may want to pass the ClockInterface into everything
// 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.
ClockInterface* GetClockForTesting();
RTC_EXPORT ClockInterface* GetClockForTesting();
#if defined(WINUWP)
// Synchronizes the current clock based upon an NTP server's epoch in
@ -74,17 +75,17 @@ int64_t SystemTimeMillis();
uint32_t Time32();
// 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.
inline int64_t Time() {
return TimeMillis();
}
// Returns the current time in microseconds.
int64_t TimeMicros();
RTC_EXPORT int64_t TimeMicros();
// Returns the current time in nanoseconds.
int64_t TimeNanos();
RTC_EXPORT int64_t TimeNanos();
// Returns a future timestamp, 'elapsed' milliseconds from now.
int64_t TimeAfter(int64_t elapsed);

View file

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