Introduce WebRTC component build.

This CL switches all the Chromium dependencies from being direct
dependencies on WebRTC targets to a WebRTC component (which lives
at //third_party/webrtc_overrides:webrtc_component).

From now on, Chromium should never directly depend on WebRTC in
order to avoid issues explained at [1] (this will be guarded
by checkdeps and GN visibility (see [2])) but should only depend
on the WebRTC component.

This should solve a broad range of problems caused by WebRTC being
linked in different shared libraries when is_component_build=true
(from globals and singletons causing hard to debug issues, to ODR
violations and binary size increase).

[1] - https://chromium.googlesource.com/chromium/src.git/+/master/docs/component_build.md#dependencies-between-targets
[2] - https://webrtc-review.googlesource.com/c/src/+/154344

TBR: dcheng@chromium.org
Bug: webrtc:9419
Change-Id: Ice56827db1753f51592165a90c1094b468c8e188
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1874722
Commit-Queue: Mirko Bonadei <mbonadei@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Reviewed-by: Tommi <tommi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#715450}
diff --git a/DEPS b/DEPS
index cce16a6..44f74ee 100644
--- a/DEPS
+++ b/DEPS
@@ -1502,7 +1502,7 @@
     Var('chromium_git') + '/external/khronosgroup/webgl.git' + '@' + 'dd55f3ca8f2ea716ca917a4aaf36f0729fe902b1',
 
   'src/third_party/webrtc':
-    Var('webrtc_git') + '/src.git' + '@' + 'eb48799ec5048459b2b5e00b6d940ddcf76c72d9',
+    Var('webrtc_git') + '/src.git' + '@' + '02fac7d86e64595d6c35c1460e491d7f04c01864',
 
   # Wuffs' canonical repository is at github.com/google/wuffs, but we use
   # Skia's mirror of Wuffs, the same as in upstream Skia's DEPS file.
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
index 872dcb24..483bce5 100644
--- a/chrome/browser/BUILD.gn
+++ b/chrome/browser/BUILD.gn
@@ -2196,8 +2196,7 @@
     "//third_party/metrics_proto",
     "//third_party/re2",
     "//third_party/smhasher:cityhash",
-    "//third_party/webrtc_overrides",
-    "//third_party/webrtc_overrides:init_webrtc",
+    "//third_party/webrtc_overrides:webrtc_component",
     "//third_party/widevine/cdm:buildflags",
     "//third_party/zlib",
     "//third_party/zlib:minizip",
diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn
index 5287a34d..308530f 100644
--- a/chrome/browser/ui/BUILD.gn
+++ b/chrome/browser/ui/BUILD.gn
@@ -557,7 +557,7 @@
     "//third_party/icu",
     "//third_party/leveldatabase",
     "//third_party/re2",
-    "//third_party/webrtc_overrides",
+    "//third_party/webrtc_overrides:webrtc_component",
     "//third_party/zlib",
     "//ui/accessibility",
     "//ui/base",
diff --git a/chrome/service/BUILD.gn b/chrome/service/BUILD.gn
index f6b6231..6775dd4a 100644
--- a/chrome/service/BUILD.gn
+++ b/chrome/service/BUILD.gn
@@ -72,7 +72,7 @@
     "//printing",
     "//services/network/public/cpp",
     "//skia",
-    "//third_party/webrtc_overrides",
+    "//third_party/webrtc_overrides:webrtc_component",
   ]
 
   public_deps = [
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn
index f3e97747..674a957 100644
--- a/chrome/test/BUILD.gn
+++ b/chrome/test/BUILD.gn
@@ -736,7 +736,7 @@
       "//third_party/cacheinvalidation",
       "//third_party/icu",
       "//third_party/leveldatabase",
-      "//third_party/webrtc_overrides",
+      "//third_party/webrtc_overrides:webrtc_component",
       "//third_party/widevine/cdm:buildflags",
       "//third_party/widevine/cdm:headers",
       "//ui/accessibility:test_support",
@@ -3562,8 +3562,7 @@
     "//third_party/libaddressinput",
     "//third_party/libphonenumber",
     "//third_party/metrics_proto",
-    "//third_party/webrtc/modules/desktop_capture",
-    "//third_party/webrtc_overrides",
+    "//third_party/webrtc_overrides:webrtc_component",
     "//third_party/zlib/google:compression_utils",
     "//ui/base:test_support",
     "//ui/display:test_support",
@@ -5724,7 +5723,7 @@
         "//chrome/install_static:install_static_util",
         "//chrome/installer/util:strings",
         "//third_party/isimpledom",
-        "//third_party/webrtc/modules/desktop_capture",
+        "//third_party/webrtc_overrides:webrtc_component",
         "//third_party/wtl",
         "//ui/resources",
       ]
@@ -6338,7 +6337,7 @@
       deps += [
         "//chrome:other_version",
         "//chrome/installer/util:strings",
-        "//third_party/webrtc/modules/desktop_capture",
+        "//third_party/webrtc_overrides:webrtc_component",
         "//third_party/wtl",
         "//ui/resources",
       ]
diff --git a/chrome/tools/service_discovery_sniffer/BUILD.gn b/chrome/tools/service_discovery_sniffer/BUILD.gn
index 9355aae..4c45f545 100644
--- a/chrome/tools/service_discovery_sniffer/BUILD.gn
+++ b/chrome/tools/service_discovery_sniffer/BUILD.gn
@@ -16,6 +16,6 @@
     "//base/test:test_support",
     "//chrome/browser",
     "//net",
-    "//third_party/webrtc_overrides:init_webrtc",
+    "//third_party/webrtc_overrides:webrtc_component",
   ]
 }
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn
index 66f2493..7ba25a7 100644
--- a/content/browser/BUILD.gn
+++ b/content/browser/BUILD.gn
@@ -207,8 +207,7 @@
     "//third_party/libyuv",
     "//third_party/re2",
     "//third_party/sqlite",
-    "//third_party/webrtc/modules/desktop_capture:primitives",
-    "//third_party/webrtc/rtc_base:rtc_base",
+    "//third_party/webrtc_overrides:webrtc_component",
     "//third_party/zlib",
     "//third_party/zlib/google:zip",
     "//ui/accessibility",
@@ -2081,8 +2080,7 @@
       "media/capture/web_contents_video_capture_device.cc",
       "media/capture/web_contents_video_capture_device.h",
     ]
