OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "components/domain_reliability/monitor.h" | 5 #include "components/domain_reliability/monitor.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
148 | 148 |
149 // Make sure the URLRequestContext actually lives on what was declared to be | 149 // Make sure the URLRequestContext actually lives on what was declared to be |
150 // the network thread. | 150 // the network thread. |
151 DCHECK(url_request_context_getter->GetNetworkTaskRunner()-> | 151 DCHECK(url_request_context_getter->GetNetworkTaskRunner()-> |
152 RunsTasksOnCurrentThread()); | 152 RunsTasksOnCurrentThread()); |
153 | 153 |
154 uploader_ = DomainReliabilityUploader::Create(time_.get(), | 154 uploader_ = DomainReliabilityUploader::Create(time_.get(), |
155 url_request_context_getter); | 155 url_request_context_getter); |
156 } | 156 } |
157 | 157 |
158 void DomainReliabilityMonitor::Shutdown() { | |
159 uploader_->Shutdown(); | |
mmenke
2016/09/27 16:56:15
If it can, we should have a test for it. If it ca
| |
160 } | |
161 | |
158 void DomainReliabilityMonitor::AddBakedInConfigs() { | 162 void DomainReliabilityMonitor::AddBakedInConfigs() { |
159 DCHECK(OnNetworkThread()); | 163 DCHECK(OnNetworkThread()); |
160 DCHECK(moved_to_network_thread_); | 164 DCHECK(moved_to_network_thread_); |
161 | 165 |
162 for (size_t i = 0; kBakedInJsonConfigs[i]; ++i) { | 166 for (size_t i = 0; kBakedInJsonConfigs[i]; ++i) { |
163 base::StringPiece json(kBakedInJsonConfigs[i]); | 167 base::StringPiece json(kBakedInJsonConfigs[i]); |
164 std::unique_ptr<const DomainReliabilityConfig> config = | 168 std::unique_ptr<const DomainReliabilityConfig> config = |
165 DomainReliabilityConfig::FromJSON(json); | 169 DomainReliabilityConfig::FromJSON(json); |
166 if (!config) { | 170 if (!config) { |
167 DLOG(WARNING) << "Baked-in Domain Reliability config failed to parse: " | 171 DLOG(WARNING) << "Baked-in Domain Reliability config failed to parse: " |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
415 break; | 419 break; |
416 } | 420 } |
417 } | 421 } |
418 | 422 |
419 base::WeakPtr<DomainReliabilityMonitor> | 423 base::WeakPtr<DomainReliabilityMonitor> |
420 DomainReliabilityMonitor::MakeWeakPtr() { | 424 DomainReliabilityMonitor::MakeWeakPtr() { |
421 return weak_factory_.GetWeakPtr(); | 425 return weak_factory_.GetWeakPtr(); |
422 } | 426 } |
423 | 427 |
424 } // namespace domain_reliability | 428 } // namespace domain_reliability |
OLD | NEW |