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

Unified Diff: webrtc/base/network.h

Issue 1815473002: Add 16-bit network id to the candidate signaling. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Remove the old NETWORK_COST attribute. Created 4 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 | « webrtc/api/webrtcsdp_unittest.cc ('k') | webrtc/base/network.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/network.h
diff --git a/webrtc/base/network.h b/webrtc/base/network.h
index 680c005ea29ace284f9aae3c7bf4c07f9694f6a0..ee22d5e573075c24b5842433d9f004400e7099e8 100644
--- a/webrtc/base/network.h
+++ b/webrtc/base/network.h
@@ -173,6 +173,11 @@ class NetworkManagerBase : public NetworkManager {
IPAddress default_local_ipv4_address_;
IPAddress default_local_ipv6_address_;
+ // We use 16 bits to save the bandwidth consumption when sending the network
+ // id over the Internet. It is OK that the 16-bit integer overflows to get a
+ // network id 0 because we only compare the network ids in the old and the new
+ // best connections in the transport channel.
+ uint16_t next_available_network_id_ = 1;
};
// Basic implementation of the NetworkManager interface that gets list
@@ -339,6 +344,11 @@ class Network {
AdapterType type() const { return type_; }
void set_type(AdapterType type) { type_ = type; }
+ // A unique id assigned by the network manager, which may be signaled
+ // to the remote side in the candidate.
+ uint16_t id() const { return id_; }
+ void set_id(uint16_t id) { id_ = id; }
+
int preference() const { return preference_; }
void set_preference(int preference) { preference_ = preference; }
@@ -372,6 +382,7 @@ class Network {
AdapterType type_;
int preference_;
bool active_ = true;
+ uint16_t id_ = 0;
friend class NetworkManager;
};
« no previous file with comments | « webrtc/api/webrtcsdp_unittest.cc ('k') | webrtc/base/network.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698