| 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/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
| 10 #include "base/task_runner.h" | 10 #include "base/task_runner.h" |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 | 233 |
| 234 void DomainReliabilityMonitor::ClearContexts() { | 234 void DomainReliabilityMonitor::ClearContexts() { |
| 235 STLDeleteContainerPairSecondPointers( | 235 STLDeleteContainerPairSecondPointers( |
| 236 contexts_.begin(), contexts_.end()); | 236 contexts_.begin(), contexts_.end()); |
| 237 contexts_.clear(); | 237 contexts_.clear(); |
| 238 } | 238 } |
| 239 | 239 |
| 240 void DomainReliabilityMonitor::OnRequestLegComplete( | 240 void DomainReliabilityMonitor::OnRequestLegComplete( |
| 241 const RequestInfo& request) { | 241 const RequestInfo& request) { |
| 242 int response_code; | 242 int response_code; |
| 243 if (request.response_info.headers) | 243 if (request.response_info.headers.get()) |
| 244 response_code = request.response_info.headers->response_code(); | 244 response_code = request.response_info.headers->response_code(); |
| 245 else | 245 else |
| 246 response_code = -1; | 246 response_code = -1; |
| 247 std::string beacon_status; | 247 std::string beacon_status; |
| 248 | 248 |
| 249 int error_code = net::OK; | 249 int error_code = net::OK; |
| 250 if (request.status.status() == net::URLRequestStatus::FAILED) | 250 if (request.status.status() == net::URLRequestStatus::FAILED) |
| 251 error_code = request.status.error(); | 251 error_code = request.status.error(); |
| 252 | 252 |
| 253 DomainReliabilityContext* context = GetContextForHost(request.url.host()); | 253 DomainReliabilityContext* context = GetContextForHost(request.url.host()); |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 | 333 |
| 334 return NULL; | 334 return NULL; |
| 335 } | 335 } |
| 336 | 336 |
| 337 base::WeakPtr<DomainReliabilityMonitor> | 337 base::WeakPtr<DomainReliabilityMonitor> |
| 338 DomainReliabilityMonitor::MakeWeakPtr() { | 338 DomainReliabilityMonitor::MakeWeakPtr() { |
| 339 return weak_factory_.GetWeakPtr(); | 339 return weak_factory_.GetWeakPtr(); |
| 340 } | 340 } |
| 341 | 341 |
| 342 } // namespace domain_reliability | 342 } // namespace domain_reliability |
| OLD | NEW |