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

Unified Diff: webrtc/api/webrtcsession.h

Issue 2567243003: RTCStatsCollector: Utilize network thread to minimize thread hops. (Closed)
Patch Set: GetSessionStats replacing GetTransportStats, getting certificate from any thread Created 4 years 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
Index: webrtc/api/webrtcsession.h
diff --git a/webrtc/api/webrtcsession.h b/webrtc/api/webrtcsession.h
index 1aa3e187ae2bf5f2e320ca6c43d5fee44708446f..2ad1fc6773c0c8e41d203fb63186bc0d72263a65 100644
--- a/webrtc/api/webrtcsession.h
+++ b/webrtc/api/webrtcsession.h
@@ -115,6 +115,20 @@ struct SessionStats {
TransportStatsMap transport_stats;
};
+struct ChannelNamePair {
+ ChannelNamePair(
+ const std::string& content_name, const std::string& transport_name)
+ : content_name(content_name), transport_name(transport_name) {}
+ std::string content_name;
+ std::string transport_name;
+};
+
+struct ChannelNamePairs {
+ rtc::Optional<ChannelNamePair> voice;
+ rtc::Optional<ChannelNamePair> video;
+ rtc::Optional<ChannelNamePair> data;
+};
+
// A WebRtcSession manages general session state. This includes negotiation
// of both the application-level and network-level protocols: the former
// defines what will be sent and the latter defines how it will be sent. Each
@@ -194,6 +208,7 @@ class WebRtcSession :
virtual cricket::DataChannel* data_channel() {
return data_channel_.get();
}
Taylor Brandstetter 2016/12/15 01:12:53 Could you add a brief comment explaining this meth
hbos 2016/12/15 16:12:45 Removed.
+ std::unique_ptr<ChannelNamePairs> GetChannelNamePairs();
cricket::BaseChannel* GetChannel(const std::string& content_name);
@@ -262,10 +277,9 @@ class WebRtcSession :
// Returns stats for all channels of all transports.
// This avoids exposing the internal structures used to track them.
- virtual bool GetTransportStats(SessionStats* stats);
-
- // Get stats for a specific channel
- bool GetChannelTransportStats(cricket::BaseChannel* ch, SessionStats* stats);
+ std::unique_ptr<SessionStats> GetSessionStats();
Taylor Brandstetter 2016/12/15 01:12:54 This one too.
hbos 2016/12/15 16:12:45 Done.
+ virtual std::unique_ptr<SessionStats> GetSessionStats(
+ const ChannelNamePairs& channel_name_pairs);
// virtual so it can be mocked in unit tests
virtual bool GetLocalCertificate(
@@ -416,6 +430,9 @@ class WebRtcSession :
bool CreateDataChannel(const cricket::ContentInfo* content,
const std::string* bundle_transport);
+ std::unique_ptr<SessionStats> GetSessionStats_n(
+ const ChannelNamePairs& channel_name_pairs);
+
// Listens to SCTP CONTROL messages on unused SIDs and process them as OPEN
// messages.
void OnDataChannelMessageReceived(cricket::DataChannel* channel,
@@ -486,7 +503,7 @@ class WebRtcSession :
const std::string sid_;
bool initial_offerer_ = false;
- std::unique_ptr<cricket::TransportController> transport_controller_;
+ const std::unique_ptr<cricket::TransportController> transport_controller_;
MediaControllerInterface* media_controller_;
std::unique_ptr<cricket::VoiceChannel> voice_channel_;
std::unique_ptr<cricket::VideoChannel> video_channel_;

Powered by Google App Engine
This is Rietveld 408576698