| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef NET_BASE_LOGGING_NETWORK_CHANGE_OBSERVER_H_ |
| 6 #define NET_BASE_LOGGING_NETWORK_CHANGE_OBSERVER_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "net/base/net_export.h" |
| 10 #include "net/base/network_change_notifier.h" |
| 11 |
| 12 namespace net { |
| 13 |
| 14 class NetLog; |
| 15 |
| 16 // A class that adds NetLog events for network change events coming from the |
| 17 // net::NetworkChangeNotifier. |
| 18 class NET_EXPORT LoggingNetworkChangeObserver |
| 19 : public NetworkChangeNotifier::IPAddressObserver, |
| 20 public NetworkChangeNotifier::ConnectionTypeObserver, |
| 21 public NetworkChangeNotifier::NetworkChangeObserver { |
| 22 public: |
| 23 // Note: |net_log| must remain valid throughout the lifetime of this |
| 24 // LoggingNetworkChangeObserver. |
| 25 explicit LoggingNetworkChangeObserver(NetLog* net_log); |
| 26 ~LoggingNetworkChangeObserver() override; |
| 27 |
| 28 private: |
| 29 // NetworkChangeNotifier::IPAddressObserver implementation. |
| 30 void OnIPAddressChanged() override; |
| 31 |
| 32 // NetworkChangeNotifier::ConnectionTypeObserver implementation. |
| 33 void OnConnectionTypeChanged( |
| 34 NetworkChangeNotifier::ConnectionType type) override; |
| 35 |
| 36 // NetworkChangeNotifier::NetworkChangeObserver implementation. |
| 37 void OnNetworkChanged(NetworkChangeNotifier::ConnectionType type) override; |
| 38 |
| 39 private: |
| 40 NetLog* net_log_; |
| 41 |
| 42 DISALLOW_COPY_AND_ASSIGN(LoggingNetworkChangeObserver); |
| 43 }; |
| 44 |
| 45 } // namespace net |
| 46 |
| 47 #endif // NET_BASE_LOGGING_NETWORK_CHANGE_OBSERVER_H_ |
| OLD | NEW |