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

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).

Bug: webrtc:9419
Change-Id: I6f27003001548ea9d54412fdf62d5dd7a39cfd46
Reviewed-on: https://webrtc-review.googlesource.com/c/106022
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25187}
diff --git a/api/BUILD.gn b/api/BUILD.gn
index ac3e308..babc260 100644
--- a/api/BUILD.gn
+++ b/api/BUILD.gn
@@ -128,6 +128,7 @@
     "../rtc_base:rtc_base",
     "../rtc_base:rtc_base_approved",
     "../rtc_base:stringutils",
+    "../rtc_base/system:rtc_export",
   ]
 
   if (is_nacl) {
@@ -250,6 +251,7 @@
   deps = [
     "../rtc_base:checks",
     "../rtc_base:rtc_base_approved",
+    "../rtc_base/system:rtc_export",
   ]
 }
 
diff --git a/api/audio_codecs/L16/BUILD.gn b/api/audio_codecs/L16/BUILD.gn
index e362067..a7d56d0 100644
--- a/api/audio_codecs/L16/BUILD.gn
+++ b/api/audio_codecs/L16/BUILD.gn
@@ -43,6 +43,7 @@
     "../../..:webrtc_common",
     "../../../modules/audio_coding:pcm16b",
     "../../../rtc_base:rtc_base_approved",
+    "../../../rtc_base/system:rtc_export",
     "//third_party/abseil-cpp/absl/memory",
     "//third_party/abseil-cpp/absl/types:optional",
   ]
diff --git a/api/audio_codecs/L16/audio_decoder_L16.h b/api/audio_codecs/L16/audio_decoder_L16.h
index 184ec24..b38627d 100644
--- a/api/audio_codecs/L16/audio_decoder_L16.h
+++ b/api/audio_codecs/L16/audio_decoder_L16.h
@@ -18,6 +18,7 @@
 #include "api/audio_codecs/audio_codec_pair_id.h"
 #include "api/audio_codecs/audio_decoder.h"
 #include "api/audio_codecs/audio_format.h"
