| 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 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 if (!request.response_info.was_fetched_via_proxy) | 275 if (!request.response_info.was_fetched_via_proxy) |
| 276 beacon.server_ip = request.response_info.socket_address.host(); | 276 beacon.server_ip = request.response_info.socket_address.host(); |
| 277 else | 277 else |
| 278 beacon.server_ip.clear(); | 278 beacon.server_ip.clear(); |
| 279 beacon.protocol = GetDomainReliabilityProtocol( | 279 beacon.protocol = GetDomainReliabilityProtocol( |
| 280 request.response_info.connection_info, | 280 request.response_info.connection_info, |
| 281 request.response_info.ssl_info.is_valid()); | 281 request.response_info.ssl_info.is_valid()); |
| 282 beacon.http_response_code = response_code; | 282 beacon.http_response_code = response_code; |
| 283 beacon.start_time = request.load_timing_info.request_start; | 283 beacon.start_time = request.load_timing_info.request_start; |
| 284 beacon.elapsed = time_->NowTicks() - beacon.start_time; | 284 beacon.elapsed = time_->NowTicks() - beacon.start_time; |
| 285 beacon.domain = request.url.host(); |
| 285 context->OnBeacon(request.url, beacon); | 286 context->OnBeacon(request.url, beacon); |
| 286 } | 287 } |
| 287 | 288 |
| 288 void DomainReliabilityMonitor::InitReportingPref( | 289 void DomainReliabilityMonitor::InitReportingPref( |
| 289 PrefService* local_state_pref_service, | 290 PrefService* local_state_pref_service, |
| 290 const char* reporting_pref_name) { | 291 const char* reporting_pref_name) { |
| 291 reporting_pref_.Init( | 292 reporting_pref_.Init( |
| 292 reporting_pref_name, | 293 reporting_pref_name, |
| 293 local_state_pref_service, | 294 local_state_pref_service, |
| 294 base::Bind(&DomainReliabilityMonitor::OnReportingPrefChanged, | 295 base::Bind(&DomainReliabilityMonitor::OnReportingPrefChanged, |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 | 334 |
| 334 return NULL; | 335 return NULL; |
| 335 } | 336 } |
| 336 | 337 |
| 337 base::WeakPtr<DomainReliabilityMonitor> | 338 base::WeakPtr<DomainReliabilityMonitor> |
| 338 DomainReliabilityMonitor::MakeWeakPtr() { | 339 DomainReliabilityMonitor::MakeWeakPtr() { |
| 339 return weak_factory_.GetWeakPtr(); | 340 return weak_factory_.GetWeakPtr(); |
| 340 } | 341 } |
| 341 | 342 |
| 342 } // namespace domain_reliability | 343 } // namespace domain_reliability |
| OLD | NEW |