Chromium Code Reviews| Index: chrome/browser/io_thread.cc |
| diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc |
| index 08ed80c0562ac423e339c5c43af3ed34bd55f5b2..5ae0edbc224d739d922cc4d9f5ff937c237967e3 100644 |
| --- a/chrome/browser/io_thread.cc |
| +++ b/chrome/browser/io_thread.cc |
| @@ -244,16 +244,19 @@ 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() { |
| @@ -262,6 +265,19 @@ class IOThread::LoggingNetworkChangeObserver |
| net_log_->AddGlobalEntry(net::NetLog::TYPE_NETWORK_IP_ADDRESSES_CHANGED); |
| } |
| + virtual void OnConnectionTypeChanged( |
|
mmenke
2012/10/25 16:25:31
While you're here, could you make this and OnIPAdd
|
| + net::NetworkChangeNotifier::ConnectionType type) { |
| + 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_type", &type_as_string)); |
| + } |
| + |
| private: |
| net::NetLog* net_log_; |
| DISALLOW_COPY_AND_ASSIGN(LoggingNetworkChangeObserver); |