Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(166)

Side by Side Diff: net/base/logging_network_change_observer.h

Issue 1973743004: Make LoggingNetworkChangeObserver log specific network changes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cronetlog
Patch Set: don't register if NetworkHandles not supported Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | net/base/logging_network_change_observer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef NET_BASE_LOGGING_NETWORK_CHANGE_OBSERVER_H_ 5 #ifndef NET_BASE_LOGGING_NETWORK_CHANGE_OBSERVER_H_
6 #define NET_BASE_LOGGING_NETWORK_CHANGE_OBSERVER_H_ 6 #define NET_BASE_LOGGING_NETWORK_CHANGE_OBSERVER_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "net/base/net_export.h" 9 #include "net/base/net_export.h"
10 #include "net/base/network_change_notifier.h" 10 #include "net/base/network_change_notifier.h"
11 11
12 namespace net { 12 namespace net {
13 13
14 class NetLog; 14 class NetLog;
15 15
16 // A class that adds NetLog events for network change events coming from the 16 // A class that adds NetLog events for network change events coming from the
17 // net::NetworkChangeNotifier. 17 // net::NetworkChangeNotifier.
18 class NET_EXPORT LoggingNetworkChangeObserver 18 class NET_EXPORT LoggingNetworkChangeObserver
19 : public NetworkChangeNotifier::IPAddressObserver, 19 : public NetworkChangeNotifier::IPAddressObserver,
20 public NetworkChangeNotifier::ConnectionTypeObserver, 20 public NetworkChangeNotifier::ConnectionTypeObserver,
21 public NetworkChangeNotifier::NetworkChangeObserver { 21 public NetworkChangeNotifier::NetworkChangeObserver,
22 public NetworkChangeNotifier::NetworkObserver {
22 public: 23 public:
23 // Note: |net_log| must remain valid throughout the lifetime of this 24 // Note: |net_log| must remain valid throughout the lifetime of this
24 // LoggingNetworkChangeObserver. 25 // LoggingNetworkChangeObserver.
25 explicit LoggingNetworkChangeObserver(NetLog* net_log); 26 explicit LoggingNetworkChangeObserver(NetLog* net_log);
26 ~LoggingNetworkChangeObserver() override; 27 ~LoggingNetworkChangeObserver() override;
27 28
28 private: 29 private:
29 // NetworkChangeNotifier::IPAddressObserver implementation. 30 // NetworkChangeNotifier::IPAddressObserver implementation.
30 void OnIPAddressChanged() override; 31 void OnIPAddressChanged() override;
31 32
32 // NetworkChangeNotifier::ConnectionTypeObserver implementation. 33 // NetworkChangeNotifier::ConnectionTypeObserver implementation.
33 void OnConnectionTypeChanged( 34 void OnConnectionTypeChanged(
34 NetworkChangeNotifier::ConnectionType type) override; 35 NetworkChangeNotifier::ConnectionType type) override;
35 36
36 // NetworkChangeNotifier::NetworkChangeObserver implementation. 37 // NetworkChangeNotifier::NetworkChangeObserver implementation.
37 void OnNetworkChanged(NetworkChangeNotifier::ConnectionType type) override; 38 void OnNetworkChanged(NetworkChangeNotifier::ConnectionType type) override;
38 39
39 private: 40 // NetworkChangeNotifier::NetworkObserver implementation.
41 void OnNetworkConnected(
42 NetworkChangeNotifier::NetworkHandle network) override;
43 void OnNetworkDisconnected(
44 NetworkChangeNotifier::NetworkHandle network) override;
45 void OnNetworkSoonToDisconnect(
46 NetworkChangeNotifier::NetworkHandle network) override;
47 void OnNetworkMadeDefault(
48 NetworkChangeNotifier::NetworkHandle network) override;
49
40 NetLog* net_log_; 50 NetLog* net_log_;
41 51
42 DISALLOW_COPY_AND_ASSIGN(LoggingNetworkChangeObserver); 52 DISALLOW_COPY_AND_ASSIGN(LoggingNetworkChangeObserver);
43 }; 53 };
44 54
45 } // namespace net 55 } // namespace net
46 56
47 #endif // NET_BASE_LOGGING_NETWORK_CHANGE_OBSERVER_H_ 57 #endif // NET_BASE_LOGGING_NETWORK_CHANGE_OBSERVER_H_
OLDNEW
« no previous file with comments | « no previous file | net/base/logging_network_change_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698