| Index: chrome/browser/io_thread.cc
|
| diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc
|
| index 081263837fad026489a3ca44f56dc0e8d23d1fc9..53d184f4dc0546224a2ce30a9746baffbbd649ff 100644
|
| --- a/chrome/browser/io_thread.cc
|
| +++ b/chrome/browser/io_thread.cc
|
| @@ -235,26 +235,31 @@ int GetSwitchValueAsInt(const CommandLine& command_line,
|
|
|
| class IOThread::LoggingNetworkChangeObserver
|
| : public net::NetworkChangeNotifier::IPAddressObserver,
|
| - public net::NetworkChangeNotifier::ConnectionTypeObserver {
|
| + public net::NetworkChangeNotifier::ConnectionTypeObserver,
|
| + public net::NetworkChangeNotifier::NetworkChangeObserver {
|
| public:
|
| // |net_log| must remain valid throughout our lifetime.
|
| explicit LoggingNetworkChangeObserver(net::NetLog* net_log)
|
| : net_log_(net_log) {
|
| net::NetworkChangeNotifier::AddIPAddressObserver(this);
|
| net::NetworkChangeNotifier::AddConnectionTypeObserver(this);
|
| + net::NetworkChangeNotifier::AddNetworkChangeObserver(this);
|
| }
|
|
|
| ~LoggingNetworkChangeObserver() {
|
| net::NetworkChangeNotifier::RemoveIPAddressObserver(this);
|
| net::NetworkChangeNotifier::RemoveConnectionTypeObserver(this);
|
| + net::NetworkChangeNotifier::RemoveNetworkChangeObserver(this);
|
| }
|
|
|
| + // NetworkChangeNotifier::IPAddressObserver implementation.
|
| virtual void OnIPAddressChanged() OVERRIDE {
|
| VLOG(1) << "Observed a change to the network IP addresses";
|
|
|
| net_log_->AddGlobalEntry(net::NetLog::TYPE_NETWORK_IP_ADDRESSES_CHANGED);
|
| }
|
|
|
| + // NetworkChangeNotifier::ConnectionTypeObserver implementation.
|
| virtual void OnConnectionTypeChanged(
|
| net::NetworkChangeNotifier::ConnectionType type) OVERRIDE {
|
| std::string type_as_string =
|
| @@ -268,6 +273,19 @@ class IOThread::LoggingNetworkChangeObserver
|
| net::NetLog::StringCallback("new_connection_type", &type_as_string));
|
| }
|
|
|
| + // NetworkChangeNotifier::NetworkChangeObserver implementation.
|
| + virtual void OnNetworkChanged(
|
| + net::NetworkChangeNotifier::ConnectionType type) OVERRIDE {
|
| + std::string type_as_string =
|
| + net::NetworkChangeNotifier::ConnectionTypeToString(type);
|
| +
|
| + VLOG(1) << "Observed a network change to state " << type_as_string;
|
| +
|
| + net_log_->AddGlobalEntry(
|
| + net::NetLog::TYPE_NETWORK_CHANGED,
|
| + net::NetLog::StringCallback("new_connection_type", &type_as_string));
|
| + }
|
| +
|
| private:
|
| net::NetLog* net_log_;
|
| DISALLOW_COPY_AND_ASSIGN(LoggingNetworkChangeObserver);
|
|
|