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 "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/profiler/scoped_tracker.h" | 9 #include "base/profiler/scoped_tracker.h" |
10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 // Make sure the URLRequestContext actually lives on what was declared to be | 133 // Make sure the URLRequestContext actually lives on what was declared to be |
134 // the network thread. | 134 // the network thread. |
135 DCHECK(url_request_context_getter->GetNetworkTaskRunner()-> | 135 DCHECK(url_request_context_getter->GetNetworkTaskRunner()-> |
136 RunsTasksOnCurrentThread()); | 136 RunsTasksOnCurrentThread()); |
137 | 137 |
138 uploader_ = DomainReliabilityUploader::Create(time_.get(), | 138 uploader_ = DomainReliabilityUploader::Create(time_.get(), |
139 url_request_context_getter); | 139 url_request_context_getter); |
140 } | 140 } |
141 | 141 |
142 void DomainReliabilityMonitor::AddBakedInConfigs() { | 142 void DomainReliabilityMonitor::AddBakedInConfigs() { |
143 // TODO(ttuttle): Remove ScopedTracker below once crbug.com/436671 is fixed. | |
144 tracked_objects::ScopedTracker tracking_profile( | |
145 FROM_HERE_WITH_EXPLICIT_FUNCTION( | |
146 "436671 DomainReliabilityMonitor::AddBakedInConfigs")); | |
147 | |
148 DCHECK(OnNetworkThread()); | 143 DCHECK(OnNetworkThread()); |
149 DCHECK(moved_to_network_thread_); | 144 DCHECK(moved_to_network_thread_); |
150 | 145 |
151 for (size_t i = 0; kBakedInJsonConfigs[i]; ++i) { | 146 for (size_t i = 0; kBakedInJsonConfigs[i]; ++i) { |
152 base::StringPiece json(kBakedInJsonConfigs[i]); | 147 base::StringPiece json(kBakedInJsonConfigs[i]); |
153 scoped_ptr<const DomainReliabilityConfig> config = | 148 scoped_ptr<const DomainReliabilityConfig> config = |
154 DomainReliabilityConfig::FromJSON(json); | 149 DomainReliabilityConfig::FromJSON(json); |
155 if (!config) | 150 if (!config) |
156 continue; | 151 continue; |
157 context_manager_.AddContextForConfig(config.Pass()); | 152 context_manager_.AddContextForConfig(config.Pass()); |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 return; | 323 return; |
329 context_manager_.RouteBeacon(request.url, beacon); | 324 context_manager_.RouteBeacon(request.url, beacon); |
330 } | 325 } |
331 | 326 |
332 base::WeakPtr<DomainReliabilityMonitor> | 327 base::WeakPtr<DomainReliabilityMonitor> |
333 DomainReliabilityMonitor::MakeWeakPtr() { | 328 DomainReliabilityMonitor::MakeWeakPtr() { |
334 return weak_factory_.GetWeakPtr(); | 329 return weak_factory_.GetWeakPtr(); |
335 } | 330 } |
336 | 331 |
337 } // namespace domain_reliability | 332 } // namespace domain_reliability |
OLD | NEW |