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

Side by Side Diff: net/nqe/network_quality_estimator.h

Issue 2347783003: [OfflinePages, NetworkQualityEstimator] Use NetworkQualityEstimator to decide on triggering Backgro… (Closed)
Patch Set: Addressed feedback Created 4 years, 3 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 | « components/offline_pages/background/request_coordinator_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_NQE_NETWORK_QUALITY_ESTIMATOR_H_ 5 #ifndef NET_NQE_NETWORK_QUALITY_ESTIMATOR_H_
6 #define NET_NQE_NETWORK_QUALITY_ESTIMATOR_H_ 6 #define NET_NQE_NETWORK_QUALITY_ESTIMATOR_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 NetworkQualityObservationSource source) = 0; 113 NetworkQualityObservationSource source) = 0;
114 114
115 protected: 115 protected:
116 ThroughputObserver() {} 116 ThroughputObserver() {}
117 virtual ~ThroughputObserver() {} 117 virtual ~ThroughputObserver() {}
118 118
119 private: 119 private:
120 DISALLOW_COPY_AND_ASSIGN(ThroughputObserver); 120 DISALLOW_COPY_AND_ASSIGN(ThroughputObserver);
121 }; 121 };
122 122
123 // Provides simple interface to obtain the effective connection type.
124 class NET_EXPORT NetworkQualityProvider {
125 public:
126 // Returns the current effective connection type.
127 virtual EffectiveConnectionType GetEffectiveConnectionType() const = 0;
128
129 virtual ~NetworkQualityProvider() {}
130
131 protected:
132 NetworkQualityProvider() {}
133
134 private:
135 DISALLOW_COPY_AND_ASSIGN(NetworkQualityProvider);
136 };
137
123 // Creates a new NetworkQualityEstimator. 138 // Creates a new NetworkQualityEstimator.
124 // |variation_params| is the map containing all field trial parameters 139 // |variation_params| is the map containing all field trial parameters
125 // related to NetworkQualityEstimator field trial. 140 // related to NetworkQualityEstimator field trial.
126 // |external_estimates_provider| may be NULL. 141 // |external_estimates_provider| may be NULL.
127 NetworkQualityEstimator( 142 NetworkQualityEstimator(
128 std::unique_ptr<ExternalEstimateProvider> external_estimates_provider, 143 std::unique_ptr<ExternalEstimateProvider> external_estimates_provider,
129 const std::map<std::string, std::string>& variation_params); 144 const std::map<std::string, std::string>& variation_params);
130 145
131 // Construct a NetworkQualityEstimator instance allowing for test 146 // Construct a NetworkQualityEstimator instance allowing for test
132 // configuration. Registers for network type change notifications so estimates 147 // configuration. Registers for network type change notifications so estimates
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 base::ThreadChecker thread_checker_; 643 base::ThreadChecker thread_checker_;
629 644
630 base::WeakPtrFactory<NetworkQualityEstimator> weak_ptr_factory_; 645 base::WeakPtrFactory<NetworkQualityEstimator> weak_ptr_factory_;
631 646
632 DISALLOW_COPY_AND_ASSIGN(NetworkQualityEstimator); 647 DISALLOW_COPY_AND_ASSIGN(NetworkQualityEstimator);
633 }; 648 };
634 649
635 } // namespace net 650 } // namespace net
636 651
637 #endif // NET_NQE_NETWORK_QUALITY_ESTIMATOR_H_ 652 #endif // NET_NQE_NETWORK_QUALITY_ESTIMATOR_H_
OLDNEW
« no previous file with comments | « components/offline_pages/background/request_coordinator_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698