-    public_deps += [ "//third_party/webrtc_overrides:init_webrtc" ]
-    deps += [ "//third_party/webrtc/modules/desktop_capture" ]
+    deps += [ "//third_party/webrtc_overrides:webrtc_component" ]
     if (use_aura) {
       sources += [
         "media/capture/aura_window_video_capture_device.cc",
diff --git a/content/public/browser/BUILD.gn b/content/public/browser/BUILD.gn
index 5dcf1099..730107e 100644
--- a/content/public/browser/BUILD.gn
+++ b/content/public/browser/BUILD.gn
@@ -425,7 +425,7 @@
     "//services/tracing/public/cpp",
     "//services/video_capture/public/mojom",
     "//services/viz/public/mojom",
-    "//third_party/webrtc/modules/desktop_capture",
+    "//third_party/webrtc_overrides:webrtc_component",
 
     # We expose skia headers in the public API.
     "//skia",
diff --git a/content/public/renderer/BUILD.gn b/content/public/renderer/BUILD.gn
index a334e276..9e21dea 100644
--- a/content/public/renderer/BUILD.gn
+++ b/content/public/renderer/BUILD.gn
@@ -91,7 +91,7 @@
     "//skia",
     "//third_party/blink/public:blink_headers",
     "//third_party/blink/public/common",
-    "//third_party/webrtc_overrides",
+    "//third_party/webrtc_overrides:webrtc_component",
     "//third_party/widevine/cdm:headers",
     "//ui/base",
     "//ui/base/ime",
diff --git a/content/test/BUILD.gn b/content/test/BUILD.gn
index 8e89e9b..6468c55 100644
--- a/content/test/BUILD.gn
+++ b/content/test/BUILD.gn
@@ -402,15 +402,7 @@
     "//testing/gmock",
     "//testing/gtest",
     "//third_party/blink/public/strings:strings_grit",
-    "//third_party/webrtc/api:libjingle_peerconnection_api",
-    "//third_party/webrtc/api:media_stream_interface",
-    "//third_party/webrtc/api:rtc_stats_api",
-    "//third_party/webrtc/api:scoped_refptr",
-    "//third_party/webrtc/media:rtc_media_base",
-    "//third_party/webrtc/pc:libjingle_peerconnection",
-    "//third_party/webrtc/rtc_base:rtc_base_approved",
-    "//third_party/webrtc/stats:rtc_stats",
-    "//third_party/webrtc_overrides:init_webrtc",
+    "//third_party/webrtc_overrides:webrtc_component",
     "//ui/accessibility:ax_enums_mojo",
     "//ui/base",
     "//ui/base:test_support",
@@ -2106,8 +2098,7 @@
       "//content/common:buildflags",
       "//media/capture:test_support",
       "//third_party/libyuv",
-      "//third_party/webrtc/modules/desktop_capture",
-      "//third_party/webrtc/modules/desktop_capture:primitives",
+      "//third_party/webrtc_overrides:webrtc_component",
     ]
     sources += [
       "../browser/media/capture/desktop_capture_device_unittest.cc",
diff --git a/content/test/fuzzer/BUILD.gn b/content/test/fuzzer/BUILD.gn
index 696e5a6..aa524f05 100644
--- a/content/test/fuzzer/BUILD.gn
+++ b/content/test/fuzzer/BUILD.gn
@@ -240,7 +240,7 @@
     deps = [
       "//base",
       "//base/test:test_support",
-      "//third_party/webrtc/rtc_base:rtc_base_approved",
+      "//third_party/webrtc_overrides:webrtc_component",
       "//ui/base",
       "//url:url",
     ]
diff --git a/extensions/BUILD.gn b/extensions/BUILD.gn
index 0dc76dc..ac430db 100644
--- a/extensions/BUILD.gn
+++ b/extensions/BUILD.gn
@@ -320,8 +320,7 @@
     "//third_party/icu",
     "//third_party/leveldatabase",
     "//third_party/libaddressinput",
-    "//third_party/webrtc/modules/desktop_capture",
-    "//third_party/webrtc_overrides",
+    "//third_party/webrtc_overrides:webrtc_component",
     "//third_party/widevine/cdm:headers",
     "//ui/accessibility:test_support",
     "//ui/base:test_support",
diff --git a/jingle/BUILD.gn b/jingle/BUILD.gn
index cf3f11d..1c59e6c 100644
--- a/jingle/BUILD.gn
+++ b/jingle/BUILD.gn
@@ -12,13 +12,10 @@
     "glue/utils.cc",
     "glue/utils.h",
   ]
-  public_deps = [
-    "//third_party/webrtc/rtc_base",
-  ]
   deps = [
     "//base",
     "//net",
-    "//third_party/webrtc/api:libjingle_peerconnection_api",
+    "//third_party/webrtc_overrides:webrtc_component",
   ]
 }
 
@@ -117,7 +114,7 @@
 
   public_deps = [
     "//third_party/libjingle_xmpp",
-    "//third_party/webrtc_overrides",
+    "//third_party/webrtc_overrides:webrtc_component",
   ]
   deps = [
     ":jingle_glue",
@@ -215,7 +212,6 @@
     "//testing/gmock",
     "//testing/gtest",
     "//third_party/libjingle_xmpp:rtc_task_runner",
-    "//third_party/webrtc_overrides",
-    "//third_party/webrtc_overrides:init_webrtc",
+    "//third_party/webrtc_overrides:webrtc_component",
   ]
 }
diff --git a/media/gpu/ipc/service/BUILD.gn b/media/gpu/ipc/service/BUILD.gn
index b2f8046..fe51b14 100644
--- a/media/gpu/ipc/service/BUILD.gn
+++ b/media/gpu/ipc/service/BUILD.gn
@@ -53,7 +53,7 @@
   }
 
   if (is_mac) {
-    deps += [ "//third_party/webrtc/common_video:common_video" ]
+    deps += [ "//third_party/webrtc_overrides:webrtc_component" ]
   }
 }
 
diff --git a/media/gpu/mac/BUILD.gn b/media/gpu/mac/BUILD.gn
index b66f5e0..200cdb1 100644
--- a/media/gpu/mac/BUILD.gn
+++ b/media/gpu/mac/BUILD.gn
@@ -24,7 +24,7 @@
     "vt_video_encode_accelerator_mac.h",
   ]
   public_deps = [
-    "//third_party/webrtc/common_video",
+    "//third_party/webrtc_overrides:webrtc_component",
   ]
   libs = [
     "CoreFoundation.framework",
diff --git a/media/webrtc/BUILD.gn b/media/webrtc/BUILD.gn
index 14c5c225..400d6b2b 100644
--- a/media/webrtc/BUILD.gn
+++ b/media/webrtc/BUILD.gn
@@ -29,10 +29,7 @@
   deps = [
     "//base",
     "//media:shared_memory_support",
-    "//third_party/webrtc/modules/audio_processing",
-    "//third_party/webrtc/modules/audio_processing:api",
-    "//third_party/webrtc/modules/audio_processing:audio_processing_statistics",
-    "//third_party/webrtc_overrides:init_webrtc",
+    "//third_party/webrtc_overrides:webrtc_component",
   ]
 
   if (audio_processing_in_audio_service_supported) {
@@ -43,15 +40,7 @@
       "audio_processor_controls.h",
     ]
 
-    deps += [
-      "//media",
-      "//third_party/webrtc/api:libjingle_peerconnection_api",
-      "//third_party/webrtc/api:media_stream_interface",
-      "//third_party/webrtc/api/audio:aec3_factory",
-      "//third_party/webrtc/modules/audio_processing/aec_dump:aec_dump",
-      "//third_party/webrtc/rtc_base:rtc_task_queue",
-      "//third_party/webrtc_overrides:task_queue_factory",
-    ]
+    deps += [ "//media" ]
 
     public_configs = [ ":audio_processing_build_flag" ]
   }
@@ -67,8 +56,7 @@
       "//media/webrtc",
       "//testing/gmock",
       "//testing/gtest",
-      "//third_party/webrtc/modules/audio_processing",
-      "//third_party/webrtc_overrides:init_webrtc",
+      "//third_party/webrtc_overrides:webrtc_component",
     ]
     sources = [
       "audio_processor_unittest.cc",
diff --git a/remoting/BUILD.gn b/remoting/BUILD.gn
index a00b645..59265a2 100644
--- a/remoting/BUILD.gn
+++ b/remoting/BUILD.gn
@@ -175,7 +175,7 @@
     ]
   }
 
-  deps += [ "//third_party/webrtc_overrides:init_webrtc" ]
+  deps += [ "//third_party/webrtc_overrides:webrtc_component" ]
 
   if (is_android) {
     deps += [ "//net/android:net_java" ]
@@ -218,12 +218,9 @@
       "//net:test_support",
       "//remoting/base",
       "//testing/gtest",
-      "//third_party/webrtc/modules/desktop_capture",
-      "//third_party/webrtc_overrides",
+      "//third_party/webrtc_overrides:webrtc_component",
     ]
 
