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

Side by Side Diff: chrome/browser/metrics/network_quality_estimator_provider_impl.cc

Issue 2605553002: Add EffectiveConnectionType enum to the system profile proto (Closed)
Patch Set: Rebased Created 3 years, 11 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
OLDNEW
(Empty)
1 // Copyright 2017 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 #include "chrome/browser/metrics/network_quality_estimator_provider_impl.h"
6
7 #include "chrome/browser/io_thread.h"
8 #include "content/public/browser/browser_thread.h"
9
10 namespace net {
11 class NetworkQualityEstimator;
12 }
13
14 namespace metrics {
15
16 NetworkQualityEstimatorProviderImpl::NetworkQualityEstimatorProviderImpl(
17 IOThread* io_thread)
18 : io_thread_(io_thread) {
19 DCHECK(io_thread_);
20 }
21
22 NetworkQualityEstimatorProviderImpl::~NetworkQualityEstimatorProviderImpl() {
23 DCHECK(thread_checker_.CalledOnValidThread());
24 }
25
26 scoped_refptr<base::SequencedTaskRunner>
27 NetworkQualityEstimatorProviderImpl::GetTaskRunner() {
28 DCHECK(thread_checker_.CalledOnValidThread());
29 // |this| is constructed on UI thread, but must be used on the IO thread.
30 thread_checker_.DetachFromThread();
31 return content::BrowserThread::GetTaskRunnerForThread(
32 content::BrowserThread::IO);
33 }
34
35 net::NetworkQualityEstimator*
36 NetworkQualityEstimatorProviderImpl::GetNetworkQualityEstimator() {
37 DCHECK(thread_checker_.CalledOnValidThread());
38 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO));
39 return io_thread_->globals()->network_quality_estimator.get();
40 }
41
42 } // namespace metrics
OLDNEW
« no previous file with comments | « chrome/browser/metrics/network_quality_estimator_provider_impl.h ('k') | components/metrics/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698