| Index: chrome/browser/io_thread.cc
|
| diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc
|
| index 08ed80c0562ac423e339c5c43af3ed34bd55f5b2..ddfdcb3da4a1a334e5d15f8f89b10abc26059b6e 100644
|
| --- a/chrome/browser/io_thread.cc
|
| +++ b/chrome/browser/io_thread.cc
|
| @@ -244,24 +244,40 @@ ConstructSystemRequestContext(IOThread::Globals* globals,
|
| } // namespace
|
|
|
| class IOThread::LoggingNetworkChangeObserver
|
| - : public net::NetworkChangeNotifier::IPAddressObserver {
|
| + : public net::NetworkChangeNotifier::IPAddressObserver,
|
| + public net::NetworkChangeNotifier::ConnectionTypeObserver {
|
| 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);
|
| }
|
|
|
| ~LoggingNetworkChangeObserver() {
|
| net::NetworkChangeNotifier::RemoveIPAddressObserver(this);
|
| + net::NetworkChangeNotifier::RemoveConnectionTypeObserver(this);
|
| }
|
|
|
| - virtual void OnIPAddressChanged() {
|
| + virtual void OnIPAddressChanged() OVERRIDE {
|
| VLOG(1) << "Observed a change to the network IP addresses";
|
|
|
| net_log_->AddGlobalEntry(net::NetLog::TYPE_NETWORK_IP_ADDRESSES_CHANGED);
|
| }
|
|
|
| + virtual void OnConnectionTypeChanged(
|
| + net::NetworkChangeNotifier::ConnectionType type) OVERRIDE {
|
| + std::string type_as_string =
|
| + net::NetworkChangeNotifier::ConnectionTypeToString(type);
|
| +
|
| + VLOG(1) << "Observed a change to network connectivity state "
|
| + << type_as_string;
|
| +
|
| + net_log_->AddGlobalEntry(
|
| + net::NetLog::TYPE_NETWORK_CONNECTIVITY_CHANGED,
|
| + net::NetLog::StringCallback("new_connection_type", &type_as_string));
|
| + }
|
| +
|
| private:
|
| net::NetLog* net_log_;
|
| DISALLOW_COPY_AND_ASSIGN(LoggingNetworkChangeObserver);
|
|
|