+#include "rtc_base/system/rtc_export.h"
 
 namespace webrtc {
 
@@ -25,7 +26,7 @@
 // CreateAudioDecoderFactory<...>().
 //
 // NOTE: This struct is still under development and may change without notice.
-struct AudioDecoderL16 {
+struct RTC_EXPORT AudioDecoderL16 {
   struct Config {
     bool IsOk() const {
       return (sample_rate_hz == 8000 || sample_rate_hz == 16000 ||
diff --git a/api/audio_codecs/g711/BUILD.gn b/api/audio_codecs/g711/BUILD.gn
index 860ba3d..ebd0b32 100644
--- a/api/audio_codecs/g711/BUILD.gn
+++ b/api/audio_codecs/g711/BUILD.gn
@@ -43,6 +43,7 @@
     "../../..:webrtc_common",
     "../../../modules/audio_coding:g711",
     "../../../rtc_base:rtc_base_approved",
+    "../../../rtc_base/system:rtc_export",
     "//third_party/abseil-cpp/absl/memory",
     "//third_party/abseil-cpp/absl/types:optional",
   ]
diff --git a/api/audio_codecs/g711/audio_decoder_g711.h b/api/audio_codecs/g711/audio_decoder_g711.h
index 8275a8c..0c67e5e 100644
--- a/api/audio_codecs/g711/audio_decoder_g711.h
+++ b/api/audio_codecs/g711/audio_decoder_g711.h
@@ -18,6 +18,7 @@
 #include "api/audio_codecs/audio_codec_pair_id.h"
 #include "api/audio_codecs/audio_decoder.h"
 #include "api/audio_codecs/audio_format.h"
+#include "rtc_base/system/rtc_export.h"
 
 namespace webrtc {
 
@@ -25,7 +26,7 @@
 // CreateAudioDecoderFactory<...>().
 //
 // NOTE: This struct is still under development and may change without notice.
-struct AudioDecoderG711 {
+struct RTC_EXPORT AudioDecoderG711 {
   struct Config {
     enum class Type { kPcmU, kPcmA };
     bool IsOk() const {
diff --git a/api/audio_codecs/g722/BUILD.gn b/api/audio_codecs/g722/BUILD.gn
index d69596b..101c7a9 100644
--- a/api/audio_codecs/g722/BUILD.gn
+++ b/api/audio_codecs/g722/BUILD.gn
@@ -51,6 +51,7 @@
     "../../..:webrtc_common",
     "../../../modules/audio_coding:g722",
     "../../../rtc_base:rtc_base_approved",
+    "../../../rtc_base/system:rtc_export",
     "//third_party/abseil-cpp/absl/memory",
     "//third_party/abseil-cpp/absl/types:optional",
   ]
diff --git a/api/audio_codecs/g722/audio_decoder_g722.h b/api/audio_codecs/g722/audio_decoder_g722.h
index b7bb089..7601b3c 100644
--- a/api/audio_codecs/g722/audio_decoder_g722.h
+++ b/api/audio_codecs/g722/audio_decoder_g722.h
@@ -18,6 +18,7 @@
 #include "api/audio_codecs/audio_codec_pair_id.h"
 #include "api/audio_codecs/audio_decoder.h"
 #include "api/audio_codecs/audio_format.h"
+#include "rtc_base/system/rtc_export.h"
 
 namespace webrtc {
 
@@ -25,7 +26,7 @@
 // CreateAudioDecoderFactory<...>().
 //
 // NOTE: This struct is still under development and may change without notice.
-struct AudioDecoderG722 {
+struct RTC_EXPORT AudioDecoderG722 {
   struct Config {
     bool IsOk() const { return num_channels == 1 || num_channels == 2; }
     int num_channels;
diff --git a/api/audio_codecs/opus/BUILD.gn b/api/audio_codecs/opus/BUILD.gn
index 9c9bf33..af3cd7f 100644
--- a/api/audio_codecs/opus/BUILD.gn
+++ b/api/audio_codecs/opus/BUILD.gn
@@ -20,6 +20,7 @@
   ]
   deps = [
     "../../../rtc_base:rtc_base_approved",
+    "../../../rtc_base/system:rtc_export",
     "//third_party/abseil-cpp/absl/types:optional",
   ]
   defines = []
diff --git a/api/audio_codecs/opus/audio_encoder_opus_config.h b/api/audio_codecs/opus/audio_encoder_opus_config.h
index c7067bb..98a6ef5 100644
--- a/api/audio_codecs/opus/audio_encoder_opus_config.h
+++ b/api/audio_codecs/opus/audio_encoder_opus_config.h
@@ -16,11 +16,12 @@
 #include <vector>
 
 #include "absl/types/optional.h"
+#include "rtc_base/system/rtc_export.h"
 
 namespace webrtc {
 
 // NOTE: This struct is still under development and may change without notice.
-struct AudioEncoderOpusConfig {
+struct RTC_EXPORT AudioEncoderOpusConfig {
   static constexpr int kDefaultFrameSizeMs = 20;
 
   // Opus API allows a min bitrate of 500bps, but Opus documentation suggests
diff --git a/api/candidate.h b/api/candidate.h
index 0a84591..4c650d9 100644
--- a/api/candidate.h
+++ b/api/candidate.h
@@ -20,13 +20,14 @@
 #include "rtc_base/checks.h"
 #include "rtc_base/network_constants.h"
 #include "rtc_base/socketaddress.h"
+#include "rtc_base/system/rtc_export.h"
 
 namespace cricket {
 
 // Candidate for ICE based connection discovery.
 // TODO(phoglund): remove things in here that are not needed in the public API.
 
-class Candidate {
+class RTC_EXPORT Candidate {
  public:
   Candidate();
   // TODO(pthatcher): Match the ordering and param list as per RFC 5245
diff --git a/api/jsep.h b/api/jsep.h
index 4d4bcc0..03ce6d7 100644
--- a/api/jsep.h
+++ b/api/jsep.h
@@ -29,6 +29,7 @@
 #include "absl/types/optional.h"
 #include "api/rtcerror.h"
 #include "rtc_base/refcount.h"
+#include "rtc_base/system/rtc_export.h"
 
 namespace cricket {
 class Candidate;
@@ -73,13 +74,13 @@
 // Creates a IceCandidateInterface based on SDP string.
 // Returns null if the sdp string can't be parsed.
 // |error| may be null.
-IceCandidateInterface* CreateIceCandidate(const std::string& sdp_mid,
-                                          int sdp_mline_index,
-                                          const std::string& sdp,
-                                          SdpParseError* error);
+RTC_EXPORT IceCandidateInterface* CreateIceCandidate(const std::string& sdp_mid,
+                                                     int sdp_mline_index,
+                                                     const std::string& sdp,
+                                                     SdpParseError* error);
 
 // Creates an IceCandidateInterface based on a parsed candidate structure.
-std::unique_ptr<IceCandidateInterface> CreateIceCandidate(
+RTC_EXPORT std::unique_ptr<IceCandidateInterface> CreateIceCandidate(
     const std::string& sdp_mid,
     int sdp_mline_index,
     const cricket::Candidate& candidate);
@@ -121,7 +122,7 @@
 // and is therefore not expected to be thread safe.
 //
 // An instance can be created by CreateSessionDescription.
-class SessionDescriptionInterface {
+class RTC_EXPORT SessionDescriptionInterface {
  public:
   // String representations of the supported SDP types.
   static const char kOffer[];
@@ -181,21 +182,21 @@
 // |error| may be null.
 // TODO(steveanton): This function is deprecated. Please use the functions below
 // which take an SdpType enum instead. Remove this once it is no longer used.
-SessionDescriptionInterface* CreateSessionDescription(const std::string& type,
-                                                      const std::string& sdp,
-                                                      SdpParseError* error);
+RTC_EXPORT SessionDescriptionInterface* CreateSessionDescription(
+    const std::string& type,
+    const std::string& sdp,
+    SdpParseError* error);
 
 // Creates a SessionDescriptionInterface based on the SDP string and the type.
 // Returns null if the SDP string cannot be parsed.
 // If using the signature with |error_out|, details of the parsing error may be
 // written to |error_out| if it is not null.
-std::unique_ptr<SessionDescriptionInterface> CreateSessionDescription(
-    SdpType type,
-    const std::string& sdp);
-std::unique_ptr<SessionDescriptionInterface> CreateSessionDescription(
-    SdpType type,
-    const std::string& sdp,
-    SdpParseError* error_out);
+RTC_EXPORT std::unique_ptr<SessionDescriptionInterface>
+CreateSessionDescription(SdpType type, const std::string& sdp);
+RTC_EXPORT std::unique_ptr<SessionDescriptionInterface>
+CreateSessionDescription(SdpType type,
+                         const std::string& sdp,
+                         SdpParseError* error_out);
 
 // Creates a SessionDescriptionInterface based on a parsed SDP structure and the
 // given type, ID and version.
diff --git a/api/stats/rtcstatsreport.h b/api/stats/rtcstatsreport.h
index f7410b3..8bf1cb5 100644
--- a/api/stats/rtcstatsreport.h
+++ b/api/stats/rtcstatsreport.h
@@ -20,12 +20,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 {
 
 // A collection of stats.
 // This is accessible as a map from |RTCStats::id| to |RTCStats|.
-class RTCStatsReport : public rtc::RefCountInterface {
+class RTC_EXPORT RTCStatsReport : public rtc::RefCountInterface {
  public:
   typedef std::map<std::string, std::unique_ptr<const RTCStats>> StatsMap;