-    deps += [ "//third_party/webrtc_overrides:init_webrtc" ]
-
     if (is_win) {
       defines += [ "_ALT_NO_EXCEPTIONS" ]
 
diff --git a/remoting/base/BUILD.gn b/remoting/base/BUILD.gn
index 3134240..a2a2cea9 100644
--- a/remoting/base/BUILD.gn
+++ b/remoting/base/BUILD.gn
@@ -69,7 +69,7 @@
     "//remoting/base/grpc_support",
     "//third_party/libvpx",
     "//third_party/libyuv",
-    "//third_party/webrtc/modules/desktop_capture:primitives",
+    "//third_party/webrtc_overrides:webrtc_component",
     "//url",
   ]
   if (is_nacl) {
@@ -198,7 +198,7 @@
     "//mojo/core/embedder",
     "//net:test_support",
     "//third_party/libyuv",
-    "//third_party/webrtc/modules/desktop_capture:primitives",
+    "//third_party/webrtc_overrides:webrtc_component",
   ]
 
   if (is_win || is_mac || is_chromeos) {
diff --git a/remoting/client/BUILD.gn b/remoting/client/BUILD.gn
index 2026b2da..305442c 100644
--- a/remoting/client/BUILD.gn
+++ b/remoting/client/BUILD.gn
@@ -45,7 +45,7 @@
     "//remoting/codec:decoder",
     "//remoting/protocol",
     "//third_party/libyuv",
-    "//third_party/webrtc/modules/desktop_capture:primitives",
+    "//third_party/webrtc_overrides:webrtc_component",
     "//ui/events:dom_keycode_converter",
   ]
 
@@ -109,6 +109,6 @@
     "//remoting/proto",
     "//testing/gmock",
     "//testing/gtest",
-    "//third_party/webrtc/rtc_base:rtc_base_approved",
+    "//third_party/webrtc_overrides:webrtc_component",
   ]
 }
diff --git a/remoting/client/display/BUILD.gn b/remoting/client/display/BUILD.gn
index 6f581ec..1aebe48 100644
--- a/remoting/client/display/BUILD.gn
+++ b/remoting/client/display/BUILD.gn
@@ -36,7 +36,7 @@
   deps = [
     "//third_party/libyuv",
     "//third_party/protobuf:protobuf_lite",
-    "//third_party/webrtc/rtc_base:rtc_base_approved",
+    "//third_party/webrtc_overrides:webrtc_component",
   ]
 
   public_configs = [ "//third_party/khronos:khronos_headers" ]
@@ -94,7 +94,7 @@
       "//remoting/proto",
       "//testing/gmock",
       "//testing/gtest",
-      "//third_party/webrtc/rtc_base:rtc_base_approved",
+      "//third_party/webrtc_overrides:webrtc_component",
     ]
   }
 }
diff --git a/remoting/client/input/BUILD.gn b/remoting/client/input/BUILD.gn
index a76375a..17b1222 100644
--- a/remoting/client/input/BUILD.gn
+++ b/remoting/client/input/BUILD.gn
@@ -31,7 +31,7 @@
     ":normalizing_input_filter",
     "//remoting/base",
     "//remoting/client/ui:ui_manipulation",
-    "//third_party/webrtc/rtc_base:rtc_base_approved",
+    "//third_party/webrtc_overrides:webrtc_component",
     "//ui/events:dom_keycode_converter",
   ]
 
@@ -56,8 +56,7 @@
 
   deps = [
     "//remoting/base",
-    "//third_party/webrtc/modules/desktop_capture:primitives",
-    "//third_party/webrtc/rtc_base:rtc_base_approved",
+    "//third_party/webrtc_overrides:webrtc_component",
     "//ui/events:dom_keycode_converter",
   ]
 }
@@ -82,7 +81,7 @@
     "//remoting/proto",
     "//testing/gmock",
     "//testing/gtest",
-    "//third_party/webrtc/rtc_base:rtc_base_approved",
+    "//third_party/webrtc_overrides:webrtc_component",
   ]
 }
 
@@ -107,6 +106,6 @@
     "//remoting/proto",
     "//testing/gmock",
     "//testing/gtest",
-    "//third_party/webrtc/rtc_base:rtc_base_approved",
+    "//third_party/webrtc_overrides:webrtc_component",
   ]
 }
diff --git a/remoting/client/plugin/BUILD.gn b/remoting/client/plugin/BUILD.gn
index 7b121e3..4b53594 100644
--- a/remoting/client/plugin/BUILD.gn
+++ b/remoting/client/plugin/BUILD.gn
@@ -57,10 +57,7 @@
     "//remoting/protocol",
     "//remoting/signaling",
     "//third_party/libyuv",
-    "//third_party/webrtc/api:packet_socket_factory",
-    "//third_party/webrtc/modules/desktop_capture:primitives",
-    "//third_party/webrtc_overrides:metrics",
-    "//third_party/webrtc_overrides:task_queue_impl",
+    "//third_party/webrtc_overrides:webrtc_component",
     "//ui/events:dom_keycode_converter",
   ]
 
diff --git a/remoting/client/ui/BUILD.gn b/remoting/client/ui/BUILD.gn
index 8b21909..9cbda24 100644
--- a/remoting/client/ui/BUILD.gn
+++ b/remoting/client/ui/BUILD.gn
@@ -16,7 +16,7 @@
 
   public_deps = [
     "//remoting/proto",
-    "//third_party/webrtc/rtc_base:rtc_base_approved",
+    "//third_party/webrtc_overrides:webrtc_component",
   ]
 
   if (!is_chromeos) {
@@ -36,7 +36,7 @@
 
   public_deps = [
     "//remoting/proto",
-    "//third_party/webrtc/rtc_base:rtc_base_approved",
+    "//third_party/webrtc_overrides:webrtc_component",
   ]
 }
 
diff --git a/remoting/codec/BUILD.gn b/remoting/codec/BUILD.gn
index 15c181d..486ed1f 100644
--- a/remoting/codec/BUILD.gn
+++ b/remoting/codec/BUILD.gn
@@ -34,7 +34,7 @@
     "//third_party/libvpx",
     "//third_party/libyuv",
     "//third_party/opus",
-    "//third_party/webrtc/modules/desktop_capture:primitives",
+    "//third_party/webrtc_overrides:webrtc_component",
     "//ui/gfx:color_space",
     "//ui/gfx/geometry",
   ]
@@ -42,9 +42,7 @@
   # Currently, building WebrtcVideoEncoderGpu is only supported on Windows and
   # Linux, and encoding with WebrtcVideoEncoderGpu is only supported on Windows.
   if (is_win || is_linux) {
-    public_configs = [
-      "//skia:skia_config",
-    ]
+    public_configs = [ "//skia:skia_config" ]
     sources += [
       "webrtc_video_encoder_gpu.cc",
       "webrtc_video_encoder_gpu.h",
@@ -95,7 +93,7 @@
     "//third_party/libvpx",
     "//third_party/libyuv",
     "//third_party/opus",
-    "//third_party/webrtc/modules/desktop_capture:primitives",
+    "//third_party/webrtc_overrides:webrtc_component",
   ]
 }
 
@@ -115,7 +113,7 @@
     "//base/third_party/dynamic_annotations",
     "//remoting/proto",
     "//third_party/libyuv",
-    "//third_party/webrtc/modules/desktop_capture:primitives",
+    "//third_party/webrtc_overrides:webrtc_component",
   ]
 }
 
@@ -141,7 +139,7 @@
     "//base",
     "//remoting/proto",
     "//testing/gtest",
-    "//third_party/webrtc/modules/desktop_capture",
+    "//third_party/webrtc_overrides:webrtc_component",
     "//ui/gfx:color_space",
   ]
 
