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

Unified Diff: net/base/logging_network_change_observer.h

Issue 1971853002: Move IOThread::LoggingNetworkChangeObserver to net/base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/io_thread.cc ('k') | net/base/logging_network_change_observer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/logging_network_change_observer.h
diff --git a/net/base/logging_network_change_observer.h b/net/base/logging_network_change_observer.h
new file mode 100644
index 0000000000000000000000000000000000000000..844acb3b70ec5aeff48d6da174ff6426c289d059
--- /dev/null
+++ b/net/base/logging_network_change_observer.h
@@ -0,0 +1,47 @@
+// Copyright (c) 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef NET_BASE_LOGGING_NETWORK_CHANGE_OBSERVER_H_
+#define NET_BASE_LOGGING_NETWORK_CHANGE_OBSERVER_H_
+
+#include "base/macros.h"
+#include "net/base/net_export.h"
+#include "net/base/network_change_notifier.h"
+
+namespace net {
+
+class NetLog;
+
+// A class that adds NetLog events for network change events coming from the
+// net::NetworkChangeNotifier.
+class NET_EXPORT LoggingNetworkChangeObserver
+ : public NetworkChangeNotifier::IPAddressObserver,
+ public NetworkChangeNotifier::ConnectionTypeObserver,
+ public NetworkChangeNotifier::NetworkChangeObserver {
+ public:
+ // Note: |net_log| must remain valid throughout the lifetime of this
+ // LoggingNetworkChangeObserver.
+ explicit LoggingNetworkChangeObserver(NetLog* net_log);
+ ~LoggingNetworkChangeObserver() override;
+
+ private:
+ // NetworkChangeNotifier::IPAddressObserver implementation.
+ void OnIPAddressChanged() override;
+
+ // NetworkChangeNotifier::ConnectionTypeObserver implementation.
+ void OnConnectionTypeChanged(
+ NetworkChangeNotifier::ConnectionType type) override;
+
+ // NetworkChangeNotifier::NetworkChangeObserver implementation.
+ void OnNetworkChanged(NetworkChangeNotifier::ConnectionType type) override;
+
+ private:
+ NetLog* net_log_;
+
+ DISALLOW_COPY_AND_ASSIGN(LoggingNetworkChangeObserver);
+};
+
+} // namespace net
+
+#endif // NET_BASE_LOGGING_NETWORK_CHANGE_OBSERVER_H_
« no previous file with comments | « chrome/browser/io_thread.cc ('k') | net/base/logging_network_change_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698