Moves contents of bitrate_controller to goog_cc

This CL moves send_side_bandwidth_estimation.cc/h and
loss_based_bandwidth_estimation.cc/h from modules/bitrate_controller
to modules/congestion_controller/goog_cc.

Bug: webrtc:9883
Change-Id: Ibb2c2ba3762007e7e5114f39042ee96431b73776
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/154346
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29297}
diff --git a/audio/BUILD.gn b/audio/BUILD.gn
index a4bc14d..b24584c 100644
--- a/audio/BUILD.gn
+++ b/audio/BUILD.gn
@@ -70,7 +70,6 @@
     "../modules/audio_device",
     "../modules/audio_processing",
     "../modules/audio_processing:api",
-    "../modules/bitrate_controller",
     "../modules/pacing",
     "../modules/remote_bitrate_estimator",
     "../modules/rtp_rtcp",
diff --git a/modules/BUILD.gn b/modules/BUILD.gn
index 36bbe7d..b4794e3 100644
--- a/modules/BUILD.gn
+++ b/modules/BUILD.gn
@@ -15,7 +15,6 @@
     "audio_device",
     "audio_mixer",
     "audio_processing",
-    "bitrate_controller",
     "congestion_controller",
     "pacing",
     "remote_bitrate_estimator",
@@ -236,7 +235,6 @@
       "audio_mixer:audio_mixer_unittests",
       "audio_processing:audio_processing_unittests",
       "audio_processing/aec3:aec3_unittests",
-      "bitrate_controller:bitrate_controller_unittests",
       "congestion_controller:congestion_controller_unittests",
       "pacing:pacing_unittests",
       "remote_bitrate_estimator:remote_bitrate_estimator_unittests",
diff --git a/modules/bitrate_controller/BUILD.gn b/modules/bitrate_controller/BUILD.gn
deleted file mode 100644
index 52dee8a..0000000
--- a/modules/bitrate_controller/BUILD.gn
+++ /dev/null
@@ -1,58 +0,0 @@
-# Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
-#
-# Use of this source code is governed by a BSD-style license
-# that can be found in the LICENSE file in the root of the source
-# tree. An additional intellectual property rights grant can be found
-# in the file PATENTS.  All contributing project authors may
-# be found in the AUTHORS file in the root of the source tree.
-
-import("../../webrtc.gni")
-
-rtc_static_library("bitrate_controller") {
-  visibility = [ "*" ]
-  sources = [
-    "loss_based_bandwidth_estimation.cc",
-    "loss_based_bandwidth_estimation.h",
-    "send_side_bandwidth_estimation.cc",
-    "send_side_bandwidth_estimation.h",
-  ]
-
-  if (rtc_enable_bwe_test_logging) {
-    defines = [ "BWE_TEST_LOGGING_COMPILE_TIME_ENABLE=1" ]
-  } else {
-    defines = [ "BWE_TEST_LOGGING_COMPILE_TIME_ENABLE=0" ]
-  }
-
-  deps = [
-    "../../api/rtc_event_log",
-    "../../api/transport:network_control",
-    "../../api/units:data_rate",
-    "../../api/units:time_delta",
-    "../../api/units:timestamp",
-    "../../logging:rtc_event_bwe",
-    "../../rtc_base:checks",
-    "../../rtc_base:logging",
-    "../../rtc_base/experiments:field_trial_parser",
-    "../../system_wrappers:field_trial",
-    "../../system_wrappers:metrics",
-    "../remote_bitrate_estimator",
-    "//third_party/abseil-cpp/absl/types:optional",
-  ]
-}
-
-if (rtc_include_tests) {
-  rtc_source_set("bitrate_controller_unittests") {
-    testonly = true
-
-    sources = [
-      "send_side_bandwidth_estimation_unittest.cc",
-    ]
-    deps = [
-      ":bitrate_controller",
-      "../../api/rtc_event_log",
-      "../../logging:mocks",
-      "../../logging:rtc_event_bwe",
-      "../../test:test_support",
-    ]
-  }
-}
diff --git a/modules/bitrate_controller/DEPS b/modules/bitrate_controller/DEPS
deleted file mode 100644
index 01a45e7..0000000
--- a/modules/bitrate_controller/DEPS
+++ /dev/null
@@ -1,5 +0,0 @@
-include_rules = [
-  "+call",
-  "+logging/rtc_event_log",
-  "+system_wrappers",
-]
diff --git a/modules/bitrate_controller/OWNERS b/modules/bitrate_controller/OWNERS
deleted file mode 100644
index 2cb4bb2..0000000
--- a/modules/bitrate_controller/OWNERS
+++ /dev/null
@@ -1,9 +0,0 @@
-stefan@webrtc.org
-terelius@webrtc.org
-mflodman@webrtc.org
-srte@webrtc.org
-
-# These are for the common case of adding or renaming files. If you're doing
-# structural changes, please get a review from a reviewer in this file.
-per-file *.gn=*
-per-file *.gni=*
diff --git a/modules/congestion_controller/goog_cc/BUILD.gn b/modules/congestion_controller/goog_cc/BUILD.gn
index c3f7d8c..5782ea2 100644
--- a/modules/congestion_controller/goog_cc/BUILD.gn
+++ b/modules/congestion_controller/goog_cc/BUILD.gn
@@ -27,6 +27,7 @@
     ":alr_detector",
     ":delay_based_bwe",
     ":estimators",
