Extract rtc_base/base64.h and rtc_base/base64.cc into separate target.

Extract rtc_base/base64.h and rtc_base/base64.cc into separate target
to prepare to move them into third_party

Bug: webrtc:8366
Change-Id: I477e6da2b9d09307439b3272261f31042f479d74
Reviewed-on: https://webrtc-review.googlesource.com/83980
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23645}
diff --git a/media/BUILD.gn b/media/BUILD.gn
index 0a62d4f..562d29b 100644
--- a/media/BUILD.gn
+++ b/media/BUILD.gn
@@ -227,6 +227,7 @@
     "../modules/video_coding:video_codec_interface",
     "../modules/video_coding:video_coding",
     "../rtc_base:audio_format_to_string",
+    "../rtc_base:base64",
     "../rtc_base:checks",
   ]
 
diff --git a/modules/desktop_capture/BUILD.gn b/modules/desktop_capture/BUILD.gn
index 54b1103..ad26eb3 100644
--- a/modules/desktop_capture/BUILD.gn
+++ b/modules/desktop_capture/BUILD.gn
@@ -51,6 +51,7 @@
         ":desktop_capture_mock",
         ":primitives",
         ":screen_drawer",
+        "../../rtc_base:base64",
         "../../rtc_base:rtc_base",
         "../../rtc_base:rtc_base_approved",
         "../../system_wrappers",
diff --git a/modules/video_coding/BUILD.gn b/modules/video_coding/BUILD.gn
index 90ab60a..ad2a034 100644
--- a/modules/video_coding/BUILD.gn
+++ b/modules/video_coding/BUILD.gn
@@ -170,6 +170,7 @@
     "../../api/video:video_frame_i420",
     "../../api/video_codecs:video_codecs_api",
     "../../common_video",
+    "../../rtc_base:base64",
     "../../rtc_base:checks",
     "../../rtc_base:rtc_base",
     "../../rtc_base:rtc_base_approved",
diff --git a/p2p/BUILD.gn b/p2p/BUILD.gn
index 55e96ca..473281a 100644
--- a/p2p/BUILD.gn
+++ b/p2p/BUILD.gn
@@ -85,6 +85,7 @@
     "../api:libjingle_peerconnection_api",
     "../api:ortc_api",
     "../logging:ice_log",
+    "../rtc_base:base64",
     "../rtc_base:checks",
     "../rtc_base:rtc_base",
     "../rtc_base:safe_minmax",
diff --git a/pc/BUILD.gn b/pc/BUILD.gn
index 61aa750..704b459 100644
--- a/pc/BUILD.gn
+++ b/pc/BUILD.gn
@@ -80,6 +80,7 @@
     "../media:rtc_media_base",
     "../modules/rtp_rtcp:rtp_rtcp_format",
     "../p2p:rtc_p2p",
+    "../rtc_base:base64",
     "../rtc_base:checks",
     "../rtc_base:rtc_base",
     "../rtc_base:rtc_task_queue",
@@ -205,6 +206,7 @@
     "../media:rtc_media_base",
     "../modules/congestion_controller/bbr",
     "../p2p:rtc_p2p",
+    "../rtc_base:base64",
     "../rtc_base:checks",
     "../rtc_base:rtc_base",
     "../rtc_base:rtc_base_approved",
@@ -488,6 +490,7 @@
       "../api:mock_rtp",
       "../api/units:time_delta",
       "../logging:fake_rtc_event_log",
+      "../rtc_base:base64",
       "../rtc_base:checks",
       "../rtc_base:stringutils",
       "../test:fileutils",
diff --git a/rtc_base/BUILD.gn b/rtc_base/BUILD.gn
index 79db4f4..bcca552 100644
--- a/rtc_base/BUILD.gn
+++ b/rtc_base/BUILD.gn
@@ -368,6 +368,7 @@
   data_deps = []
   deps = [
     ":atomicops",
+    ":base64",
     ":checks",
     ":criticalsection",
     ":logging",
@@ -389,8 +390,6 @@
   ]
 
   sources = [
-    "base64.cc",
-    "base64.h",
     "bind.h",
     "bitbuffer.cc",
     "bitbuffer.h",
@@ -490,6 +489,18 @@
   }
 }
 
+rtc_source_set("base64") {
+  visibility = [ "*" ]
+  sources = [
+    "base64.cc",
+    "base64.h",
+  ]
+
+  deps = [
+    ":checks",
+  ]
+}
+
 rtc_source_set("rtc_task_queue") {
   visibility = [ "*" ]
   deps = []
@@ -712,6 +723,7 @@
   libs = []
   defines = []
   deps = [
+    ":base64",
     ":checks",
     ":stringutils",
     "..:webrtc_common",
@@ -1152,6 +1164,7 @@
       sources += [ "win/windows_version_unittest.cc" ]
     }
     deps = [
+      ":base64",
       ":checks",
       ":rate_limiter",
       ":rtc_base",