diff --git a/remoting/host/BUILD.gn b/remoting/host/BUILD.gn
index f1b2b3c..94303f2 100644
--- a/remoting/host/BUILD.gn
+++ b/remoting/host/BUILD.gn
@@ -335,7 +335,7 @@
     "//remoting/protocol",
     "//remoting/resources",
     "//services/network:network_service",
-    "//third_party/webrtc/modules/desktop_capture",
+    "//third_party/webrtc_overrides:webrtc_component",
 
     # //remoting uses the power_save_blocker directly. See crbug.com/689423
     "//services/device/wake_lock/power_save_blocker",
@@ -470,8 +470,7 @@
     "//remoting/host/file_transfer:test_support",
     "//third_party/libjingle_xmpp",
     "//third_party/protobuf:protobuf_lite",
-    "//third_party/webrtc/modules/desktop_capture",
-    "//third_party/webrtc_overrides:init_webrtc",
+    "//third_party/webrtc_overrides:webrtc_component",
   ]
 }
 
@@ -609,7 +608,7 @@
 
     deps = [
       "//third_party/libjingle_xmpp",
-      "//third_party/webrtc_overrides:init_webrtc",
+      "//third_party/webrtc_overrides:webrtc_component",
     ]
 
     configs += [ "//build/config/compiler:wexit_time_destructors" ]
@@ -743,9 +742,7 @@
       "//remoting/host",
       "//remoting/proto",
       "//third_party/libjingle_xmpp",
-      "//third_party/webrtc/api:scoped_refptr",
-      "//third_party/webrtc/modules/desktop_capture",
-      "//third_party/webrtc_overrides:init_webrtc",
+      "//third_party/webrtc_overrides:webrtc_component",
     ]
 
     if (is_posix) {
diff --git a/remoting/host/chromeos/BUILD.gn b/remoting/host/chromeos/BUILD.gn
index d6ae15d..c6924ba 100644
--- a/remoting/host/chromeos/BUILD.gn
+++ b/remoting/host/chromeos/BUILD.gn
@@ -27,7 +27,7 @@
     "//ppapi/host",
     "//remoting/protocol",
     "//skia",
-    "//third_party/webrtc/modules/desktop_capture",
+    "//third_party/webrtc_overrides:webrtc_component",
     "//ui/aura",
     "//ui/compositor",
     "//ui/events",
diff --git a/remoting/host/input_monitor/BUILD.gn b/remoting/host/input_monitor/BUILD.gn
index 3e3a99e..14d12cd 100644
--- a/remoting/host/input_monitor/BUILD.gn
+++ b/remoting/host/input_monitor/BUILD.gn
@@ -32,7 +32,7 @@
 
   deps = [
     "//remoting/proto",
-    "//third_party/webrtc/modules/desktop_capture",
+    "//third_party/webrtc_overrides:webrtc_component",
   ]
 
   if (use_ozone) {
diff --git a/remoting/host/it2me/BUILD.gn b/remoting/host/it2me/BUILD.gn
index 7e56459..fe34583f 100644
--- a/remoting/host/it2me/BUILD.gn
+++ b/remoting/host/it2me/BUILD.gn
@@ -220,7 +220,7 @@
         "//remoting/host",
         "//remoting/host/native_messaging",
         "//remoting/proto",
-        "//third_party/webrtc_overrides:init_webrtc",
+        "//third_party/webrtc_overrides:webrtc_component",
         "//ui/gfx",
       ]
       if (is_mac) {
diff --git a/remoting/host/linux/BUILD.gn b/remoting/host/linux/BUILD.gn
index bbfd2825..88803413 100644
--- a/remoting/host/linux/BUILD.gn
+++ b/remoting/host/linux/BUILD.gn
@@ -94,7 +94,7 @@
 
   deps = [
     "//remoting/protocol",
-    "//third_party/webrtc/modules/desktop_capture",
+    "//third_party/webrtc_overrides:webrtc_component",
   ]
   public_deps = []
 
@@ -121,7 +121,7 @@
       "x_server_clipboard.h",
     ]
     deps = [
-      "//third_party/webrtc/modules/desktop_capture",
+      "//third_party/webrtc_overrides:webrtc_component",
     ]
   }
 }
diff --git a/remoting/host/security_key/BUILD.gn b/remoting/host/security_key/BUILD.gn
index d698d75..1a56b42 100644
--- a/remoting/host/security_key/BUILD.gn
+++ b/remoting/host/security_key/BUILD.gn
@@ -39,7 +39,7 @@
     "//mojo/public/cpp/platform",
     "//mojo/public/cpp/system",
     "//remoting/proto",
-    "//third_party/webrtc/modules/desktop_capture",
+    "//third_party/webrtc_overrides:webrtc_component",
   ]
 
   if (is_posix) {
@@ -133,6 +133,6 @@
   public_deps = [
     "//testing/gmock",
     "//third_party/protobuf:protobuf_lite",
-    "//third_party/webrtc/modules/desktop_capture",
+    "//third_party/webrtc_overrides:webrtc_component",
   ]
 }
diff --git a/remoting/host/win/BUILD.gn b/remoting/host/win/BUILD.gn
index 2c91a54..35ab40e 100644
--- a/remoting/host/win/BUILD.gn
+++ b/remoting/host/win/BUILD.gn
@@ -136,7 +136,7 @@
     "//remoting/protocol",
     "//remoting/resources",
     "//services/device/wake_lock/power_save_blocker",
-    "//third_party/webrtc/modules/desktop_capture",
+    "//third_party/webrtc_overrides:webrtc_component",
     "//ui/base",
     "//ui/events:dom_keycode_converter",
     "//ui/events/platform",
@@ -420,7 +420,7 @@
     "//remoting/protocol",
     "//sandbox/win:sandbox",  # Should always use Windows version
     "//services/network/public/mojom",
