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

Unified Diff: chrome/browser/net/nqe/ui_network_quality_estimator_service.h

Issue 2103323007: Exposing NQE on the Browser UI thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 5 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
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..288b8270b64b5f5d2dbca1de581c55f2a9c5ca21
--- /dev/null
+++ b/chrome/browser/net/nqe/ui_network_quality_estimator_service.h
@@ -0,0 +1,49 @@
+// 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 Profile;
+
+namespace chrome_browser_net {
+
+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,
tbansal1 2016/07/13 00:07:28 pass as const ref?
RyanSturm 2016/07/13 17:28:15 Done.
+ scoped_refptr<base::SingleThreadTaskRunner> io_task_runner);
+
+ void Shutdown() override;
+
+ net::NetworkQualityEstimator::EffectiveConnectionType type() { return type_; }
tbansal1 2016/07/13 00:07:28 const function Also, I think you should move the b
RyanSturm 2016/07/13 17:28:14 Done.
+
+ private:
+ net::NetworkQualityEstimator::EffectiveConnectionType type_;
+ scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_;
tbansal1 2016/07/13 00:07:28 include: base/memory/ref_counted.h
RyanSturm 2016/07/13 17:28:14 Done.
+ class IONetworkQualityObserver;
tbansal1 2016/07/13 00:07:28 This should be the first line in the private.
RyanSturm 2016/07/13 17:28:14 Done.
+ IONetworkQualityObserver* io_observer_;
+ base::ThreadChecker thread_checker_;
+
+ base::WeakPtrFactory<UINetworkQualityEstimatorService> weak_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(UINetworkQualityEstimatorService);
+};
+
+} // namespace chrome_browser_net
+
+#endif // CHROME_BROWSER_NET_NQE_UI_NETWORK_QUALITY_ESTIMATOR_SERVICE_H_

Powered by Google App Engine
This is Rietveld 408576698