Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(170)

Unified Diff: webrtc/modules/congestion_controller/include/send_side_congestion_controller.h

Issue 2795643002: Add methods to register congestion controller observer after construction. (Closed)
Patch Set: Added TODO comment. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/modules/congestion_controller/send_side_congestion_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/congestion_controller/include/send_side_congestion_controller.h
diff --git a/webrtc/modules/congestion_controller/include/send_side_congestion_controller.h b/webrtc/modules/congestion_controller/include/send_side_congestion_controller.h
index 8130feb01e2f02a8c43e8227a06052db1babfa92..58eba25a7ffaef2165bc1493ce63ee4fcbc10544 100644
--- a/webrtc/modules/congestion_controller/include/send_side_congestion_controller.h
+++ b/webrtc/modules/congestion_controller/include/send_side_congestion_controller.h
@@ -57,6 +57,7 @@ class SendSideCongestionController : public CallStatsObserver,
protected:
virtual ~Observer() {}
};
+ // TODO(nisse): Consider deleting the |observer| argument to constructors.
SendSideCongestionController(const Clock* clock,
Observer* observer,
RtcEventLog* event_log,
@@ -70,6 +71,10 @@ class SendSideCongestionController : public CallStatsObserver,
void RegisterPacketFeedbackObserver(PacketFeedbackObserver* observer);
void DeRegisterPacketFeedbackObserver(PacketFeedbackObserver* observer);
+ // Currently, there can be at most one observer.
+ void RegisterNetworkObserver(Observer* observer);
+ void DeRegisterNetworkObserver(Observer* observer);
+
virtual void SetBweBitrates(int min_bitrate_bps,
int start_bitrate_bps,
int max_bitrate_bps);
@@ -130,7 +135,8 @@ class SendSideCongestionController : public CallStatsObserver,
uint8_t fraction_loss,
int64_t rtt);
const Clock* const clock_;
- Observer* const observer_;
+ rtc::CriticalSection observer_lock_;
+ Observer* observer_ GUARDED_BY(observer_lock_);
RtcEventLog* const event_log_;
const std::unique_ptr<PacedSender> pacer_;
const std::unique_ptr<BitrateController> bitrate_controller_;
« no previous file with comments | « no previous file | webrtc/modules/congestion_controller/send_side_congestion_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698