-    "//third_party/webrtc/modules/desktop_capture",
+    "//third_party/webrtc_overrides:webrtc_component",
   ]
 
   ldflags = [
diff --git a/remoting/ios/BUILD.gn b/remoting/ios/BUILD.gn
index 0d8fc28..2dceb62 100644
--- a/remoting/ios/BUILD.gn
+++ b/remoting/ios/BUILD.gn
@@ -34,8 +34,7 @@
     "//remoting/ios/domain",
     "//remoting/ios/facade",
     "//remoting/ios/session",
-    "//third_party/webrtc/modules/desktop_capture:primitives",
-    "//third_party/webrtc/rtc_base:rtc_base",
+    "//third_party/webrtc_overrides:webrtc_component",
   ]
 
   deps = [
diff --git a/remoting/ios/display/BUILD.gn b/remoting/ios/display/BUILD.gn
index 183669b8..9180fd9 100644
--- a/remoting/ios/display/BUILD.gn
+++ b/remoting/ios/display/BUILD.gn
@@ -29,7 +29,7 @@
   public_deps = [
     "//remoting/client",
     "//third_party/protobuf:protobuf_lite",
-    "//third_party/webrtc/rtc_base:rtc_base_approved",
+    "//third_party/webrtc_overrides:webrtc_component",
   ]
 
   deps = [
diff --git a/remoting/protocol/BUILD.gn b/remoting/protocol/BUILD.gn
index b3ccc9d..9e98975 100644
--- a/remoting/protocol/BUILD.gn
+++ b/remoting/protocol/BUILD.gn
@@ -189,7 +189,7 @@
 
   public_deps = [
     "//remoting/proto",
-    "//third_party/webrtc_overrides",
+    "//third_party/webrtc_overrides:webrtc_component",
   ]
   deps = [
     "//base",
@@ -258,16 +258,7 @@
 
     deps += [
       "//remoting/proto/remoting/v1:network_traversal_grpc_library",
-      "//third_party/webrtc/api:callfactory_api",
-      "//third_party/webrtc/api:packet_socket_factory",
-      "//third_party/webrtc/api/audio_codecs:audio_codecs_api",
-      "//third_party/webrtc/api/audio_codecs/opus:audio_decoder_opus",
-      "//third_party/webrtc/api/audio_codecs/opus:audio_encoder_opus",
-      "//third_party/webrtc/api/rtc_event_log:rtc_event_log_factory",
-      "//third_party/webrtc/api/video_codecs:builtin_video_decoder_factory",
-      "//third_party/webrtc/media:rtc_audio_video",
-      "//third_party/webrtc_overrides:init_webrtc",
-      "//third_party/webrtc_overrides:task_queue_factory",
+      "//third_party/webrtc_overrides:webrtc_component",
     ]
   }
 
diff --git a/remoting/signaling/BUILD.gn b/remoting/signaling/BUILD.gn
index 2e0d4e0..a7746537 100644
--- a/remoting/signaling/BUILD.gn
+++ b/remoting/signaling/BUILD.gn
@@ -55,7 +55,7 @@
     "//remoting/proto/ftl/v1:ftl_grpc_library",
     "//remoting/proto/remoting/v1:telemetry_grpc_library",
     "//third_party/libjingle_xmpp",
-    "//third_party/webrtc_overrides",
+    "//third_party/webrtc_overrides:webrtc_component",
   ]
 
   deps = [
diff --git a/remoting/test/BUILD.gn b/remoting/test/BUILD.gn
index ce64ae84..4854bcd 100644
--- a/remoting/test/BUILD.gn
+++ b/remoting/test/BUILD.gn
@@ -79,7 +79,7 @@
     "//remoting/protocol",
     "//remoting/signaling",
     "//services/network:test_support",
-    "//third_party/webrtc/modules/desktop_capture",
+    "//third_party/webrtc_overrides:webrtc_component",
     "//ui/gfx",
   ]
 
@@ -92,8 +92,7 @@
     "//skia",
     "//testing/gmock",
     "//testing/gtest",
-    "//third_party/webrtc/api:packet_socket_factory",
-    "//third_party/webrtc_overrides",
+    "//third_party/webrtc_overrides:webrtc_component",
   ]
 }
 
@@ -161,7 +160,7 @@
     deps = [
       ":fake_connection_event_logger",
       "//base/test:test_support",
-      "//third_party/webrtc/modules/desktop_capture",
+      "//third_party/webrtc_overrides:webrtc_component",
     ]
 
     public_deps = [
@@ -263,6 +262,6 @@
     "//testing/gmock",
     "//testing/gtest",
     "//third_party/libyuv",
-    "//third_party/webrtc/modules/desktop_capture",
+    "//third_party/webrtc_overrides:webrtc_component",
   ]
 }
diff --git a/services/audio/public/cpp/audio_processing.typemap b/services/audio/public/cpp/audio_processing.typemap
index ceed704..e4ca658c5 100644
--- a/services/audio/public/cpp/audio_processing.typemap
+++ b/services/audio/public/cpp/audio_processing.typemap
@@ -14,7 +14,7 @@
   "//services/audio/public/cpp/audio_processing_mojom_traits.h",
 ]
 public_deps = [
-  "//third_party/webrtc/api:libjingle_peerconnection_api",
+  "//third_party/webrtc_overrides:webrtc_component",
 ]
 type_mappings = [
   "audio.mojom.AudioProcessingSettings=::media::AudioProcessingSettings",
diff --git a/services/network/BUILD.gn b/services/network/BUILD.gn
index 70af8f6..fb1028b 100644
--- a/services/network/BUILD.gn
+++ b/services/network/BUILD.gn
@@ -237,11 +237,7 @@
     "//services/service_manager/public/cpp",
     "//services/service_manager/public/mojom",
     "//services/service_manager/sandbox:sandbox",
-    "//third_party/webrtc/media:rtc_media_base",
-    "//third_party/webrtc/rtc_base",
-    "//third_party/webrtc/rtc_base:timeutils",
-    "//third_party/webrtc_overrides",
-    "//third_party/webrtc_overrides:init_webrtc",
+    "//third_party/webrtc_overrides:webrtc_component",
     "//url",
   ]
 
diff --git a/services/network/public/cpp/BUILD.gn b/services/network/public/cpp/BUILD.gn
index f782138..ff23e71f 100644
--- a/services/network/public/cpp/BUILD.gn
+++ b/services/network/public/cpp/BUILD.gn
@@ -165,7 +165,6 @@
   public_deps = [
     "//services/network/public/mojom:data_pipe_interfaces",
     "//services/network/public/mojom:mutable_network_traffic_annotation_interface",
-    "//third_party/webrtc/rtc_base",
     "//url/ipc:url_ipc",
     "//url/mojom:url_mojom_gurl",
     "//url/mojom:url_mojom_origin",
@@ -176,8 +175,7 @@
     "//mojo/public/mojom/base",
     "//net",
     "//services/network/public/mojom:mojom_shared",
-    "//third_party/webrtc_overrides",
-    "//third_party/webrtc_overrides:init_webrtc",
+    "//third_party/webrtc_overrides:webrtc_component",
   ]
   defines = [ "IS_NETWORK_CPP_BASE_IMPL" ]
 }
diff --git a/services/network/public/cpp/p2p.typemap b/services/network/public/cpp/p2p.typemap
index 757bdea..600b50c 100644
--- a/services/network/public/cpp/p2p.typemap
+++ b/services/network/public/cpp/p2p.typemap
@@ -10,7 +10,7 @@
 
 public_deps = [
   "//services/network/public/mojom:mutable_network_traffic_annotation_interface",
-  "//third_party/webrtc/rtc_base",
+  "//third_party/webrtc_overrides:webrtc_component",
 ]
 
 type_mappings = [
diff --git a/third_party/abseil-cpp/absl/types/BUILD.gn b/third_party/abseil-cpp/absl/types/BUILD.gn
index 4e3eeb8b..f948fa6 100644
--- a/third_party/abseil-cpp/absl/types/BUILD.gn
+++ b/third_party/abseil-cpp/absl/types/BUILD.gn
@@ -13,7 +13,11 @@
 # https://docs.google.com/document/d/1DgS1-A3rzboTLjpf4m1sqkJgWjnY_Ru2dokk1X1vBDU
 if (build_with_chromium) {
   visibility = absl_visibility
-  visibility += [ "//third_party/openscreen/*" ]
+  visibility += [
+    "//third_party/blink/renderer/platform:platform",
+    "//third_party/blink/renderer/modules/peerconnection:peerconnection",
+    "//third_party/openscreen/*",
+  ]
 } else {
   visibility = [ "*" ]
 }
diff --git a/third_party/blink/public/BUILD.gn b/third_party/blink/public/BUILD.gn
index 48820a1..a9efc3e7 100644
--- a/third_party/blink/public/BUILD.gn
+++ b/third_party/blink/public/BUILD.gn
@@ -495,28 +495,7 @@
     "//services/network/public/cpp:cpp",
     "//services/network/public/mojom",
     "//third_party/blink/renderer/platform/wtf:wtf",
-    "//third_party/webrtc/api:libjingle_peerconnection_api",
-    "//third_party/webrtc/api:media_stream_interface",
-    "//third_party/webrtc/api:rtc_error",
-    "//third_party/webrtc/api:rtc_stats_api",
-    "//third_party/webrtc/api:rtp_parameters",
-    "//third_party/webrtc/api:scoped_refptr",
-    "//third_party/webrtc/api/audio_codecs:audio_codecs_api",
-    "//third_party/webrtc/api/video:video_frame",
-    "//third_party/webrtc/api/video:video_rtp_headers",
-    "//third_party/webrtc/api/video_codecs:video_codecs_api",
-    "//third_party/webrtc/media:rtc_media_base",
-    "//third_party/webrtc/modules/audio_device:audio_device_api",
-    "//third_party/webrtc/modules/audio_processing:api",
-    "//third_party/webrtc/modules/video_coding:video_codec_interface",
-    "//third_party/webrtc/p2p:libstunprober",
-    "//third_party/webrtc/pc:peerconnection",
-    "//third_party/webrtc/rtc_base:rtc_base",
-    "//third_party/webrtc/rtc_base:rtc_task_queue",
-
-    # TODO(titovartem) remove dependency on WebRTC internals.
-    "//third_party/webrtc/rtc_base/third_party/sigslot:sigslot",
-    "//third_party/webrtc_overrides:init_webrtc",
+    "//third_party/webrtc_overrides:webrtc_component",
     "//ui/base:base",
     "//v8:v8_headers",
   ]