+    ":loss_based_controller",
     ":probe_controller",
     ":pushback_controller",
     "../..:module_api",
@@ -48,7 +49,6 @@
     "../../../rtc_base/experiments:field_trial_parser",
     "../../../rtc_base/experiments:rate_control_settings",
     "../../../system_wrappers",
-    "../../bitrate_controller",
     "../../remote_bitrate_estimator",
     "//third_party/abseil-cpp/absl/types:optional",
   ]
@@ -136,6 +136,31 @@
   ]
 }
 
+rtc_static_library("loss_based_controller") {
+  configs += [ ":bwe_test_logging" ]
+  sources = [
+    "loss_based_bandwidth_estimation.cc",
+    "loss_based_bandwidth_estimation.h",
+    "send_side_bandwidth_estimation.cc",
+    "send_side_bandwidth_estimation.h",
+  ]
+  deps = [
+    "../../../api/rtc_event_log",
+    "../../../api/transport:network_control",
+    "../../../api/units:data_rate",
+    "../../../api/units:time_delta",
+    "../../../api/units:timestamp",
+    "../../../logging:rtc_event_bwe",
+    "../../../rtc_base:checks",
+    "../../../rtc_base:logging",
+    "../../../rtc_base/experiments:field_trial_parser",
+    "../../../system_wrappers:field_trial",
+    "../../../system_wrappers:metrics",
+    "../../remote_bitrate_estimator",
+    "//third_party/abseil-cpp/absl/types:optional",
+  ]
+}
+
 rtc_source_set("delay_based_bwe") {
   configs += [ ":bwe_test_logging" ]
   sources = [
@@ -223,6 +248,7 @@
       "median_slope_estimator_unittest.cc",
       "probe_bitrate_estimator_unittest.cc",
       "probe_controller_unittest.cc",
+      "send_side_bandwidth_estimation_unittest.cc",
       "trendline_estimator_unittest.cc",
     ]
     deps = [
@@ -230,8 +256,10 @@
       ":delay_based_bwe",
       ":estimators",
       ":goog_cc",
+      ":loss_based_controller",
       ":probe_controller",
       ":pushback_controller",
+      "../../../api/rtc_event_log",
       "../../../api/transport:field_trial_based_config",
       "../../../api/transport:goog_cc",
       "../../../api/transport:network_control",
@@ -239,6 +267,7 @@
       "../../../api/units:data_rate",
       "../../../api/units:timestamp",
       "../../../logging:mocks",
+      "../../../logging:rtc_event_bwe",
       "../../../rtc_base:checks",
       "../../../rtc_base:rtc_base_approved",
       "../../../rtc_base:rtc_base_tests_utils",
diff --git a/modules/congestion_controller/goog_cc/goog_cc_network_control.h b/modules/congestion_controller/goog_cc/goog_cc_network_control.h
index e7e60fc..d78ca17 100644
--- a/modules/congestion_controller/goog_cc/goog_cc_network_control.h
+++ b/modules/congestion_controller/goog_cc/goog_cc_network_control.h
@@ -27,12 +27,12 @@
 #include "api/units/data_rate.h"
 #include "api/units/data_size.h"
 #include "api/units/timestamp.h"
-#include "modules/bitrate_controller/send_side_bandwidth_estimation.h"
 #include "modules/congestion_controller/goog_cc/acknowledged_bitrate_estimator.h"
 #include "modules/congestion_controller/goog_cc/alr_detector.h"
 #include "modules/congestion_controller/goog_cc/congestion_window_pushback_controller.h"
 #include "modules/congestion_controller/goog_cc/delay_based_bwe.h"
 #include "modules/congestion_controller/goog_cc/probe_controller.h"
+#include "modules/congestion_controller/goog_cc/send_side_bandwidth_estimation.h"
 #include "rtc_base/constructor_magic.h"
 #include "rtc_base/experiments/field_trial_parser.h"
 #include "rtc_base/experiments/rate_control_settings.h"
diff --git a/modules/bitrate_controller/loss_based_bandwidth_estimation.cc b/modules/congestion_controller/goog_cc/loss_based_bandwidth_estimation.cc
similarity index 98%
rename from modules/bitrate_controller/loss_based_bandwidth_estimation.cc
rename to modules/congestion_controller/goog_cc/loss_based_bandwidth_estimation.cc
index 64c0482..c39ae21 100644
--- a/modules/bitrate_controller/loss_based_bandwidth_estimation.cc
+++ b/modules/congestion_controller/goog_cc/loss_based_bandwidth_estimation.cc
@@ -8,7 +8,7 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
-#include "modules/bitrate_controller/loss_based_bandwidth_estimation.h"
+#include "modules/congestion_controller/goog_cc/loss_based_bandwidth_estimation.h"
 
 #include <algorithm>
 #include <string>
diff --git a/modules/bitrate_controller/loss_based_bandwidth_estimation.h b/modules/congestion_controller/goog_cc/loss_based_bandwidth_estimation.h
similarity index 91%
rename from modules/bitrate_controller/loss_based_bandwidth_estimation.h
rename to modules/congestion_controller/goog_cc/loss_based_bandwidth_estimation.h
index e00726b..b63363c 100644
--- a/modules/bitrate_controller/loss_based_bandwidth_estimation.h
+++ b/modules/congestion_controller/goog_cc/loss_based_bandwidth_estimation.h
@@ -8,8 +8,8 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
-#ifndef MODULES_BITRATE_CONTROLLER_LOSS_BASED_BANDWIDTH_ESTIMATION_H_
-#define MODULES_BITRATE_CONTROLLER_LOSS_BASED_BANDWIDTH_ESTIMATION_H_
+#ifndef MODULES_CONGESTION_CONTROLLER_GOOG_CC_LOSS_BASED_BANDWIDTH_ESTIMATION_H_
+#define MODULES_CONGESTION_CONTROLLER_GOOG_CC_LOSS_BASED_BANDWIDTH_ESTIMATION_H_
 
 #include <vector>
 
@@ -80,4 +80,4 @@
 
 }  // namespace webrtc
 
-#endif  // MODULES_BITRATE_CONTROLLER_LOSS_BASED_BANDWIDTH_ESTIMATION_H_
+#endif  // MODULES_CONGESTION_CONTROLLER_GOOG_CC_LOSS_BASED_BANDWIDTH_ESTIMATION_H_
diff --git a/modules/bitrate_controller/send_side_bandwidth_estimation.cc b/modules/congestion_controller/goog_cc/send_side_bandwidth_estimation.cc
similarity index 99%
rename from modules/bitrate_controller/send_side_bandwidth_estimation.cc
rename to modules/congestion_controller/goog_cc/send_side_bandwidth_estimation.cc
index 808d6f0..a310bc0 100644
--- a/modules/bitrate_controller/send_side_bandwidth_estimation.cc
+++ b/modules/congestion_controller/goog_cc/send_side_bandwidth_estimation.cc
@@ -8,7 +8,7 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
-#include "modules/bitrate_controller/send_side_bandwidth_estimation.h"
+#include "modules/congestion_controller/goog_cc/send_side_bandwidth_estimation.h"
 
 #include <algorithm>
 #include <cstdio>
diff --git a/modules/bitrate_controller/send_side_bandwidth_estimation.h b/modules/congestion_controller/goog_cc/send_side_bandwidth_estimation.h
similarity index 94%
rename from modules/bitrate_controller/send_side_bandwidth_estimation.h
rename to modules/congestion_controller/goog_cc/send_side_bandwidth_estimation.h
index f0d5ecd..6ae7df9 100644
--- a/modules/bitrate_controller/send_side_bandwidth_estimation.h
+++ b/modules/congestion_controller/goog_cc/send_side_bandwidth_estimation.h
@@ -10,8 +10,8 @@
  *  FEC and NACK added bitrate is handled outside class
  */
 
-#ifndef MODULES_BITRATE_CONTROLLER_SEND_SIDE_BANDWIDTH_ESTIMATION_H_
-#define MODULES_BITRATE_CONTROLLER_SEND_SIDE_BANDWIDTH_ESTIMATION_H_
+#ifndef MODULES_CONGESTION_CONTROLLER_GOOG_CC_SEND_SIDE_BANDWIDTH_ESTIMATION_H_
+#define MODULES_CONGESTION_CONTROLLER_GOOG_CC_SEND_SIDE_BANDWIDTH_ESTIMATION_H_
 
 #include <stdint.h>
 
@@ -24,7 +24,7 @@
 #include "api/units/data_rate.h"
 #include "api/units/time_delta.h"
 #include "api/units/timestamp.h"
-#include "modules/bitrate_controller/loss_based_bandwidth_estimation.h"
+#include "modules/congestion_controller/goog_cc/loss_based_bandwidth_estimation.h"
 #include "rtc_base/experiments/field_trial_parser.h"
 
 namespace webrtc {
@@ -168,4 +168,4 @@
   LossBasedBandwidthEstimation loss_based_bandwidth_estimation_;
 };
 }  // namespace webrtc
