Export symbols needed by the Chromium component build (part 6).

This CL uses RTC_EXPORT (defined in rtc_base/system/rtc_export.h)
to mark WebRTC symbols as visible from a shared library, this doesn't
mean these symbols are part of the public API (please continue to refer
to [1] for info about what is considered public WebRTC API).

[1] - https://webrtc.googlesource.com/src/+/HEAD/native-api.md

Bug: webrtc:9419
Change-Id: I67a4d016a11deca5ac5459826741dd2d3f7931d5
Reviewed-on: https://webrtc-review.googlesource.com/c/107400
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25298}
diff --git a/api/audio_codecs/BUILD.gn b/api/audio_codecs/BUILD.gn
index a7060a2..29c8fe2 100644
--- a/api/audio_codecs/BUILD.gn
+++ b/api/audio_codecs/BUILD.gn
@@ -35,6 +35,7 @@
     "../../rtc_base:deprecation",
     "../../rtc_base:rtc_base_approved",
     "../../rtc_base:sanitizer",
+    "../../rtc_base/system:rtc_export",
     "//third_party/abseil-cpp/absl/strings",
     "//third_party/abseil-cpp/absl/types:optional",
   ]
diff --git a/api/audio_codecs/audio_format.h b/api/audio_codecs/audio_format.h
index 7748812..6638ea3 100644
--- a/api/audio_codecs/audio_format.h
+++ b/api/audio_codecs/audio_format.h
@@ -16,11 +16,12 @@
 
 #include "absl/strings/string_view.h"
 #include "rtc_base/checks.h"