diff --git a/third_party/blink/renderer/modules/BUILD.gn b/third_party/blink/renderer/modules/BUILD.gn
index 27248d7c..9d0be98 100644
--- a/third_party/blink/renderer/modules/BUILD.gn
+++ b/third_party/blink/renderer/modules/BUILD.gn
@@ -165,14 +165,7 @@
     "//third_party/blink/renderer/bindings/modules/v8:bindings_modules_origin_trial_features",
     "//third_party/blink/renderer/core",
     "//third_party/icu",
-    "//third_party/webrtc/api/audio:aec3_config_json",
-    "//third_party/webrtc/api/rtc_event_log:rtc_event_log_factory",
-    "//third_party/webrtc/media:rtc_internal_video_codecs",
-    "//third_party/webrtc/modules/video_coding:webrtc_h264",
-    "//third_party/webrtc/pc:libjingle_peerconnection",
-    "//third_party/webrtc/rtc_base:rtc_base",
-    "//third_party/webrtc_overrides:init_webrtc",
-    "//third_party/webrtc_overrides:task_queue_factory",
+    "//third_party/webrtc_overrides:webrtc_component",
     "//third_party/zlib",
   ]
 
@@ -469,9 +462,7 @@
     "//third_party/blink/renderer/platform",
     "//third_party/blink/renderer/platform/wtf",
     "//third_party/opus",
-    "//third_party/webrtc/api:rtc_error",
-    "//third_party/webrtc/rtc_base:rtc_base",
-    "//third_party/webrtc/stats:rtc_stats_test_utils",
+    "//third_party/webrtc_overrides:webrtc_component",
     "//v8",
   ]
 
diff --git a/third_party/blink/renderer/modules/mediastream/BUILD.gn b/third_party/blink/renderer/modules/mediastream/BUILD.gn
index 0a3e741..7607eb4 100644
--- a/third_party/blink/renderer/modules/mediastream/BUILD.gn
+++ b/third_party/blink/renderer/modules/mediastream/BUILD.gn
@@ -122,9 +122,6 @@
     "//testing/gmock",
     "//third_party/blink/public:test_headers",
     "//third_party/blink/public/mojom:mojom_platform_blink_headers",
-    "//third_party/webrtc/api:libjingle_peerconnection_api",
-    "//third_party/webrtc/api:media_stream_interface",
-    "//third_party/webrtc/api:rtc_stats_api",
-    "//third_party/webrtc_overrides:init_webrtc",
+    "//third_party/webrtc_overrides:webrtc_component",
   ]
 }
diff --git a/third_party/blink/renderer/modules/peerconnection/BUILD.gn b/third_party/blink/renderer/modules/peerconnection/BUILD.gn
index a4c1e32..a4d9a07 100644
--- a/third_party/blink/renderer/modules/peerconnection/BUILD.gn
+++ b/third_party/blink/renderer/modules/peerconnection/BUILD.gn
@@ -151,9 +151,10 @@
   ]
 
   public_deps = [
-    "//third_party/webrtc/api:ice_transport_factory",
-    "//third_party/webrtc/api:rtc_error",
-    "//third_party/webrtc/api:scoped_refptr",
+    "//third_party/webrtc_overrides:webrtc_component",
+  ]
+  deps = [
+    "//third_party/abseil-cpp/absl/types:optional",
   ]
 }
 
@@ -182,6 +183,6 @@
     "//base/test:test_support",
     "//testing/gmock",
     "//third_party/blink/public:test_headers",
-    "//third_party/webrtc_overrides:init_webrtc",
+    "//third_party/webrtc_overrides:webrtc_component",
   ]
 }
diff --git a/third_party/blink/renderer/platform/BUILD.gn b/third_party/blink/renderer/platform/BUILD.gn
index f25b577..37132272 100644
--- a/third_party/blink/renderer/platform/BUILD.gn
+++ b/third_party/blink/renderer/platform/BUILD.gn
@@ -1498,30 +1498,14 @@
     "//services/viz/public/cpp/gpu",
     "//skia:skcms",
     "//third_party:freetype_harfbuzz",
+    "//third_party/abseil-cpp/absl/types:optional",
     "//third_party/blink/public/common",
     "//third_party/blink/public/mojom:embedded_frame_sink_mojo_bindings_blink",
     "//third_party/ced",
     "//third_party/emoji-segmenter",
     "//third_party/icu",
     "//third_party/libyuv",
-    "//third_party/webrtc/api:libjingle_logging_api",
-    "//third_party/webrtc/api:packet_socket_factory",
-    "//third_party/webrtc/api/audio_codecs/L16:audio_decoder_L16",
-    "//third_party/webrtc/api/audio_codecs/L16:audio_encoder_L16",
-    "//third_party/webrtc/api/audio_codecs/g711:audio_decoder_g711",
-    "//third_party/webrtc/api/audio_codecs/g711:audio_encoder_g711",
-    "//third_party/webrtc/api/audio_codecs/g722:audio_decoder_g722",
-    "//third_party/webrtc/api/audio_codecs/g722:audio_encoder_g722",
-    "//third_party/webrtc/api/audio_codecs/isac:audio_decoder_isac",
-    "//third_party/webrtc/api/audio_codecs/isac:audio_encoder_isac",
-    "//third_party/webrtc/api/audio_codecs/opus:audio_decoder_multiopus",
-    "//third_party/webrtc/api/audio_codecs/opus:audio_decoder_opus",
-    "//third_party/webrtc/api/audio_codecs/opus:audio_encoder_multiopus",
-    "//third_party/webrtc/api/audio_codecs/opus:audio_encoder_opus",
-    "//third_party/webrtc/media:rtc_internal_video_codecs",
-    "//third_party/webrtc/modules/video_coding:webrtc_h264",
-    "//third_party/webrtc/p2p:rtc_p2p",
-    "//third_party/webrtc_overrides:init_webrtc",
+    "//third_party/webrtc_overrides:webrtc_component",
     "//third_party/zlib/google:compression_utils",
     "//ui/base:base",
     "//ui/gfx",
@@ -1946,9 +1930,9 @@
     "//third_party/blink/renderer/platform/network:unit_tests",
     "//third_party/blink/renderer/platform/scheduler:unit_tests",
     "//third_party/blink/renderer/platform/wtf",
+    "//third_party/libyuv",
     "//third_party/webrtc/api/task_queue:task_queue_test",
-    "//third_party/webrtc/stats:rtc_stats_test_utils",
-    "//third_party/webrtc_overrides:task_queue_factory",
+    "//third_party/webrtc_overrides:webrtc_component",
     "//ui/gfx",
     "//ui/gfx/geometry",
     "//ui/gfx/geometry/mojom:test_interfaces_blink",
