Enable clang::find_bad_constructs for remote_bitrate_estimator.

This CL removes //build/config/clang:find_bad_constructs from the
suppressed_configs list, which means that clang:find_bad_constructs
is now enabled on these translation units.

Bug: webrtc:9251, webrtc:163
Change-Id: Id377fcd78166e53aad7c663c3ffec5e57fdb1274
Reviewed-on: https://webrtc-review.googlesource.com/89383
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24049}
diff --git a/modules/bitrate_controller/BUILD.gn b/modules/bitrate_controller/BUILD.gn
index f9c7156..f9960cf 100644
--- a/modules/bitrate_controller/BUILD.gn
+++ b/modules/bitrate_controller/BUILD.gn
@@ -11,6 +11,7 @@
 rtc_static_library("bitrate_controller") {
   visibility = [ "*" ]
   sources = [
+    "bitrate_controller.cc",
     "bitrate_controller_impl.cc",
     "bitrate_controller_impl.h",
     "include/bitrate_controller.h",
diff --git a/modules/bitrate_controller/bitrate_controller.cc b/modules/bitrate_controller/bitrate_controller.cc
new file mode 100644
index 0000000..46e908b
--- /dev/null
+++ b/modules/bitrate_controller/bitrate_controller.cc
@@ -0,0 +1,23 @@
+/*
+ *  Copyright (c) 2018 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.
+ *
+ *  Usage: this class will register multiple RtcpBitrateObserver's one at each
+ *  RTCP module. It will aggregate the results and run one bandwidth estimation
+ *  and push the result to the encoders via BitrateObserver(s).
+ */
+
+#include "modules/bitrate_controller/include/bitrate_controller.h"
+
+namespace webrtc {
+
+size_t BitrateObserver::pacer_queue_size_in_bytes() {
+  return 0;
+}
+
+}  // namespace webrtc
diff --git a/modules/bitrate_controller/include/bitrate_controller.h b/modules/bitrate_controller/include/bitrate_controller.h
index 0ab9913..6e692d2 100644
--- a/modules/bitrate_controller/include/bitrate_controller.h
+++ b/modules/bitrate_controller/include/bitrate_controller.h
@@ -45,7 +45,7 @@
                                 int64_t target_set_time,
                                 uint64_t congestion_window) {}
   virtual void OnBytesAcked(size_t bytes) {}
-  virtual size_t pacer_queue_size_in_bytes() { return 0; }
+  virtual size_t pacer_queue_size_in_bytes();
   virtual ~BitrateObserver() {}
 };
 
@@ -67,7 +67,7 @@
   static BitrateController* CreateBitrateController(const Clock* clock,
                                                     RtcEventLog* event_log);
 
-  virtual ~BitrateController() {}
+  ~BitrateController() override {}
 
   // Deprecated, use raw pointer to BitrateController instance instead.
   // Creates RtcpBandwidthObserver caller responsible to delete.
diff --git a/modules/remote_bitrate_estimator/BUILD.gn b/modules/remote_bitrate_estimator/BUILD.gn
index 828a992..abdd035 100644
--- a/modules/remote_bitrate_estimator/BUILD.gn
+++ b/modules/remote_bitrate_estimator/BUILD.gn
@@ -38,11 +38,6 @@
     defines = [ "BWE_TEST_LOGGING_COMPILE_TIME_ENABLE=0" ]
   }
 
-  if (!build_with_chromium && is_clang) {
-    # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
-    suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
-  }
-
   deps = [
     "../..:webrtc_common",
     "../../:typedefs",
@@ -71,10 +66,6 @@
       "../../test:rtp_test_utils",
       "../rtp_rtcp",
     ]
-    if (is_clang) {
-      # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
-      suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
-    }
   }
 }
 
@@ -101,6 +92,7 @@
       "test/estimators/congestion_window.h",
       "test/estimators/max_bandwidth_filter.cc",
       "test/estimators/max_bandwidth_filter.h",
+      "test/estimators/min_rtt_filter.cc",
       "test/estimators/min_rtt_filter.h",
       "test/estimators/nada.cc",
       "test/estimators/nada.h",
@@ -112,6 +104,7 @@
       "test/estimators/tcp.h",
       "test/metric_recorder.cc",
       "test/metric_recorder.h",
+      "test/packet.cc",
       "test/packet.h",
       "test/packet_receiver.cc",
       "test/packet_receiver.h",
@@ -125,11 +118,6 @@
       defines = [ "BWE_TEST_LOGGING_COMPILE_TIME_ENABLE=0" ]
     }
 
-    if (!build_with_chromium && is_clang) {
-      # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
-      suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
-    }
-
     deps = [
       ":remote_bitrate_estimator",
       "..:module_api",
diff --git a/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.cc b/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.cc
index 375028b..39406d1 100644
--- a/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.cc
+++ b/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.cc
@@ -58,6 +58,9 @@
   return time_24_bits;
 }
 
