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

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: Update proto, Use interface, pass in ctor 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 // |this| is constructed on UI thread, but must be used on the IO thread.
21 thread_checker_.DetachFromThread();
22 }
23
24 NetworkQualityEstimatorProviderImpl::~NetworkQualityEstimatorProviderImpl() {
25 DCHECK(thread_checker_.CalledOnValidThread());
26 }
27
28 void NetworkQualityEstimatorProviderImpl::ProvideEstimator(
29 const base::Callback<void(net::NetworkQualityEstimator*)>& callback) {
30 DCHECK(thread_checker_.CalledOnValidThread());
31 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO));
32 callback.Run(io_thread_->globals()->network_quality_estimator.get());
33 }
34
35 } // namespace metrics
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698