diff --git a/third_party/blink/renderer/platform/peerconnection/webrtc_video_track_source.cc b/third_party/blink/renderer/platform/peerconnection/webrtc_video_track_source.cc
index 80db35dd..a6ca4aa1 100644
--- a/third_party/blink/renderer/platform/peerconnection/webrtc_video_track_source.cc
+++ b/third_party/blink/renderer/platform/peerconnection/webrtc_video_track_source.cc
@@ -7,6 +7,7 @@
 #include "base/bind.h"
 #include "base/bind_helpers.h"
 #include "base/trace_event/trace_event.h"
+#include "third_party/abseil-cpp/absl/types/optional.h"
 #include "third_party/blink/renderer/platform/webrtc/webrtc_video_frame_adapter.h"
 #include "third_party/libyuv/include/libyuv/scale.h"
 #include "third_party/webrtc/rtc_base/ref_counted_object.h"
diff --git a/third_party/libjingle_xmpp/BUILD.gn b/third_party/libjingle_xmpp/BUILD.gn
index 3364a1a3..5c8e824 100644
--- a/third_party/libjingle_xmpp/BUILD.gn
+++ b/third_party/libjingle_xmpp/BUILD.gn
@@ -28,7 +28,7 @@
   ]
   deps = [
     "//base",
-    "//third_party/webrtc/rtc_base/third_party/sigslot",
+    "//third_party/webrtc_overrides:webrtc_component",
   ]
 }
 
@@ -97,8 +97,7 @@
     ":rtc_xmllite",
     "//base",
     "//net",
