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

Unified Diff: net/nqe/effective_connection_type_observer.h

Issue 2927453002: Make NQE a derived class of NetworkQualityProvider (Closed)
Patch Set: some more IWYU fixes Created 3 years, 6 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 | « net/BUILD.gn ('k') | net/nqe/network_quality_estimator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/nqe/effective_connection_type_observer.h
diff --git a/net/nqe/effective_connection_type_observer.h b/net/nqe/effective_connection_type_observer.h
new file mode 100644
index 0000000000000000000000000000000000000000..ba42b33deaad88c5ebea814424f327a5452bc5a1
--- /dev/null
+++ b/net/nqe/effective_connection_type_observer.h
@@ -0,0 +1,41 @@
+// Copyright 2017 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_NQE_NETWORK_QUALITY_EFFECTIVE_CONNECTION_TYPE_OBSERVER_H_
+#define NET_NQE_NETWORK_QUALITY_EFFECTIVE_CONNECTION_TYPE_OBSERVER_H_
+
+#include "base/compiler_specific.h"
+#include "base/macros.h"
+#include "net/base/net_export.h"
+#include "net/nqe/effective_connection_type.h"
+
+namespace net {
+
+// Observes changes in effective connection type.
+class NET_EXPORT EffectiveConnectionTypeObserver {
+ public:
+ // Notifies the observer of a change in the effective connection type.
+ // NetworkQualityEstimator computes the effective connection type once in
+ // every interval of duration
+ // |effective_connection_type_recomputation_interval_|. Additionally, when
+ // there is a change in the connection type of the device, then the
+ // effective connection type is immediately recomputed.
+ //
+ // If the computed effective connection type is different from the
+ // previously notified effective connection type, then all the registered
+ // observers are notified of the new effective connection type.
+ virtual void OnEffectiveConnectionTypeChanged(
+ EffectiveConnectionType type) = 0;
+
+ protected:
+ EffectiveConnectionTypeObserver() {}
+ virtual ~EffectiveConnectionTypeObserver() {}
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(EffectiveConnectionTypeObserver);
+};
+
+} // namespace net
+
+#endif // NET_NQE_NETWORK_QUALITY_EFFECTIVE_CONNECTION_TYPE_OBSERVER_H_
« no previous file with comments | « net/BUILD.gn ('k') | net/nqe/network_quality_estimator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698