Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 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 CHROME_BROWSER_NET_NQE_UI_NETWORK_QUALITY_ESTIMATOR_SERVICE_H_ | |
| 6 #define CHROME_BROWSER_NET_NQE_UI_NETWORK_QUALITY_ESTIMATOR_SERVICE_H_ | |
| 7 | |
| 8 #include <memory> | |
| 9 | |
| 10 #include "base/macros.h" | |
| 11 #include "base/memory/weak_ptr.h" | |
| 12 #include "base/single_thread_task_runner.h" | |
| 13 #include "components/keyed_service/core/keyed_service.h" | |
| 14 #include "net/nqe/network_quality_estimator.h" | |
| 15 | |
| 16 class IONetworkQualityObserver; | |
| 17 class Profile; | |
| 18 | |
| 19 class UINetworkQualityEstimatorService : public KeyedService { | |
| 20 public: | |
| 21 explicit UINetworkQualityEstimatorService(Profile* profile); | |
| 22 ~UINetworkQualityEstimatorService() override; | |
| 23 | |
| 24 void EffectiveConnectionTypeChanged( | |
| 25 net::NetworkQualityEstimator::EffectiveConnectionType type_); | |
| 26 | |
| 27 void Initialize(scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, | |
| 28 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner); | |
| 29 | |
| 30 void Shutdown() override; | |
| 31 | |
| 32 net::NetworkQualityEstimator::EffectiveConnectionType type() { return type_; } | |
| 33 | |
| 34 private: | |
| 35 net::NetworkQualityEstimator::EffectiveConnectionType type_; | |
| 36 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; | |
| 37 IONetworkQualityObserver* observer_; | |
|
tbansal1
2016/07/01 22:22:03
may be call it io_observer_
RyanSturm
2016/07/11 22:00:19
Done.
| |
| 38 | |
| 39 base::WeakPtrFactory<UINetworkQualityEstimatorService> weak_factory_; | |
|
tbansal1
2016/07/01 22:22:03
No need gorfor weak_factory_. Generally, it is pre
RyanSturm
2016/07/11 22:00:19
Acknowledged.
| |
| 40 | |
| 41 DISALLOW_COPY_AND_ASSIGN(UINetworkQualityEstimatorService); | |
| 42 }; | |
| 43 | |
| 44 #endif // CHROME_BROWSER_NET_NQE_UI_NETWORK_QUALITY_ESTIMATOR_SERVICE_H_ | |
| OLD | NEW |