-    "//third_party/webrtc/rtc_base/third_party/base64",
-    "//third_party/webrtc/rtc_base/third_party/sigslot",
+    "//third_party/webrtc_overrides:webrtc_component",
   ]
   public_deps = [
     ":rtc_task_runner",
@@ -127,7 +126,7 @@
     "//base/test:run_all_unittests",
     "//base/test:test_support",
     "//testing/gtest",
-    "//third_party/webrtc/rtc_base:rtc_base",
+    "//third_party/webrtc_overrides:webrtc_component",
   ]
 
   sources = [
diff --git a/third_party/webrtc_overrides/BUILD.gn b/third_party/webrtc_overrides/BUILD.gn
index 87f318c..c22bef3 100644
--- a/third_party/webrtc_overrides/BUILD.gn
+++ b/third_party/webrtc_overrides/BUILD.gn
@@ -4,19 +4,91 @@
 
 import("//build/config/chromecast_build.gni")
 
-group("webrtc_overrides") {
-  public_deps = [
-    ":webrtc",
-  ]
-}
-
 component("webrtc_component") {
   public_deps = [
+    ":init_webrtc",
+    ":task_queue_factory",
+    ":webrtc",
+    "//third_party/webrtc/api:callfactory_api",
+    "//third_party/webrtc/api:ice_transport_factory",
+    "//third_party/webrtc/api:libjingle_logging_api",
     "//third_party/webrtc/api:libjingle_peerconnection_api",
+    "//third_party/webrtc/api:media_stream_interface",
+    "//third_party/webrtc/api:packet_socket_factory",
+    "//third_party/webrtc/api:rtc_error",
+    "//third_party/webrtc/api:rtc_stats_api",
+    "//third_party/webrtc/api:rtp_parameters",
+    "//third_party/webrtc/api:scoped_refptr",
+    "//third_party/webrtc/api/audio:aec3_config",
+    "//third_party/webrtc/api/audio:aec3_config_json",
+    "//third_party/webrtc/api/audio:aec3_factory",
+    "//third_party/webrtc/api/audio_codecs:audio_codecs_api",
+    "//third_party/webrtc/api/audio_codecs/L16:audio_decoder_L16",
+    "//third_party/webrtc/api/audio_codecs/L16:audio_encoder_L16",
+    "//third_party/webrtc/api/audio_codecs/g711:audio_decoder_g711",
+    "//third_party/webrtc/api/audio_codecs/g711:audio_encoder_g711",
+    "//third_party/webrtc/api/audio_codecs/g722:audio_decoder_g722",
+    "//third_party/webrtc/api/audio_codecs/g722:audio_encoder_g722",
+    "//third_party/webrtc/api/audio_codecs/isac:audio_decoder_isac",
+    "//third_party/webrtc/api/audio_codecs/isac:audio_encoder_isac",
+    "//third_party/webrtc/api/audio_codecs/opus:audio_decoder_multiopus",
+    "//third_party/webrtc/api/audio_codecs/opus:audio_decoder_opus",
+    "//third_party/webrtc/api/audio_codecs/opus:audio_encoder_multiopus",
+    "//third_party/webrtc/api/audio_codecs/opus:audio_encoder_opus",
+    "//third_party/webrtc/api/rtc_event_log:rtc_event_log_factory",
+    "//third_party/webrtc/api/video:video_bitrate_allocation",
+    "//third_party/webrtc/api/video:video_frame",
+    "//third_party/webrtc/api/video:video_frame_i420",
+    "//third_party/webrtc/api/video:video_rtp_headers",
+    "//third_party/webrtc/api/video_codecs:builtin_video_decoder_factory",
+    "//third_party/webrtc/api/video_codecs:rtc_software_fallback_wrappers",
+    "//third_party/webrtc/api/video_codecs:video_codecs_api",
+    "//third_party/webrtc/common_video",
+    "//third_party/webrtc/common_video:common_video",
+    "//third_party/webrtc/media:rtc_audio_video",
+    "//third_party/webrtc/media:rtc_internal_video_codecs",
+    "//third_party/webrtc/media:rtc_media",
+    "//third_party/webrtc/media:rtc_media_base",
+    "//third_party/webrtc/media:rtc_simulcast_encoder_adapter",
+    "//third_party/webrtc/media:rtc_vp9_profile",
+    "//third_party/webrtc/modules/audio_device",
+    "//third_party/webrtc/modules/audio_device:audio_device_api",
+    "//third_party/webrtc/modules/audio_processing",
+    "//third_party/webrtc/modules/audio_processing:api",
+    "//third_party/webrtc/modules/audio_processing:audio_processing_statistics",
+    "//third_party/webrtc/modules/audio_processing/aec_dump",
+    "//third_party/webrtc/modules/audio_processing/aec_dump:aec_dump",
+    "//third_party/webrtc/modules/desktop_capture",
+    "//third_party/webrtc/modules/desktop_capture:primitives",
+    "//third_party/webrtc/modules/video_coding:video_codec_interface",
+    "//third_party/webrtc/modules/video_coding:webrtc_h264",
+    "//third_party/webrtc/p2p:libstunprober",
+    "//third_party/webrtc/p2p:rtc_p2p",
+    "//third_party/webrtc/pc:libjingle_peerconnection",
+    "//third_party/webrtc/pc:peerconnection",
+    "//third_party/webrtc/pc:rtc_pc",
+    "//third_party/webrtc/pc:rtc_pc_base",
+    "//third_party/webrtc/rtc_base",
+    "//third_party/webrtc/rtc_base:async_resolver_interface",
+    "//third_party/webrtc/rtc_base:ip_address",
+    "//third_party/webrtc/rtc_base:rtc_base",
+    "//third_party/webrtc/rtc_base:rtc_base_approved",
+    "//third_party/webrtc/rtc_base:rtc_task_queue",
+    "//third_party/webrtc/rtc_base:socket_address",
+    "//third_party/webrtc/rtc_base:threading",
+    "//third_party/webrtc/rtc_base:timeutils",
+    "//third_party/webrtc/rtc_base/third_party/base64",
+    "//third_party/webrtc/rtc_base/third_party/sigslot",
+    "//third_party/webrtc/rtc_base/third_party/sigslot:sigslot",
+    "//third_party/webrtc/stats",
+    "//third_party/webrtc/stats:rtc_stats",
+    "//third_party/webrtc/stats:rtc_stats_test_utils",
+    "//third_party/webrtc/system_wrappers",
   ]
 }
 
 source_set("webrtc") {
+  visibility = [ ":*" ]
   public_deps = [
     # TODO(kjellander): Start cleaning up this target as soon as
     # https://codereview.chromium.org/2022833002/ is landed. The target should
@@ -47,11 +119,15 @@
 }
 
 source_set("init_webrtc") {
+  visibility = [ ":*" ]
   sources = [
     "init_webrtc.cc",
     "init_webrtc.h",
   ]
-  configs += [ "//third_party/webrtc:common_config" ]
+  configs += [
+    "//third_party/webrtc:common_config",
+    "//third_party/webrtc:library_impl_config",
+  ]
   public_configs = [
     "//third_party/webrtc:common_inherited_config",
 
@@ -69,11 +145,14 @@
     ":metrics",
     "//base",
     "//third_party/webrtc/rtc_base",
+    "//third_party/webrtc/rtc_base/system:rtc_export",
     "//third_party/webrtc/system_wrappers",
   ]
 }
 
 source_set("metrics") {
+  # TODO(mbonadei): Migrate WebRTC deps to webrtc_component and uncomment.
+  # visibility = [ ":*" ]
   sources = [
     "metrics.cc",
   ]
@@ -83,6 +162,8 @@
 }
 
 source_set("field_trial") {
+  # TODO(mbonadei): Migrate WebRTC deps to webrtc_component and uncomment.
+  # visibility = [ ":*" ]
   sources = [
     "field_trial.cc",
   ]
@@ -92,6 +173,7 @@
 }
 
 source_set("libjingle_webrtc_common") {
+  visibility = [ ":*" ]
   configs += [ "//third_party/webrtc:common_config" ]
   public_configs = [ "//third_party/webrtc:common_inherited_config" ]
 
@@ -106,12 +188,15 @@
 }
 
 source_set("task_queue_factory") {
+  visibility = [ ":*" ]
   sources = [
     "task_queue_factory.cc",
     "task_queue_factory.h",
   ]
+  configs += [ "//third_party/webrtc:library_impl_config" ]
   deps = [
     "//base",
     "//third_party/webrtc/api/task_queue",
+    "//third_party/webrtc/rtc_base/system:rtc_export",
   ]
 }
diff --git a/third_party/webrtc_overrides/init_webrtc.h b/third_party/webrtc_overrides/init_webrtc.h
index f5e6efb..a10848e 100644
--- a/third_party/webrtc_overrides/init_webrtc.h
+++ b/third_party/webrtc_overrides/init_webrtc.h
@@ -5,9 +5,11 @@
 #ifndef THIRD_PARTY_WEBRTC_OVERRIDES_INIT_WEBRTC_H_
 #define THIRD_PARTY_WEBRTC_OVERRIDES_INIT_WEBRTC_H_
 
+#include "third_party/webrtc/rtc_base/system/rtc_export.h"
+
 // Initialize WebRTC. Call this explicitly to initialize WebRTC module
 // (before initializing the sandbox in Chrome) and hook up Chrome+WebRTC
 // integration such as common logging and tracing.
-bool InitializeWebRtcModule();
+RTC_EXPORT bool InitializeWebRtcModule();
 
 #endif // THIRD_PARTY_WEBRTC_OVERRIDES_INIT_WEBRTC_H_
diff --git a/third_party/webrtc_overrides/rtc_base/diagnostic_logging.h b/third_party/webrtc_overrides/rtc_base/diagnostic_logging.h
index e8d31254..7643f52e 100644
--- a/third_party/webrtc_overrides/rtc_base/diagnostic_logging.h
+++ b/third_party/webrtc_overrides/rtc_base/diagnostic_logging.h
@@ -10,6 +10,7 @@
 
 #include "third_party/webrtc/api/scoped_refptr.h"
 #include "third_party/webrtc/rtc_base/checks.h"
+#include "third_party/webrtc/rtc_base/system/rtc_export.h"
 
 namespace rtc {
 
@@ -60,7 +61,7 @@
 
 // Class that writes a log message to the logging delegate ("WebRTC logging
 // stream" in Chrome) and to Chrome's logging stream.
-class DiagnosticLogMessage {
+class RTC_EXPORT DiagnosticLogMessage {
  public:
   DiagnosticLogMessage(const char* file,
                        int line,
@@ -114,7 +115,7 @@
 // TODO(grunell): Change name to InitDiagnosticLoggingDelegate or
 // InitDiagnosticLogging. Change also in init_webrtc.h/cc.
 // TODO(grunell): typedef the delegate function.
-void InitDiagnosticLoggingDelegateFunction(
+RTC_EXPORT void InitDiagnosticLoggingDelegateFunction(
     void (*delegate)(const std::string&));
 
 void SetExtraLoggingInit(
diff --git a/third_party/webrtc_overrides/rtc_base/event.h b/third_party/webrtc_overrides/rtc_base/event.h
index 47a34cd..78a76e8 100644
--- a/third_party/webrtc_overrides/rtc_base/event.h
+++ b/third_party/webrtc_overrides/rtc_base/event.h
@@ -8,11 +8,12 @@
 #include "base/macros.h"
 #include "base/synchronization/waitable_event.h"
 #include "base/threading/thread_restrictions.h"
+#include "third_party/webrtc/rtc_base/system/rtc_export.h"
 
 namespace rtc {
 
 // Overrides WebRTC's internal event implementation to use Chromium's.
-class Event {
+class RTC_EXPORT Event {
  public:
   static const int kForever = -1;
 
diff --git a/third_party/webrtc_overrides/task_queue_factory.h b/third_party/webrtc_overrides/task_queue_factory.h
index 811c15a..957cf75e 100644
--- a/third_party/webrtc_overrides/task_queue_factory.h
+++ b/third_party/webrtc_overrides/task_queue_factory.h
@@ -10,13 +10,15 @@
 #include "base/task/task_traits.h"
 #include "third_party/webrtc/api/task_queue/task_queue_base.h"
 #include "third_party/webrtc/api/task_queue/task_queue_factory.h"
+#include "third_party/webrtc/rtc_base/system/rtc_export.h"
 
 // Creates factory for webrtc::TaskQueueBase backed by base::SequencedTaskRunner
 // Tested by
 // /third_party/blink/renderer/platform/peerconnection/task_queue_factory_test.cc
-std::unique_ptr<webrtc::TaskQueueFactory> CreateWebRtcTaskQueueFactory();
+RTC_EXPORT std::unique_ptr<webrtc::TaskQueueFactory>
+CreateWebRtcTaskQueueFactory();
 
-std::unique_ptr<webrtc::TaskQueueBase, webrtc::TaskQueueDeleter>
+RTC_EXPORT std::unique_ptr<webrtc::TaskQueueBase, webrtc::TaskQueueDeleter>
 CreateWebRtcTaskQueue(webrtc::TaskQueueFactory::Priority priority);
 
 #endif  // THIRD_PARTY_WEBRTC_OVERRIDES_TASK_QUEUE_FACTORY_H_
diff --git a/tools/ipc_fuzzer/message_lib/BUILD.gn b/tools/ipc_fuzzer/message_lib/BUILD.gn
index bc433cb..7c42fcc2 100644
--- a/tools/ipc_fuzzer/message_lib/BUILD.gn
+++ b/tools/ipc_fuzzer/message_lib/BUILD.gn
@@ -28,7 +28,7 @@
     "//skia",
     "//third_party/blink/public:blink",
     "//third_party/blink/public:blink_headers",
-    "//third_party/webrtc_overrides",
+    "//third_party/webrtc_overrides:webrtc_component",
     "//ui/accessibility:ax_enums_mojo",
   ]
   if (is_win) {