APM move: Implementing the APM for use in the audio service

I've placed it in media/webrtc as that made the most sense. I considered
making it its own taget (i.e. //media/webrtc:audio_processor) but it was
a bit cumbersome and other parts of media don't seem to do that.

This change includes moving some flags from content:: to media:: since
they need to be accessible by both audio processor implementations.

The new AudioProcessor code is similar to MediaStreamAudioProcessor, but
I've tried to simplify it as much as possible. It seems like the decisions
made for the old implementation were made under different circumstances
than we have now. The old implementation will run whenever the "APM in
Audio Service" feature isn't active. This'll ensure we're not changing
any behavior outside of the experiment.

The AudioProcessor is protected by a build flag to make sure it isn't built
on platforms where we don't have a sandboxed audio service.

For an outline of the project this CL is part of, see: https://docs.google.com/document/d/1u4POff_ts_1LE3WDLA_wDDFnUswdlsuHL5DsiTE0a3U/edit?usp=sharing
It's accessible to everyone @chromium.org.

Bug: 851959
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: Iec4cd2dd983b484921d5d0701d4a08bca21793b4
Reviewed-on: https://chromium-review.googlesource.com/1169463
Commit-Queue: Max Morin <[email protected]>
Reviewed-by: Dale Curtis <[email protected]>
Reviewed-by: John Abd-El-Malek <[email protected]>
Cr-Commit-Position: refs/heads/master@{#587050}
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn
index bcf11a72..935d1008 100644
--- a/content/browser/BUILD.gn
+++ b/content/browser/BUILD.gn
@@ -109,6 +109,7 @@
     "//media/mojo/interfaces",
     "//media/mojo/interfaces:constants",
     "//media/mojo/services",
+    "//media/webrtc",
     "//mojo/core/embedder",
     "//mojo/public/cpp/bindings",
     "//mojo/public/cpp/platform",
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index 765b657..125c8cf 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -188,6 +188,7 @@
 #include "media/base/media_switches.h"
 #include "media/media_buildflags.h"
 #include "media/mojo/services/video_decode_perf_history.h"
+#include "media/webrtc/webrtc_switches.h"
 #include "mojo/public/cpp/bindings/associated_interface_ptr.h"
 #include "mojo/public/cpp/bindings/strong_binding.h"
 #include "mojo/public/cpp/system/platform_handle.h"
diff --git a/content/browser/utility_process_host.cc b/content/browser/utility_process_host.cc
index 9d7c979..042eccd 100644
--- a/content/browser/utility_process_host.cc
+++ b/content/browser/utility_process_host.cc
@@ -30,6 +30,7 @@
 #include "content/public/common/service_manager_connection.h"
 #include "content/public/common/service_names.mojom.h"
 #include "media/base/media_switches.h"
+#include "media/webrtc/webrtc_switches.h"
 #include "services/network/public/cpp/network_switches.h"
 #include "services/service_manager/embedder/switches.h"
 #include "services/service_manager/public/cpp/interface_provider.h"
@@ -313,6 +314,8 @@
       switches::kFailAudioStreamCreation,
       switches::kMuteAudio,
       switches::kUseFileForFakeAudioCapture,
+      switches::kAecRefinedAdaptiveFilter,
+      switches::kAgcStartupMinVolume,
 #if defined(OS_LINUX) || defined(OS_FREEBSD) || defined(OS_SOLARIS)
       switches::kAlsaInputDevice,
       switches::kAlsaOutputDevice,