-#endif  // MODULES_BITRATE_CONTROLLER_SEND_SIDE_BANDWIDTH_ESTIMATION_H_
+#endif  // MODULES_CONGESTION_CONTROLLER_GOOG_CC_SEND_SIDE_BANDWIDTH_ESTIMATION_H_
diff --git a/modules/bitrate_controller/send_side_bandwidth_estimation_unittest.cc b/modules/congestion_controller/goog_cc/send_side_bandwidth_estimation_unittest.cc
similarity index 98%
rename from modules/bitrate_controller/send_side_bandwidth_estimation_unittest.cc
rename to modules/congestion_controller/goog_cc/send_side_bandwidth_estimation_unittest.cc
index 62de886..5c8366e 100644
--- a/modules/bitrate_controller/send_side_bandwidth_estimation_unittest.cc
+++ b/modules/congestion_controller/goog_cc/send_side_bandwidth_estimation_unittest.cc
@@ -8,7 +8,7 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
-#include "modules/bitrate_controller/send_side_bandwidth_estimation.h"
+#include "modules/congestion_controller/goog_cc/send_side_bandwidth_estimation.h"
 
 #include "api/rtc_event_log/rtc_event.h"
 #include "logging/rtc_event_log/events/rtc_event_bwe_update_loss_based.h"
diff --git a/video/BUILD.gn b/video/BUILD.gn
index b84d559..dfb1e5a 100644
--- a/video/BUILD.gn
+++ b/video/BUILD.gn
@@ -83,7 +83,6 @@
     "../media:rtc_h264_profile_id",
     "../modules:module_api",
     "../modules:module_api_public",
-    "../modules/bitrate_controller",
     "../modules/pacing",
     "../modules/remote_bitrate_estimator",
     "../modules/rtp_rtcp",