Add support for transport wide sequence numbers

Also refactor packet router to use a map rather than iterate over all
rtp modules for each packet sent.

BUG=webrtc:4311

Review URL: https://codereview.webrtc.org/1247293002

Cr-Commit-Position: refs/heads/master@{#9670}
diff --git a/webrtc/modules/bitrate_controller/bitrate_controller_impl.h b/webrtc/modules/bitrate_controller/bitrate_controller_impl.h
index 3d38a54..a0131e2 100644
--- a/webrtc/modules/bitrate_controller/bitrate_controller_impl.h
+++ b/webrtc/modules/bitrate_controller/bitrate_controller_impl.h
@@ -20,9 +20,9 @@
 #include <list>
 #include <utility>
 
+#include "webrtc/base/criticalsection.h"
 #include "webrtc/base/scoped_ptr.h"
 #include "webrtc/modules/bitrate_controller/send_side_bandwidth_estimation.h"
-#include "webrtc/system_wrappers/interface/critical_section_wrapper.h"
 
 namespace webrtc {
 
@@ -64,22 +64,21 @@
 
   void OnNetworkChanged(uint32_t bitrate,
                         uint8_t fraction_loss,  // 0 - 255.
-                        int64_t rtt)
-      EXCLUSIVE_LOCKS_REQUIRED(*critsect_);
+                        int64_t rtt) EXCLUSIVE_LOCKS_REQUIRED(critsect_);
 
   // Used by process thread.
   Clock* clock_;
   BitrateObserver* observer_;
   int64_t last_bitrate_update_ms_;
 
-  const rtc::scoped_ptr<CriticalSectionWrapper> critsect_;
-  SendSideBandwidthEstimation bandwidth_estimation_ GUARDED_BY(*critsect_);
-  uint32_t reserved_bitrate_bps_ GUARDED_BY(*critsect_);
+  mutable rtc::CriticalSection critsect_;
+  SendSideBandwidthEstimation bandwidth_estimation_ GUARDED_BY(critsect_);
+  uint32_t reserved_bitrate_bps_ GUARDED_BY(critsect_);
 
-  uint32_t last_bitrate_bps_ GUARDED_BY(*critsect_);
-  uint8_t last_fraction_loss_ GUARDED_BY(*critsect_);
-  int64_t last_rtt_ms_ GUARDED_BY(*critsect_);
-  uint32_t last_reserved_bitrate_bps_ GUARDED_BY(*critsect_);
+  uint32_t last_bitrate_bps_ GUARDED_BY(critsect_);
+  uint8_t last_fraction_loss_ GUARDED_BY(critsect_);
+  int64_t last_rtt_ms_ GUARDED_BY(critsect_);
+  uint32_t last_reserved_bitrate_bps_ GUARDED_BY(critsect_);
 
   DISALLOW_IMPLICIT_CONSTRUCTORS(BitrateControllerImpl);
 };