Revert 5545 "Update libjingle to 61514460"

> Update libjingle to 61514460
> 
> TBR=tommi@webrtc.org
> 
> Review URL: https://webrtc-codereview.appspot.com/8649004

TBR=xians@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/8669004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5547 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
wu@webrtc.org
2014-02-13 19:54:28 +00:00
parent 38bf249049
commit 0de29504ab
38 changed files with 155 additions and 577 deletions

View File

@@ -45,23 +45,9 @@ struct ifaddrs;
namespace talk_base {
class Network;
class NetworkSession;
class Thread;
enum AdapterType {
// This enum resembles the one in Chromium net::ConnectionType.
ADAPTER_TYPE_UNKNOWN = 0,
ADAPTER_TYPE_ETHERNET = 1,
ADAPTER_TYPE_WIFI = 2,
ADAPTER_TYPE_CELLULAR = 3,
ADAPTER_TYPE_VPN = 4
};
// Makes a string key for this network. Used in the network manager's maps.
// Network objects are keyed on interface name, network prefix and the
// length of that prefix.
std::string MakeNetworkKey(const std::string& name, const IPAddress& prefix,
int prefix_length);
// Generic network manager interface. It provides list of local
// networks.
class NetworkManager {
@@ -182,12 +168,7 @@ class BasicNetworkManager : public NetworkManagerBase,
// Represents a Unix-type network interface, with a name and single address.
class Network {
public:
Network() : prefix_(INADDR_ANY), scope_id_(0),
type_(ADAPTER_TYPE_UNKNOWN) {}
Network(const std::string& name, const std::string& description,
const IPAddress& prefix, int prefix_length,
const std::string& key);
Network() : prefix_(INADDR_ANY), scope_id_(0) {}
Network(const std::string& name, const std::string& description,
const IPAddress& prefix, int prefix_length);
@@ -203,10 +184,6 @@ class Network {
// Returns the length, in bits, of this network's prefix.
int prefix_length() const { return prefix_length_; }
// |key_| has unique value per network interface. Used in sorting network
// interfaces. Key is derived from interface name and it's prefix.
std::string key() const { return key_; }
// Returns the Network's current idea of the 'best' IP it has.
// 'Best' currently means the first one added.
// TODO: We should be preferring temporary addresses.
@@ -238,32 +215,27 @@ class Network {
bool ignored() const { return ignored_; }
void set_ignored(bool ignored) { ignored_ = ignored; }
AdapterType type() const { return type_; }
int preference() const { return preference_; }
void set_preference(int preference) { preference_ = preference; }
// Debugging description of this network
std::string ToString() const;
private:
typedef std::vector<NetworkSession*> SessionList;
std::string name_;
std::string description_;
IPAddress prefix_;
int prefix_length_;
std::string key_;
std::vector<IPAddress> ips_;
int scope_id_;
bool ignored_;
SessionList sessions_;
double uniform_numerator_;
double uniform_denominator_;
double exponential_numerator_;
double exponential_denominator_;
AdapterType type_;
int preference_;
friend class NetworkManager;
};
} // namespace talk_base
#endif // TALK_BASE_NETWORK_H_