Chromium Code Reviews| Index: chrome/browser/net/nqe/ui_network_quality_estimator_service.h |
| diff --git a/chrome/browser/net/nqe/ui_network_quality_estimator_service.h b/chrome/browser/net/nqe/ui_network_quality_estimator_service.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..64bfcdac06a9a33dabf42a331f4bf802822090bc |
| --- /dev/null |
| +++ b/chrome/browser/net/nqe/ui_network_quality_estimator_service.h |
| @@ -0,0 +1,44 @@ |
| +// Copyright 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 CHROME_BROWSER_NET_NQE_UI_NETWORK_QUALITY_ESTIMATOR_SERVICE_H_ |
| +#define CHROME_BROWSER_NET_NQE_UI_NETWORK_QUALITY_ESTIMATOR_SERVICE_H_ |
| + |
| +#include <memory> |
| + |
| +#include "base/macros.h" |
| +#include "base/memory/weak_ptr.h" |
| +#include "base/single_thread_task_runner.h" |
| +#include "components/keyed_service/core/keyed_service.h" |
| +#include "net/nqe/network_quality_estimator.h" |
| + |
| +class IONetworkQualityObserver; |
| +class Profile; |
| + |
| +class UINetworkQualityEstimatorService : public KeyedService { |
| + public: |
| + explicit UINetworkQualityEstimatorService(Profile* profile); |
| + ~UINetworkQualityEstimatorService() override; |
| + |
| + void EffectiveConnectionTypeChanged( |
| + net::NetworkQualityEstimator::EffectiveConnectionType type_); |
| + |
| + void Initialize(scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, |
| + scoped_refptr<base::SingleThreadTaskRunner> io_task_runner); |
| + |
| + void Shutdown() override; |
| + |
| + net::NetworkQualityEstimator::EffectiveConnectionType type() { return type_; } |
| + |
| + private: |
| + net::NetworkQualityEstimator::EffectiveConnectionType type_; |
| + scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; |
| + IONetworkQualityObserver* observer_; |
|
tbansal1
2016/07/01 22:22:03
may be call it io_observer_
RyanSturm
2016/07/11 22:00:19
Done.
|
| + |
| + 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.
|
| + |
| + DISALLOW_COPY_AND_ASSIGN(UINetworkQualityEstimatorService); |
| +}; |
| + |
| +#endif // CHROME_BROWSER_NET_NQE_UI_NETWORK_QUALITY_ESTIMATOR_SERVICE_H_ |