+RemoteBitrateEstimatorAbsSendTime::~RemoteBitrateEstimatorAbsSendTime() =
+    default;
+
 bool RemoteBitrateEstimatorAbsSendTime::IsWithinClusterBounds(
     int send_delta_ms,
     const Cluster& cluster_aggregate) {
diff --git a/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.h b/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.h
index 9bf8d9a..8e5aacb 100644
--- a/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.h
+++ b/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.h
@@ -69,7 +69,7 @@
  public:
   RemoteBitrateEstimatorAbsSendTime(RemoteBitrateObserver* observer,
                                     const Clock* clock);
-  virtual ~RemoteBitrateEstimatorAbsSendTime() {}
+  ~RemoteBitrateEstimatorAbsSendTime() override;
 
   void IncomingPacket(int64_t arrival_time_ms,
                       size_t payload_size,
diff --git a/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.h b/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.h
index fd4ff32..18b435a 100644
--- a/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.h
+++ b/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.h
@@ -27,7 +27,7 @@
  public:
   RemoteBitrateEstimatorSingleStream(RemoteBitrateObserver* observer,
                                      const Clock* clock);
-  virtual ~RemoteBitrateEstimatorSingleStream();
+  ~RemoteBitrateEstimatorSingleStream() override;
 
   void IncomingPacket(int64_t arrival_time_ms,
                       size_t payload_size,
diff --git a/modules/remote_bitrate_estimator/remote_estimator_proxy.h b/modules/remote_bitrate_estimator/remote_estimator_proxy.h
index 985ddd3..63994c4 100644
--- a/modules/remote_bitrate_estimator/remote_estimator_proxy.h
+++ b/modules/remote_bitrate_estimator/remote_estimator_proxy.h
@@ -34,7 +34,7 @@
  public:
   RemoteEstimatorProxy(const Clock* clock,
                        TransportFeedbackSenderInterface* feedback_sender);
-  virtual ~RemoteEstimatorProxy();
+  ~RemoteEstimatorProxy() override;
 
   void IncomingPacket(int64_t arrival_time_ms,
                       size_t payload_size,
diff --git a/modules/remote_bitrate_estimator/test/bwe.cc b/modules/remote_bitrate_estimator/test/bwe.cc
index 536743f..6120c0f 100644
--- a/modules/remote_bitrate_estimator/test/bwe.cc
+++ b/modules/remote_bitrate_estimator/test/bwe.cc
@@ -56,10 +56,14 @@
                             static_cast<uint32_t>(media_packet.payload_size()));
 }
 
+FeedbackPacket* BweReceiver::GetFeedback(int64_t now_ms) {
+  return nullptr;
+}
+
 class NullBweSender : public BweSender {
  public:
   NullBweSender() {}
-  virtual ~NullBweSender() {}
+  ~NullBweSender() override {}
 
   int GetFeedbackIntervalMs() const override { return 1000; }
   void GiveFeedback(const FeedbackPacket& feedback) override {}
@@ -215,6 +219,8 @@
   return static_cast<float>(gap - number_packets_received) / gap;
 }
 
+LinkedSet::LinkedSet(int capacity) : capacity_(capacity) {}
+
 LinkedSet::~LinkedSet() {
   while (!empty())
     RemoveTail();
diff --git a/modules/remote_bitrate_estimator/test/bwe.h b/modules/remote_bitrate_estimator/test/bwe.h
index 9cc5063..42682ae 100644
--- a/modules/remote_bitrate_estimator/test/bwe.h
+++ b/modules/remote_bitrate_estimator/test/bwe.h
@@ -71,7 +71,7 @@
 // Allows efficient insertion, deletion and search.
 class LinkedSet {
  public:
-  explicit LinkedSet(int capacity) : capacity_(capacity) {}
+  explicit LinkedSet(int capacity);
   ~LinkedSet();
 
   // If the arriving packet (identified by its sequence number) is already
@@ -116,7 +116,7 @@
  public:
   BweSender() {}
   explicit BweSender(int bitrate_kbps) : bitrate_kbps_(bitrate_kbps) {}
-  virtual ~BweSender() {}
+  ~BweSender() override {}
 
   virtual int GetFeedbackIntervalMs() const = 0;
   virtual void GiveFeedback(const FeedbackPacket& feedback) = 0;
@@ -138,7 +138,7 @@
 
   virtual void ReceivePacket(int64_t arrival_time_ms,
                              const MediaPacket& media_packet);
-  virtual FeedbackPacket* GetFeedback(int64_t now_ms) { return NULL; }
+  virtual FeedbackPacket* GetFeedback(int64_t now_ms);
 
   size_t GetSetCapacity() { return received_packets_.capacity(); }
   double BitrateWindowS() const { return rate_counter_.BitrateWindowS(); }
diff --git a/modules/remote_bitrate_estimator/test/bwe_test.cc b/modules/remote_bitrate_estimator/test/bwe_test.cc
index 737847c..817a515 100644
--- a/modules/remote_bitrate_estimator/test/bwe_test.cc
+++ b/modules/remote_bitrate_estimator/test/bwe_test.cc
@@ -36,6 +36,9 @@
 PacketProcessorRunner::PacketProcessorRunner(PacketProcessor* processor)
     : processor_(processor) {}
 
+PacketProcessorRunner::PacketProcessorRunner(
+    const PacketProcessorRunner& runner) = default;
+
 PacketProcessorRunner::~PacketProcessorRunner() {
   for (Packet* packet : queue_)
     delete packet;
@@ -121,6 +124,9 @@
   BWE_TEST_LOGGING_GLOBAL_ENABLE(false);
 }
 
+Link::Link() = default;
+Link::~Link() = default;
+
 void Link::AddPacketProcessor(PacketProcessor* processor,
                               ProcessorType processor_type) {
   assert(processor);
diff --git a/modules/remote_bitrate_estimator/test/bwe_test.h b/modules/remote_bitrate_estimator/test/bwe_test.h
index 24d5f10..34030e9 100644
--- a/modules/remote_bitrate_estimator/test/bwe_test.h
+++ b/modules/remote_bitrate_estimator/test/bwe_test.h
@@ -33,6 +33,7 @@
 class PacketProcessorRunner {
  public:
   explicit PacketProcessorRunner(PacketProcessor* processor);
+  PacketProcessorRunner(const PacketProcessorRunner&);
   ~PacketProcessorRunner();
 
   bool RunsProcessor(const PacketProcessor* processor) const;
@@ -48,11 +49,12 @@
 
 class Link : public PacketProcessorListener {
  public:
-  virtual ~Link() {}
+  Link();
+  ~Link() override;
 
-  virtual void AddPacketProcessor(PacketProcessor* processor,
-                                  ProcessorType type);
-  virtual void RemovePacketProcessor(PacketProcessor* processor);
+  void AddPacketProcessor(PacketProcessor* processor,
+                          ProcessorType type) override;
+  void RemovePacketProcessor(PacketProcessor* processor) override;
 
   void Run(int64_t run_for_ms, int64_t now_ms, Packets* packets);
 
diff --git a/modules/remote_bitrate_estimator/test/bwe_test_baselinefile.cc b/modules/remote_bitrate_estimator/test/bwe_test_baselinefile.cc
index d273e21..9f2bc5a 100644
--- a/modules/remote_bitrate_estimator/test/bwe_test_baselinefile.cc
+++ b/modules/remote_bitrate_estimator/test/bwe_test_baselinefile.cc
@@ -61,9 +61,9 @@
       }
     }
   }
-  virtual ~BaseLineFileVerify() {}
+  ~BaseLineFileVerify() override {}
 
-  virtual void Estimate(int64_t time_ms, uint32_t estimate_bps) {
+  void Estimate(int64_t time_ms, uint32_t estimate_bps) override {
     if (reader_.get()) {
       uint32_t read_ms = 0;
       uint32_t read_bps = 0;
@@ -77,7 +77,7 @@
     }
   }
 
-  virtual bool VerifyOrWrite() {
+  bool VerifyOrWrite() override {
     if (reader_.get()) {
       if (reader_->IsAtEnd()) {
         return true;
@@ -104,15 +104,15 @@
     output_content_.push_back(kMagicMarker);
     output_content_.push_back(kFileVersion1);
   }
-  virtual ~BaseLineFileUpdate() {}
+  ~BaseLineFileUpdate() override {}
 
-  virtual void Estimate(int64_t time_ms, uint32_t estimate_bps) {
+  void Estimate(int64_t time_ms, uint32_t estimate_bps) override {
     verifier_->Estimate(time_ms, estimate_bps);
     output_content_.push_back(static_cast<uint32_t>(time_ms));
     output_content_.push_back(estimate_bps);
   }
 
-  virtual bool VerifyOrWrite() {
+  bool VerifyOrWrite() override {
     if (!verifier_->VerifyOrWrite()) {
       std::string dir_path = webrtc::test::OutputPath() + kResourceSubDir;
       if (!webrtc::test::CreateDir(dir_path)) {
diff --git a/modules/remote_bitrate_estimator/test/bwe_test_framework.cc b/modules/remote_bitrate_estimator/test/bwe_test_framework.cc
index 8b36cd7..ec9a58f 100644
--- a/modules/remote_bitrate_estimator/test/bwe_test_framework.cc
+++ b/modules/remote_bitrate_estimator/test/bwe_test_framework.cc
@@ -21,6 +21,17 @@
 namespace testing {
 namespace bwe {
 
+RateCounter::RateCounter(int64_t window_size_ms)
+    : window_size_us_(1000 * window_size_ms),
+      recently_received_packets_(0),
+      recently_received_bytes_(0),
+      last_accumulated_us_(0),
+      window_() {}
+
+RateCounter::RateCounter() : RateCounter(1000) {}
+
+RateCounter::~RateCounter() = default;
+
 class DelayCapHelper {
  public:
   // Max delay = 0 stands for +infinite.
@@ -93,31 +104,6 @@
   return static_cast<double>(window_size_us_) / (1000 * 1000);
 }
 
-Packet::Packet()
-    : flow_id_(0),
-      creation_time_us_(-1),
-      send_time_us_(-1),
-      sender_timestamp_us_(-1),
-      payload_size_(0) {}
-
-Packet::Packet(int flow_id, int64_t send_time_us, size_t payload_size)
-    : flow_id_(flow_id),
-      creation_time_us_(send_time_us),
-      send_time_us_(send_time_us),
-      sender_timestamp_us_(send_time_us),
-      payload_size_(payload_size) {}
-
-Packet::~Packet() {}
-
-bool Packet::operator<(const Packet& rhs) const {
-  return send_time_us_ < rhs.send_time_us_;
-}
-
-void Packet::set_send_time_us(int64_t send_time_us) {
-  assert(send_time_us >= 0);
-  send_time_us_ = send_time_us;
-}
-
 MediaPacket::MediaPacket() {
   memset(&header_, 0, sizeof(header_));
 }
@@ -685,6 +671,10 @@
   prototype_header_.sequenceNumber = 0xf000u;
 }
 
+int VideoSource::flow_id() const {
+  return flow_id_;
+}
+
 uint32_t VideoSource::NextFrameSize() {
   return frame_size_bytes_;
 }
diff --git a/modules/remote_bitrate_estimator/test/bwe_test_framework.h b/modules/remote_bitrate_estimator/test/bwe_test_framework.h
index bfb4935..adade14 100644
--- a/modules/remote_bitrate_estimator/test/bwe_test_framework.h
+++ b/modules/remote_bitrate_estimator/test/bwe_test_framework.h
@@ -47,14 +47,9 @@
 
 class RateCounter {
  public:
-  explicit RateCounter(int64_t window_size_ms)
-      : window_size_us_(1000 * window_size_ms),
-        recently_received_packets_(0),
-        recently_received_bytes_(0),
-        last_accumulated_us_(0),
-        window_() {}
-
-  RateCounter() : RateCounter(1000) {}
+  explicit RateCounter(int64_t window_size_ms);
+  RateCounter();
+  ~RateCounter();
 
   void UpdateRates(int64_t send_time_us, uint32_t payload_size);
 
@@ -236,12 +231,12 @@
                     const char* name,
                     int64_t start_plotting_time_ms,
                     const std::string& algorithm_name);
-  virtual ~RateCounterFilter();
+  ~RateCounterFilter() override;
 
   void LogStats();
   Stats<double> GetBitrateStats() const;
-  virtual void Plot(int64_t timestamp_ms);
-  virtual void RunFor(int64_t time_ms, Packets* in_out);
+  void Plot(int64_t timestamp_ms) override;
+  void RunFor(int64_t time_ms, Packets* in_out) override;
 
  private:
   Stats<double> packets_per_second_stats_;
@@ -259,10 +254,10 @@
  public:
   LossFilter(PacketProcessorListener* listener, int flow_id);
   LossFilter(PacketProcessorListener* listener, const FlowIds& flow_ids);
-  virtual ~LossFilter() {}
+  ~LossFilter() override {}
 
   void SetLoss(float loss_percent);
-  virtual void RunFor(int64_t time_ms, Packets* in_out);
+  void RunFor(int64_t time_ms, Packets* in_out) override;
 
  private:
   Random random_;
@@ -275,10 +270,10 @@
  public:
   DelayFilter(PacketProcessorListener* listener, int flow_id);
   DelayFilter(PacketProcessorListener* listener, const FlowIds& flow_ids);
-  virtual ~DelayFilter() {}
+  ~DelayFilter() override {}
 
   void SetOneWayDelayMs(int64_t one_way_delay_ms);
-  virtual void RunFor(int64_t time_ms, Packets* in_out);
+  void RunFor(int64_t time_ms, Packets* in_out) override;
 
  private:
   int64_t one_way_delay_us_;
@@ -291,10 +286,10 @@
  public:
   JitterFilter(PacketProcessorListener* listener, int flow_id);
   JitterFilter(PacketProcessorListener* listener, const FlowIds& flow_ids);
-  virtual ~JitterFilter() {}
+  ~JitterFilter() override {}
 
   void SetMaxJitter(int64_t stddev_jitter_ms);
-  virtual void RunFor(int64_t time_ms, Packets* in_out);
+  void RunFor(int64_t time_ms, Packets* in_out) override;
   void set_reorderdering(bool reordering) { reordering_ = reordering; }
   int64_t MeanUs();
 
@@ -312,10 +307,10 @@
  public:
   ReorderFilter(PacketProcessorListener* listener, int flow_id);
   ReorderFilter(PacketProcessorListener* listener, const FlowIds& flow_ids);
-  virtual ~ReorderFilter() {}
+  ~ReorderFilter() override {}
 
   void SetReorder(float reorder_percent);
-  virtual void RunFor(int64_t time_ms, Packets* in_out);
+  void RunFor(int64_t time_ms, Packets* in_out) override;
 
  private:
   Random random_;
@@ -329,14 +324,14 @@
  public:
   ChokeFilter(PacketProcessorListener* listener, int flow_id);
   ChokeFilter(PacketProcessorListener* listener, const FlowIds& flow_ids);
-  virtual ~ChokeFilter();
+  ~ChokeFilter() override;
 
   void set_capacity_kbps(uint32_t kbps);
   void set_max_delay_ms(int64_t max_queueing_delay_ms);
 
   uint32_t capacity_kbps();
 
-  virtual void RunFor(int64_t time_ms, Packets* in_out);
+  void RunFor(int64_t time_ms, Packets* in_out) override;
 
   Stats<double> GetDelayStats() const;
 
@@ -356,14 +351,14 @@
   TraceBasedDeliveryFilter(PacketProcessorListener* listener,
                            int flow_id,
                            const char* name);
-  virtual ~TraceBasedDeliveryFilter();
+  ~TraceBasedDeliveryFilter() override;
 
   // The file should contain nanosecond timestamps corresponding to the time
   // when the network can accept another packet. The timestamps should be
   // separated by new lines, e.g., "100000000\n125000000\n321000000\n..."
   bool Init(const std::string& filename);
-  virtual void Plot(int64_t timestamp_ms);
-  virtual void RunFor(int64_t time_ms, Packets* in_out);
+  void Plot(int64_t timestamp_ms) override;
+  void RunFor(int64_t time_ms, Packets* in_out) override;
 
   void set_max_delay_ms(int64_t max_delay_ms);
   Stats<double> GetDelayStats() const;
@@ -397,7 +392,7 @@
 
   virtual void RunFor(int64_t time_ms, Packets* in_out);
 
-  virtual int flow_id() const { return flow_id_; }
+  int flow_id() const;
   virtual void SetBitrateBps(int bitrate_bps) {}
   uint32_t bits_per_second() const { return bits_per_second_; }
   uint32_t max_payload_size_bytes() const { return kMaxPayloadSizeBytes; }
@@ -432,7 +427,7 @@
                       uint32_t kbps,
                       uint32_t ssrc,
                       int64_t first_frame_offset_ms);
-  virtual ~AdaptiveVideoSource() {}
+  ~AdaptiveVideoSource() override {}
 
   void SetBitrateBps(int bitrate_bps) override;
 
@@ -448,7 +443,7 @@
                          uint32_t ssrc,
                          int64_t first_frame_offset_ms,
                          int key_frame_interval);
-  virtual ~PeriodicKeyFrameSource() {}
+  ~PeriodicKeyFrameSource() override {}
 
  protected:
   uint32_t NextFrameSize() override;
diff --git a/modules/remote_bitrate_estimator/test/estimators/bbr.cc b/modules/remote_bitrate_estimator/test/estimators/bbr.cc
index d6209e0..fedd5c4 100644
--- a/modules/remote_bitrate_estimator/test/estimators/bbr.cc
+++ b/modules/remote_bitrate_estimator/test/estimators/bbr.cc
@@ -123,6 +123,34 @@
 
 BbrBweSender::~BbrBweSender() {}
 
+BbrBweSender::PacketStats::PacketStats() = default;
+
+BbrBweSender::PacketStats::PacketStats(
+    uint16_t sequence_number_,
+    int64_t last_sent_packet_send_time_ms_,
+    int64_t send_time_ms_,
+    int64_t ack_time_ms_,
+    int64_t last_acked_packet_ack_time_ms_,
+    size_t payload_size_bytes_,
+    size_t data_sent_bytes_,
+    size_t data_sent_before_last_sent_packet_bytes_,
+    size_t data_acked_bytes_,
+    size_t data_acked_before_last_acked_packet_bytes_)
+    : sequence_number(sequence_number_),
+      last_sent_packet_send_time_ms(last_sent_packet_send_time_ms_),
+      send_time_ms(send_time_ms_),
+      ack_time_ms(ack_time_ms_),
+      last_acked_packet_ack_time_ms(last_acked_packet_ack_time_ms_),
+      payload_size_bytes(payload_size_bytes_),
+      data_sent_bytes(data_sent_bytes_),
+      data_sent_before_last_sent_packet_bytes(
+          data_sent_before_last_sent_packet_bytes_),
+      data_acked_bytes(data_acked_bytes_),
+      data_acked_before_last_acked_packet_bytes(
+          data_acked_before_last_acked_packet_bytes_) {}
+
+BbrBweSender::PacketStats::PacketStats(const PacketStats&) = default;
+
 int BbrBweSender::GetFeedbackIntervalMs() const {
   return kFeedbackIntervalsMs;
 }
diff --git a/modules/remote_bitrate_estimator/test/estimators/bbr.h b/modules/remote_bitrate_estimator/test/estimators/bbr.h
index ee45dbf..f715b96 100644
--- a/modules/remote_bitrate_estimator/test/estimators/bbr.h
+++ b/modules/remote_bitrate_estimator/test/estimators/bbr.h
@@ -31,7 +31,7 @@
 class BbrBweSender : public BweSender {
  public:
   explicit BbrBweSender(BitrateObserver* observer, Clock* clock);
-  virtual ~BbrBweSender();
+  ~BbrBweSender() override;
   enum Mode {
     // Startup phase.
     STARTUP,
@@ -48,7 +48,7 @@
   };
 
   struct PacketStats {
-    PacketStats() {}
+    PacketStats();
     PacketStats(uint16_t sequence_number_,
                 int64_t last_sent_packet_send_time_ms_,
                 int64_t send_time_ms_,
@@ -58,19 +58,9 @@
                 size_t data_sent_bytes_,
                 size_t data_sent_before_last_sent_packet_bytes_,
                 size_t data_acked_bytes_,
-                size_t data_acked_before_last_acked_packet_bytes_)
-        : sequence_number(sequence_number_),
-          last_sent_packet_send_time_ms(last_sent_packet_send_time_ms_),
-          send_time_ms(send_time_ms_),
-          ack_time_ms(ack_time_ms_),
-          last_acked_packet_ack_time_ms(last_acked_packet_ack_time_ms_),
-          payload_size_bytes(payload_size_bytes_),
-          data_sent_bytes(data_sent_bytes_),
-          data_sent_before_last_sent_packet_bytes(
-              data_sent_before_last_sent_packet_bytes_),
-          data_acked_bytes(data_acked_bytes_),
-          data_acked_before_last_acked_packet_bytes(
-              data_acked_before_last_acked_packet_bytes_) {}
+                size_t data_acked_before_last_acked_packet_bytes_);
+    PacketStats(const PacketStats&);
+
     // Sequence number of this packet.
     uint16_t sequence_number;
     // Send time of the last sent packet at ack time of this packet.
@@ -226,7 +216,7 @@
 class BbrBweReceiver : public BweReceiver {
  public:
   explicit BbrBweReceiver(int flow_id);
-  virtual ~BbrBweReceiver();
+  ~BbrBweReceiver() override;
   void ReceivePacket(int64_t arrival_time_ms,
                      const MediaPacket& media_packet) override;
   FeedbackPacket* GetFeedback(int64_t now_ms) override;
diff --git a/modules/remote_bitrate_estimator/test/estimators/min_rtt_filter.cc b/modules/remote_bitrate_estimator/test/estimators/min_rtt_filter.cc
new file mode 100644
index 0000000..8f699ce
--- /dev/null
+++ b/modules/remote_bitrate_estimator/test/estimators/min_rtt_filter.cc
@@ -0,0 +1,23 @@
+/*
+ *  Copyright (c) 2018 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.
+ *
+ */
+
+#include "modules/remote_bitrate_estimator/test/estimators/min_rtt_filter.h"
+
+namespace webrtc {
+namespace testing {
+namespace bwe {
+
+MinRttFilter::MinRttFilter() = default;
+MinRttFilter::~MinRttFilter() = default;
+
+}  // namespace bwe
+}  // namespace testing
+}  // namespace webrtc
diff --git a/modules/remote_bitrate_estimator/test/estimators/min_rtt_filter.h b/modules/remote_bitrate_estimator/test/estimators/min_rtt_filter.h
index f7e1e14..300ba34 100644
--- a/modules/remote_bitrate_estimator/test/estimators/min_rtt_filter.h
+++ b/modules/remote_bitrate_estimator/test/estimators/min_rtt_filter.h
@@ -33,8 +33,8 @@
   // This class implements a simple filter to ensure that PROBE_RTT is only
   // entered when RTTs start to increase, instead of fixed 10 second window as
   // in orginal BBR design doc, to avoid unnecessary freezes in stream.
-  MinRttFilter() {}
-  ~MinRttFilter() {}
+  MinRttFilter();
+  ~MinRttFilter();
 
   absl::optional<int64_t> min_rtt_ms() { return min_rtt_ms_; }
   void AddRttSample(int64_t rtt_ms, int64_t now_ms) {
diff --git a/modules/remote_bitrate_estimator/test/estimators/nada.h b/modules/remote_bitrate_estimator/test/estimators/nada.h
index c9b7cd6..7faedc6 100644
--- a/modules/remote_bitrate_estimator/test/estimators/nada.h
+++ b/modules/remote_bitrate_estimator/test/estimators/nada.h
@@ -35,7 +35,7 @@
 class NadaBweReceiver : public BweReceiver {
  public:
   explicit NadaBweReceiver(int flow_id);
-  virtual ~NadaBweReceiver();
+  ~NadaBweReceiver() override;
 
   void ReceivePacket(int64_t arrival_time_ms,
                      const MediaPacket& media_packet) override;
@@ -67,7 +67,7 @@
 
   NadaBweSender(int kbps, BitrateObserver* observer, Clock* clock);
   NadaBweSender(BitrateObserver* observer, Clock* clock);
-  virtual ~NadaBweSender();
+  ~NadaBweSender() override;
 
   int GetFeedbackIntervalMs() const override;
   // Updates the min_feedback_delay_ms_ and the min_round_trip_time_ms_.
diff --git a/modules/remote_bitrate_estimator/test/estimators/remb.h b/modules/remote_bitrate_estimator/test/estimators/remb.h
index f90b926..34c57b8 100644
--- a/modules/remote_bitrate_estimator/test/estimators/remb.h
+++ b/modules/remote_bitrate_estimator/test/estimators/remb.h
@@ -56,7 +56,7 @@
   static const uint32_t kRemoteBitrateEstimatorMinBitrateBps = 30000;
 
   RembReceiver(int flow_id, bool plot);
-  virtual ~RembReceiver();
+  ~RembReceiver() override;
 
   void ReceivePacket(int64_t arrival_time_ms,
                      const MediaPacket& media_packet) override;
diff --git a/modules/remote_bitrate_estimator/test/estimators/send_side.h b/modules/remote_bitrate_estimator/test/estimators/send_side.h
index 102f04e..6e939c1 100644
--- a/modules/remote_bitrate_estimator/test/estimators/send_side.h
+++ b/modules/remote_bitrate_estimator/test/estimators/send_side.h
@@ -58,7 +58,7 @@
 class SendSideBweReceiver : public BweReceiver {
  public:
   explicit SendSideBweReceiver(int flow_id);
-  virtual ~SendSideBweReceiver();
+  ~SendSideBweReceiver() override;
 
   void ReceivePacket(int64_t arrival_time_ms,
                      const MediaPacket& media_packet) override;
diff --git a/modules/remote_bitrate_estimator/test/estimators/tcp.h b/modules/remote_bitrate_estimator/test/estimators/tcp.h
index 472aaf8..aa4584c 100644
--- a/modules/remote_bitrate_estimator/test/estimators/tcp.h
+++ b/modules/remote_bitrate_estimator/test/estimators/tcp.h
@@ -21,7 +21,7 @@
 class TcpBweReceiver : public BweReceiver {
  public:
   explicit TcpBweReceiver(int flow_id);
-  virtual ~TcpBweReceiver();
+  ~TcpBweReceiver() override;
 
   void ReceivePacket(int64_t arrival_time_ms,
                      const MediaPacket& media_packet) override;
diff --git a/modules/remote_bitrate_estimator/test/metric_recorder.cc b/modules/remote_bitrate_estimator/test/metric_recorder.cc
index b33afb2..8ef0177 100644
--- a/modules/remote_bitrate_estimator/test/metric_recorder.cc
+++ b/modules/remote_bitrate_estimator/test/metric_recorder.cc
@@ -34,6 +34,8 @@
 LinkShare::LinkShare(ChokeFilter* choke_filter)
     : choke_filter_(choke_filter), running_flows_(choke_filter->flow_ids()) {}
 
+LinkShare::~LinkShare() = default;
+
 void LinkShare::PauseFlow(int flow_id) {
   running_flows_.erase(flow_id);
 }
@@ -78,6 +80,8 @@
     packet_sender->set_metric_recorder(this);
 }
 
+MetricRecorder::~MetricRecorder() = default;
+
 void MetricRecorder::SetPlotInformation(
     const std::vector<std::string>& prefixes,
     bool plot_delay,
diff --git a/modules/remote_bitrate_estimator/test/metric_recorder.h b/modules/remote_bitrate_estimator/test/metric_recorder.h
index 4df504a..d0ba4e3 100644
--- a/modules/remote_bitrate_estimator/test/metric_recorder.h
+++ b/modules/remote_bitrate_estimator/test/metric_recorder.h
@@ -28,6 +28,7 @@
 class LinkShare {
  public:
   explicit LinkShare(ChokeFilter* choke_filter);
+  ~LinkShare();
 
   void PauseFlow(int flow_id);   // Increases available capacity per flow.
   void ResumeFlow(int flow_id);  // Decreases available capacity per flow.
@@ -67,6 +68,7 @@
                  int flow_id,
                  PacketSender* packet_sender,
                  LinkShare* link_share);
+  ~MetricRecorder();
 
   void SetPlotInformation(const std::vector<std::string>& prefixes,
                           bool plot_delay,
diff --git a/modules/remote_bitrate_estimator/test/packet.cc b/modules/remote_bitrate_estimator/test/packet.cc
new file mode 100644
index 0000000..910f638
--- /dev/null
+++ b/modules/remote_bitrate_estimator/test/packet.cc
@@ -0,0 +1,97 @@
+/*
+ *  Copyright (c) 2018 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.
+ */
+
+#include "modules/remote_bitrate_estimator/test/packet.h"
+
+namespace webrtc {
+namespace testing {
+namespace bwe {
+
+Packet::Packet()
+    : flow_id_(0),
+      creation_time_us_(-1),
+      send_time_us_(-1),
+      sender_timestamp_us_(-1),
+      payload_size_(0) {}
+
+Packet::Packet(int flow_id, int64_t send_time_us, size_t payload_size)
+    : flow_id_(flow_id),
+      creation_time_us_(send_time_us),
+      send_time_us_(send_time_us),
+      sender_timestamp_us_(send_time_us),
+      payload_size_(payload_size) {}
+
+Packet::~Packet() {}
+
+bool Packet::operator<(const Packet& rhs) const {
+  return send_time_us_ < rhs.send_time_us_;
+}
+
+void Packet::set_send_time_us(int64_t send_time_us) {
+  assert(send_time_us >= 0);
+  send_time_us_ = send_time_us;
+}
+
+int Packet::flow_id() const {
+  return flow_id_;
+}
+
+int64_t Packet::send_time_us() const {
+  return send_time_us_;
+}
+
+int64_t Packet::sender_timestamp_us() const {
+  return sender_timestamp_us_;
+}
+
+size_t Packet::payload_size() const {
+  return payload_size_;
+}
+
+void Packet::set_sender_timestamp_us(int64_t sender_timestamp_us) {
+  sender_timestamp_us_ = sender_timestamp_us;
+}
+
+int64_t Packet::creation_time_ms() const {
+  return (creation_time_us_ + 500) / 1000;
+}
+
+int64_t Packet::sender_timestamp_ms() const {
+  return (sender_timestamp_us_ + 500) / 1000;
+}
+
+int64_t Packet::send_time_ms() const {
+  return (send_time_us_ + 500) / 1000;
+}
+
+Packet::Type MediaPacket::GetPacketType() const {
+  return kMedia;
+}
+
+Packet::Type FeedbackPacket::GetPacketType() const {
+  return kFeedback;
+}
+
+BbrBweFeedback::~BbrBweFeedback() = default;
+
+SendSideBweFeedback::~SendSideBweFeedback() = default;
+
+TcpFeedback::TcpFeedback(int flow_id,
+                         int64_t send_time_us,
+                         int64_t latest_send_time_ms,
+                         const std::vector<uint16_t>& acked_packets)
+    : FeedbackPacket(flow_id, send_time_us, latest_send_time_ms),
+      acked_packets_(acked_packets) {}
+
+TcpFeedback::~TcpFeedback() = default;
+
+}  // namespace bwe
+}  // namespace testing
+}  // namespace webrtc
diff --git a/modules/remote_bitrate_estimator/test/packet.h b/modules/remote_bitrate_estimator/test/packet.h
index 3050e54..5e45eb5 100644
--- a/modules/remote_bitrate_estimator/test/packet.h
+++ b/modules/remote_bitrate_estimator/test/packet.h
@@ -34,22 +34,16 @@
 
   virtual bool operator<(const Packet& rhs) const;
 
-  virtual int flow_id() const { return flow_id_; }
+  virtual int flow_id() const;
   virtual void set_send_time_us(int64_t send_time_us);
-  virtual int64_t send_time_us() const { return send_time_us_; }
-  virtual int64_t sender_timestamp_us() const { return sender_timestamp_us_; }
-  virtual size_t payload_size() const { return payload_size_; }
+  virtual int64_t send_time_us() const;
+  virtual int64_t sender_timestamp_us() const;
+  virtual size_t payload_size() const;
   virtual Packet::Type GetPacketType() const = 0;
-  virtual void set_sender_timestamp_us(int64_t sender_timestamp_us) {
-    sender_timestamp_us_ = sender_timestamp_us;
-  }
-  virtual int64_t creation_time_ms() const {
-    return (creation_time_us_ + 500) / 1000;
-  }
-  virtual int64_t sender_timestamp_ms() const {
-    return (sender_timestamp_us_ + 500) / 1000;
-  }
-  virtual int64_t send_time_ms() const { return (send_time_us_ + 500) / 1000; }
+  virtual void set_sender_timestamp_us(int64_t sender_timestamp_us);
+  virtual int64_t creation_time_ms() const;
+  virtual int64_t sender_timestamp_ms() const;
+  virtual int64_t send_time_ms() const;
 
  protected:
   int flow_id_;
@@ -72,7 +66,7 @@
               const RTPHeader& header);
   MediaPacket(int64_t send_time_us, uint16_t sequence_number);
 
-  virtual ~MediaPacket() {}
+  ~MediaPacket() override {}
 
   int64_t GetAbsSendTimeInMs() const {
     int64_t timestamp = header_.extension.absoluteSendTime
@@ -81,7 +75,7 @@
   }
   void SetAbsSendTimeMs(int64_t abs_send_time_ms);
   const RTPHeader& header() const { return header_; }
-  virtual Packet::Type GetPacketType() const { return kMedia; }
+  Packet::Type GetPacketType() const override;
   uint16_t sequence_number() const { return header_.sequenceNumber; }
 
  private:
@@ -100,9 +94,9 @@
                  int64_t latest_send_time_ms)
       : Packet(flow_id, this_send_time_us, 0),
         latest_send_time_ms_(latest_send_time_ms) {}
-  virtual ~FeedbackPacket() {}
+  ~FeedbackPacket() override {}
 
-  virtual Packet::Type GetPacketType() const { return kFeedback; }
+  Packet::Type GetPacketType() const override;
   int64_t latest_send_time_ms() const { return latest_send_time_ms_; }
 
  private:
@@ -115,7 +109,7 @@
                  int64_t send_time_us,
                  int64_t latest_send_time_ms,
                  const std::vector<uint16_t>& packet_feedback_vector);
-  virtual ~BbrBweFeedback() {}
+  ~BbrBweFeedback() override;
 
   const std::vector<uint16_t>& packet_feedback_vector() const {
     return packet_feedback_vector_;
@@ -132,7 +126,7 @@
                int64_t latest_send_time_ms,
                uint32_t estimated_bps,
                RTCPReportBlock report_block);
-  virtual ~RembFeedback() {}
+  ~RembFeedback() override {}
 
   uint32_t estimated_bps() const { return estimated_bps_; }
   RTCPReportBlock report_block() const { return report_block_; }
@@ -150,7 +144,7 @@
       int64_t send_time_us,
       int64_t latest_send_time_ms,
       const std::vector<PacketFeedback>& packet_feedback_vector);
-  virtual ~SendSideBweFeedback() {}
+  ~SendSideBweFeedback() override;
 
   const std::vector<PacketFeedback>& packet_feedback_vector() const {
     return packet_feedback_vector_;
@@ -176,7 +170,7 @@
         congestion_signal_(congestion_signal),
         derivative_(derivative),
         receiving_rate_(receiving_rate) {}
-  virtual ~NadaFeedback() {}
+  ~NadaFeedback() override {}
 
   int64_t exp_smoothed_delay_ms() const { return exp_smoothed_delay_ms_; }
   int64_t est_queuing_delay_signal_ms() const {
@@ -199,10 +193,8 @@
   TcpFeedback(int flow_id,
               int64_t send_time_us,
               int64_t latest_send_time_ms,
-              const std::vector<uint16_t>& acked_packets)
-      : FeedbackPacket(flow_id, send_time_us, latest_send_time_ms),
-        acked_packets_(acked_packets) {}
-  virtual ~TcpFeedback() {}
+              const std::vector<uint16_t>& acked_packets);
+  ~TcpFeedback() override;
 
   const std::vector<uint16_t>& acked_packets() const { return acked_packets_; }
 
diff --git a/modules/remote_bitrate_estimator/test/packet_receiver.h b/modules/remote_bitrate_estimator/test/packet_receiver.h
index a4b26da..af9dadb 100644
--- a/modules/remote_bitrate_estimator/test/packet_receiver.h
+++ b/modules/remote_bitrate_estimator/test/packet_receiver.h
@@ -36,7 +36,7 @@
                  bool plot_delay,
                  bool plot_bwe,
                  MetricRecorder* metric_recorder);
-  ~PacketReceiver();
+  ~PacketReceiver() override;
 
   // Implements PacketProcessor.
   void RunFor(int64_t time_ms, Packets* in_out) override;
diff --git a/modules/remote_bitrate_estimator/test/packet_sender.cc b/modules/remote_bitrate_estimator/test/packet_sender.cc
index fbd6956..06e5505 100644
--- a/modules/remote_bitrate_estimator/test/packet_sender.cc
+++ b/modules/remote_bitrate_estimator/test/packet_sender.cc
@@ -28,6 +28,10 @@
 const float kPaceMultiplier = 2.5f;
 }
 
+uint32_t PacketSender::TargetBitrateKbps() {
+  return 0;
+}
+
 void PacketSender::Pause() {
   running_ = false;
   if (metric_recorder_ != nullptr) {
@@ -104,6 +108,10 @@
   ProcessFeedbackAndGeneratePackets(time_ms, &feedbacks, in_out);
 }
 
+VideoSource* VideoSender::source() const {
+  return source_;
+}
+
 void VideoSender::ProcessFeedbackAndGeneratePackets(
     int64_t time_ms,
     std::list<FeedbackPacket*>* feedbacks,
@@ -327,6 +335,10 @@
       bitrate_for_pacer_bps, in_probe_rtt, congestion_window);
 }
 
+size_t PacedVideoSender::pacer_queue_size_in_bytes() {
+  return pacer_queue_size_in_bytes_;
+}
+
 void PacedVideoSender::OnBytesAcked(size_t bytes) {
   pacer_->OnBytesAcked(bytes);
 }
@@ -358,6 +370,8 @@
       num_recent_sent_packets_(0),
       bitrate_kbps_(0) {}
 
+TcpSender::~TcpSender() = default;
+
 void TcpSender::RunFor(int64_t time_ms, Packets* in_out) {
   if (clock_.TimeInMilliseconds() + time_ms < offset_ms_) {
     clock_.AdvanceTimeMilliseconds(time_ms);
@@ -398,6 +412,10 @@
   SendPackets(in_out);
 }
 
+int TcpSender::GetFeedbackIntervalMs() const {
+  return 10;
+}
+
 void TcpSender::SendPackets(Packets* in_out) {
   int cwnd = ceil(cwnd_);
   int packets_to_send = std::max(cwnd - static_cast<int>(in_flight_.size()), 0);
diff --git a/modules/remote_bitrate_estimator/test/packet_sender.h b/modules/remote_bitrate_estimator/test/packet_sender.h
index 718b5b7..42e98b6 100644
--- a/modules/remote_bitrate_estimator/test/packet_sender.h
+++ b/modules/remote_bitrate_estimator/test/packet_sender.h
@@ -38,7 +38,7 @@
         // We assume that both start at time 0.
         clock_(0),
         metric_recorder_(nullptr) {}
-  virtual ~PacketSender() {}
+  ~PacketSender() override {}
   // Call GiveFeedback() with the returned interval in milliseconds, provided
   // there is a new estimate available.
   // Note that changing the feedback interval affects the timing of when the
@@ -47,7 +47,7 @@
   virtual int GetFeedbackIntervalMs() const = 0;
   void SetSenderTimestamps(Packets* in_out);
 
-  virtual uint32_t TargetBitrateKbps() { return 0; }
+  virtual uint32_t TargetBitrateKbps();
 
   virtual void Pause();
   virtual void Resume(int64_t paused_time_ms);
@@ -68,12 +68,12 @@
   VideoSender(PacketProcessorListener* listener,
               VideoSource* source,
               BandwidthEstimatorType estimator);
-  virtual ~VideoSender();
+  ~VideoSender() override;
 
   int GetFeedbackIntervalMs() const override;
   void RunFor(int64_t time_ms, Packets* in_out) override;
 
-  virtual VideoSource* source() const { return source_; }
+  virtual VideoSource* source() const;
 
   uint32_t TargetBitrateKbps() override;
 
@@ -104,7 +104,7 @@
   PacedVideoSender(PacketProcessorListener* listener,
                    VideoSource* source,
                    BandwidthEstimatorType estimator);
-  virtual ~PacedVideoSender();
+  ~PacedVideoSender() override;
 
   void RunFor(int64_t time_ms, Packets* in_out) override;
 
@@ -127,9 +127,7 @@
                         bool in_probe_rtt,
                         int64_t rtt,
                         uint64_t congestion_window) override;
-  size_t pacer_queue_size_in_bytes() override {
-    return pacer_queue_size_in_bytes_;
-  }
+  size_t pacer_queue_size_in_bytes() override;
   void OnBytesAcked(size_t bytes) override;
 
  private:
@@ -152,10 +150,10 @@
             int flow_id,
             int64_t offset_ms,
             int send_limit_bytes);
-  virtual ~TcpSender() {}
+  ~TcpSender() override;
 
   void RunFor(int64_t time_ms, Packets* in_out) override;
-  int GetFeedbackIntervalMs() const override { return 10; }
+  int GetFeedbackIntervalMs() const override;
 
   uint32_t TargetBitrateKbps() override;