| 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 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 // Don't report requests that weren't supposed to send cookies. | 287 // Don't report requests that weren't supposed to send cookies. |
| 288 if (request.load_flags & net::LOAD_DO_NOT_SEND_COOKIES) | 288 if (request.load_flags & net::LOAD_DO_NOT_SEND_COOKIES) |
| 289 return false; | 289 return false; |
| 290 | 290 |
| 291 // Report requests that accessed the network or failed with an error code | 291 // Report requests that accessed the network or failed with an error code |
| 292 // that Domain Reliability is interested in. | 292 // that Domain Reliability is interested in. |
| 293 if (request.response_info.network_accessed) | 293 if (request.response_info.network_accessed) |
| 294 return true; | 294 return true; |
| 295 if (URLRequestStatusToNetError(request.status) != net::OK) | 295 if (URLRequestStatusToNetError(request.status) != net::OK) |
| 296 return true; | 296 return true; |
| 297 if (request.details.quic_port_migration_detected) |
| 298 return true; |
| 297 | 299 |
| 298 return false; | 300 return false; |
| 299 } | 301 } |
| 300 | 302 |
| 301 void DomainReliabilityMonitor::OnRequestLegComplete( | 303 void DomainReliabilityMonitor::OnRequestLegComplete( |
| 302 const RequestInfo& request) { | 304 const RequestInfo& request) { |
| 303 // Check these again because unit tests call this directly. | 305 // Check these again because unit tests call this directly. |
| 304 DCHECK(OnNetworkThread()); | 306 DCHECK(OnNetworkThread()); |
| 305 DCHECK(discard_uploads_set_); | 307 DCHECK(discard_uploads_set_); |
| 306 | 308 |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 break; | 412 break; |
| 411 } | 413 } |
| 412 } | 414 } |
| 413 | 415 |
| 414 base::WeakPtr<DomainReliabilityMonitor> | 416 base::WeakPtr<DomainReliabilityMonitor> |
| 415 DomainReliabilityMonitor::MakeWeakPtr() { | 417 DomainReliabilityMonitor::MakeWeakPtr() { |
| 416 return weak_factory_.GetWeakPtr(); | 418 return weak_factory_.GetWeakPtr(); |
| 417 } | 419 } |
| 418 | 420 |
| 419 } // namespace domain_reliability | 421 } // namespace domain_reliability |
| OLD | NEW |