+#include "rtc_base/system/rtc_export.h"
 
 namespace webrtc {
 
 // SDP specification for a single audio codec.
-struct SdpAudioFormat {
+struct RTC_EXPORT SdpAudioFormat {
   using Parameters = std::map<std::string, std::string>;
 
   SdpAudioFormat(const SdpAudioFormat&);
diff --git a/api/jsep.h b/api/jsep.h
index 03ce6d7..1c50455 100644
--- a/api/jsep.h
+++ b/api/jsep.h
@@ -207,7 +207,8 @@
     std::unique_ptr<cricket::SessionDescription> description);
 
 // CreateOffer and CreateAnswer callback interface.
-class CreateSessionDescriptionObserver : public rtc::RefCountInterface {
+class RTC_EXPORT CreateSessionDescriptionObserver
+    : public rtc::RefCountInterface {
  public:
   // This callback transfers the ownership of the |desc|.
   // TODO(deadbeef): Make this take an std::unique_ptr<> to avoid confusion
@@ -228,7 +229,7 @@
 };
 
 // SetLocalDescription and SetRemoteDescription callback interface.
-class SetSessionDescriptionObserver : public rtc::RefCountInterface {
+class RTC_EXPORT SetSessionDescriptionObserver : public rtc::RefCountInterface {
  public:
   virtual void OnSuccess() = 0;
   // See description in CreateSessionDescriptionObserver for OnFailure.
diff --git a/api/peerconnectioninterface.h b/api/peerconnectioninterface.h
index a8063b1..021be7d 100644
--- a/api/peerconnectioninterface.h
+++ b/api/peerconnectioninterface.h
@@ -294,7 +294,7 @@
   // organization of the implementation, which isn't stable. So we
   // need getters and setters at least for fields which applications
   // are interested in.
-  struct RTCConfiguration {
+  struct RTC_EXPORT RTCConfiguration {
     // This struct is subject to reorganization, both for naming
     // consistency, and to group settings to match where they are used
     // in the implementation. To do that, we need getter and setter
diff --git a/api/rtpparameters.h b/api/rtpparameters.h
index 377fb78..4d99acf 100644
--- a/api/rtpparameters.h
+++ b/api/rtpparameters.h
@@ -17,6 +17,7 @@
 
 #include "absl/types/optional.h"
 #include "api/mediatypes.h"
+#include "rtc_base/system/rtc_export.h"
 
 namespace webrtc {
 
@@ -616,7 +617,7 @@
   bool operator!=(const RtcpParameters& o) const { return !(*this == o); }
 };
 
-struct RtpParameters {
+struct RTC_EXPORT RtpParameters {
   RtpParameters();
   RtpParameters(const RtpParameters&);
   ~RtpParameters();
diff --git a/api/video/BUILD.gn b/api/video/BUILD.gn
index 3f71007..be69580 100644
--- a/api/video/BUILD.gn
+++ b/api/video/BUILD.gn
@@ -31,6 +31,7 @@
   deps = [
     "../../rtc_base:checks",
     "../../rtc_base:rtc_base_approved",
+    "../../rtc_base/system:rtc_export",
     "//third_party/abseil-cpp/absl/types:optional",
   ]
 }
@@ -76,6 +77,7 @@
     "../..:webrtc_common",
     "../../rtc_base:checks",
     "../../rtc_base:rtc_base_approved",
+    "../../rtc_base/system:rtc_export",
     "//third_party/abseil-cpp/absl/types:optional",
   ]
 }
diff --git a/api/video/encoded_image.h b/api/video/encoded_image.h
index ed58d96..bda9121 100644
--- a/api/video/encoded_image.h
+++ b/api/video/encoded_image.h
@@ -16,12 +16,13 @@
 #include "api/video/video_rotation.h"
 #include "api/video/video_timing.h"
 #include "common_types.h"  // NOLINT(build/include)
+#include "rtc_base/system/rtc_export.h"
 
 namespace webrtc {
 
 // TODO(bug.webrtc.org/9378): This is a legacy api class, which is slowly being
 // cleaned up. Direct use of its members is strongly discouraged.
-class EncodedImage {
+class RTC_EXPORT EncodedImage {
  public:
   static const size_t kBufferPaddingBytesH264;
 
diff --git a/api/video/video_frame.h b/api/video/video_frame.h
index dcb533e..b62ef53 100644
--- a/api/video/video_frame.h
+++ b/api/video/video_frame.h
@@ -17,10 +17,11 @@
 #include "api/video/color_space.h"
 #include "api/video/video_frame_buffer.h"
 #include "api/video/video_rotation.h"
+#include "rtc_base/system/rtc_export.h"
 
 namespace webrtc {
 
-class VideoFrame {
+class RTC_EXPORT VideoFrame {
  public:
   // Preferred way of building VideoFrame objects.
   class Builder {
diff --git a/api/video/video_source_interface.h b/api/video/video_source_interface.h
index 4ee4719..2bf7370 100644
--- a/api/video/video_source_interface.h
+++ b/api/video/video_source_interface.h
@@ -15,12 +15,13 @@
 
 #include "absl/types/optional.h"
 #include "api/video/video_sink_interface.h"
+#include "rtc_base/system/rtc_export.h"
 
 namespace rtc {
 
 // VideoSinkWants is used for notifying the source of properties a video frame
 // should have when it is delivered to a certain sink.
-struct VideoSinkWants {
+struct RTC_EXPORT VideoSinkWants {
   VideoSinkWants();
   VideoSinkWants(const VideoSinkWants&);
   ~VideoSinkWants();
diff --git a/api/video_codecs/BUILD.gn b/api/video_codecs/BUILD.gn
index 3e07298..129336b 100644
--- a/api/video_codecs/BUILD.gn
+++ b/api/video_codecs/BUILD.gn
@@ -59,6 +59,7 @@
     ":video_codecs_api",
     "../../media:rtc_internal_video_codecs",
     "../../rtc_base:ptr_util",
+    "../../rtc_base/system:rtc_export",
     "//third_party/abseil-cpp/absl/memory",
   ]
 }
@@ -79,6 +80,7 @@
     "../../media:rtc_internal_video_codecs",
     "../../media:rtc_media_base",
     "../../rtc_base:ptr_util",
+    "../../rtc_base/system:rtc_export",
     "//third_party/abseil-cpp/absl/memory",
   ]
 }
diff --git a/api/video_codecs/builtin_video_decoder_factory.h b/api/video_codecs/builtin_video_decoder_factory.h
index 1f8e75c..d516077 100644
--- a/api/video_codecs/builtin_video_decoder_factory.h
+++ b/api/video_codecs/builtin_video_decoder_factory.h
@@ -14,11 +14,13 @@
 #include <memory>
 
 #include "api/video_codecs/video_decoder_factory.h"
+#include "rtc_base/system/rtc_export.h"
 
 namespace webrtc {
 
 // Creates a new factory that can create the built-in types of video decoders.
-std::unique_ptr<VideoDecoderFactory> CreateBuiltinVideoDecoderFactory();
+RTC_EXPORT std::unique_ptr<VideoDecoderFactory>
+CreateBuiltinVideoDecoderFactory();
 
 }  // namespace webrtc
 
diff --git a/api/video_codecs/builtin_video_encoder_factory.h b/api/video_codecs/builtin_video_encoder_factory.h
index 6a6618f..2c45372 100644
--- a/api/video_codecs/builtin_video_encoder_factory.h
+++ b/api/video_codecs/builtin_video_encoder_factory.h
@@ -14,12 +14,14 @@
 #include <memory>
 
 #include "api/video_codecs/video_encoder_factory.h"
+#include "rtc_base/system/rtc_export.h"
 
 namespace webrtc {
 
 // Creates a new factory that can create the built-in types of video encoders.
 // The factory has simulcast support for VP8.
-std::unique_ptr<VideoEncoderFactory> CreateBuiltinVideoEncoderFactory();
+RTC_EXPORT std::unique_ptr<VideoEncoderFactory>
+CreateBuiltinVideoEncoderFactory();
 
 }  // namespace webrtc
 
diff --git a/api/video_codecs/sdp_video_format.h b/api/video_codecs/sdp_video_format.h
index c25b857..edb7819 100644
--- a/api/video_codecs/sdp_video_format.h
+++ b/api/video_codecs/sdp_video_format.h
@@ -14,11 +14,13 @@
 #include <map>
 #include <string>
 
+#include "rtc_base/system/rtc_export.h"
+
 namespace webrtc {
 
 // SDP specification for a single video codec.
 // NOTE: This class is still under development and may change without notice.
-struct SdpVideoFormat {
+struct RTC_EXPORT SdpVideoFormat {
   using Parameters = std::map<std::string, std::string>;
 
   explicit SdpVideoFormat(const std::string& name);
diff --git a/api/video_codecs/video_codec.h b/api/video_codecs/video_codec.h
index c5758a4..cbbb649 100644
--- a/api/video_codecs/video_codec.h
+++ b/api/video_codecs/video_codec.h
@@ -87,8 +87,8 @@
 };
 
 // Translates from name of codec to codec type and vice versa.
-const char* CodecTypeToPayloadString(VideoCodecType type);
-VideoCodecType PayloadStringToCodecType(const std::string& name);
+RTC_EXPORT const char* CodecTypeToPayloadString(VideoCodecType type);
+RTC_EXPORT VideoCodecType PayloadStringToCodecType(const std::string& name);
 
 union VideoCodecUnion {
   VideoCodecVP8 VP8;
diff --git a/modules/desktop_capture/desktop_geometry.h b/modules/desktop_capture/desktop_geometry.h
index 09ad55b..623a455 100644
--- a/modules/desktop_capture/desktop_geometry.h
+++ b/modules/desktop_capture/desktop_geometry.h
@@ -14,6 +14,7 @@
 #include <stdint.h>
 
 #include "rtc_base/constructormagic.h"
+#include "rtc_base/system/rtc_export.h"
 
 namespace webrtc {
 
@@ -74,7 +75,7 @@
 };
 
 // Represents a rectangle on the screen.
-class DesktopRect {
+class RTC_EXPORT DesktopRect {
  public:
   static DesktopRect MakeSize(const DesktopSize& size) {
     return DesktopRect(0, 0, size.width(), size.height());
diff --git a/modules/desktop_capture/desktop_region.h b/modules/desktop_capture/desktop_region.h
index f4b9209..cbb2d8c 100644
--- a/modules/desktop_capture/desktop_region.h
+++ b/modules/desktop_capture/desktop_region.h
@@ -16,6 +16,7 @@
 
 #include "modules/desktop_capture/desktop_geometry.h"
 #include "rtc_base/constructormagic.h"
+#include "rtc_base/system/rtc_export.h"
 
 namespace webrtc {
 
@@ -23,7 +24,7 @@
 //
 // Internally each region is stored as a set of rows where each row contains one
 // or more rectangles aligned vertically.
-class DesktopRegion {
+class RTC_EXPORT DesktopRegion {
  private:
   // The following private types need to be declared first because they are used
   // in the public Iterator.
diff --git a/modules/desktop_capture/shared_desktop_frame.h b/modules/desktop_capture/shared_desktop_frame.h
index f70508c..ea12c00 100644
--- a/modules/desktop_capture/shared_desktop_frame.h
+++ b/modules/desktop_capture/shared_desktop_frame.h
@@ -16,12 +16,13 @@
 #include "rtc_base/refcount.h"
 #include "rtc_base/refcountedobject.h"
 #include "rtc_base/scoped_ref_ptr.h"
+#include "rtc_base/system/rtc_export.h"
 
 namespace webrtc {
 
 // SharedDesktopFrame is a DesktopFrame that may have multiple instances all
 // sharing the same buffer.
-class SharedDesktopFrame : public DesktopFrame {
+class RTC_EXPORT SharedDesktopFrame : public DesktopFrame {
  public:
   ~SharedDesktopFrame() override;
 
diff --git a/p2p/base/icetransportinternal.h b/p2p/base/icetransportinternal.h
index a4af24b..b360f79 100644
--- a/p2p/base/icetransportinternal.h
+++ b/p2p/base/icetransportinternal.h
@@ -20,6 +20,7 @@
 #include "p2p/base/packettransportinternal.h"
 #include "p2p/base/port.h"
 #include "p2p/base/transportdescription.h"
+#include "rtc_base/system/rtc_export.h"
 
 namespace cricket {
 
@@ -183,7 +184,7 @@
 // Once the public interface is supported,
 // (https://www.w3.org/TR/webrtc/#rtcicetransport-interface)
 // the IceTransportInterface will be split from this class.
-class IceTransportInternal : public rtc::PacketTransportInternal {
+class RTC_EXPORT IceTransportInternal : public rtc::PacketTransportInternal {
  public:
   IceTransportInternal();
   ~IceTransportInternal() override;
diff --git a/p2p/base/p2pconstants.h b/p2p/base/p2pconstants.h
index b2e92ef..2948be0 100644
--- a/p2p/base/p2pconstants.h
+++ b/p2p/base/p2pconstants.h
@@ -13,6 +13,8 @@
 
 #include <string>
 
+#include "rtc_base/system/rtc_export.h"
+
 namespace cricket {
 
 // CN_ == "content name".  When we initiate a session, we choose the
@@ -29,7 +31,7 @@
 extern const char GROUP_TYPE_BUNDLE[];
 
 extern const int ICE_UFRAG_LENGTH;
-extern const int ICE_PWD_LENGTH;
+RTC_EXPORT extern const int ICE_PWD_LENGTH;
 extern const size_t ICE_UFRAG_MIN_LENGTH;
 extern const size_t ICE_PWD_MIN_LENGTH;
 extern const size_t ICE_UFRAG_MAX_LENGTH;
diff --git a/p2p/base/p2ptransportchannel.h b/p2p/base/p2ptransportchannel.h
index 84d2879..fd59bbd 100644
--- a/p2p/base/p2ptransportchannel.h
+++ b/p2p/base/p2ptransportchannel.h
@@ -42,6 +42,7 @@
 #include "rtc_base/asyncpacketsocket.h"
 #include "rtc_base/constructormagic.h"
 #include "rtc_base/strings/string_builder.h"
+#include "rtc_base/system/rtc_export.h"
 #include "rtc_base/third_party/sigslot/sigslot.h"
 
 namespace webrtc {
@@ -75,7 +76,7 @@
 
 // P2PTransportChannel manages the candidates and connection process to keep
 // two P2P clients connected to each other.
-class P2PTransportChannel : public IceTransportInternal {
+class RTC_EXPORT P2PTransportChannel : public IceTransportInternal {
  public:
   // For testing only.
   // TODO(zstein): Remove once AsyncResolverFactory is required.
diff --git a/p2p/base/packettransportinternal.h b/p2p/base/packettransportinternal.h
index ca7f003..3cdacbc 100644
--- a/p2p/base/packettransportinternal.h
+++ b/p2p/base/packettransportinternal.h
@@ -21,6 +21,7 @@
 #include "rtc_base/asyncpacketsocket.h"
 #include "rtc_base/networkroute.h"
 #include "rtc_base/socket.h"
+#include "rtc_base/system/rtc_export.h"
 #include "rtc_base/third_party/sigslot/sigslot.h"
 
 namespace rtc {
@@ -28,8 +29,9 @@
 struct PacketTime;
 struct SentPacket;
 
-class PacketTransportInternal : public virtual webrtc::PacketTransportInterface,
-                                public sigslot::has_slots<> {
+class RTC_EXPORT PacketTransportInternal
+    : public virtual webrtc::PacketTransportInterface,
+      public sigslot::has_slots<> {
  public:
   virtual const std::string& transport_name() const = 0;
 
diff --git a/p2p/base/port.h b/p2p/base/port.h
index 85711e4..be273bd 100644
--- a/p2p/base/port.h
+++ b/p2p/base/port.h
@@ -37,6 +37,7 @@
 #include "rtc_base/proxyinfo.h"
 #include "rtc_base/ratetracker.h"
 #include "rtc_base/socketaddress.h"
+#include "rtc_base/system/rtc_export.h"
 #include "rtc_base/third_party/sigslot/sigslot.h"
 #include "rtc_base/thread.h"
 #include "rtc_base/weak_ptr.h"
@@ -49,7 +50,7 @@
 extern const char LOCAL_PORT_TYPE[];
 extern const char STUN_PORT_TYPE[];
 extern const char PRFLX_PORT_TYPE[];
-extern const char RELAY_PORT_TYPE[];
+RTC_EXPORT extern const char RELAY_PORT_TYPE[];
 
 // RFC 6544, TCP candidate encoding rules.
 extern const int DISCARD_PORT;
diff --git a/p2p/base/pseudotcp.h b/p2p/base/pseudotcp.h
index c363ef6..5b26aeb 100644
--- a/p2p/base/pseudotcp.h
+++ b/p2p/base/pseudotcp.h
@@ -14,6 +14,7 @@
 #include <list>
 
 #include "rtc_base/stream.h"
+#include "rtc_base/system/rtc_export.h"
 
 namespace cricket {
 
@@ -45,7 +46,7 @@
 // PseudoTcp
 //////////////////////////////////////////////////////////////////////
 
-class PseudoTcp {
+class RTC_EXPORT PseudoTcp {
  public:
   static uint32_t Now();