| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 "net/reporting/reporting_policy.h" | 5 #include "net/reporting/reporting_policy.h" |
| 6 | 6 |
| 7 #include "base/time/time.h" | 7 #include "base/time/time.h" |
| 8 | 8 |
| 9 namespace net { | 9 namespace net { |
| 10 | 10 |
| 11 ReportingPolicy::ReportingPolicy() | 11 ReportingPolicy::ReportingPolicy() |
| 12 : persistence_interval(base::TimeDelta::FromMinutes(1)), | 12 : persistence_interval(base::TimeDelta::FromMinutes(1)), |
| 13 persist_reports_across_restarts(false), | 13 persist_reports_across_restarts(false), |
| 14 persist_clients_across_restarts(true), | 14 persist_clients_across_restarts(true), |
| 15 garbage_collection_interval(base::TimeDelta::FromMinutes(5)), | 15 garbage_collection_interval(base::TimeDelta::FromMinutes(5)), |
| 16 max_report_age(base::TimeDelta::FromMinutes(15)), | 16 max_report_age(base::TimeDelta::FromMinutes(15)), |
| 17 max_report_attempts(5) { | 17 max_report_attempts(5), |
| 18 clear_reports_on_network_changes(true), |
| 19 clear_clients_on_network_changes(false) { |
| 18 endpoint_backoff_policy.num_errors_to_ignore = 0; | 20 endpoint_backoff_policy.num_errors_to_ignore = 0; |
| 19 endpoint_backoff_policy.initial_delay_ms = 60 * 1000; // 1 minute | 21 endpoint_backoff_policy.initial_delay_ms = 60 * 1000; // 1 minute |
| 20 endpoint_backoff_policy.multiply_factor = 2.0; | 22 endpoint_backoff_policy.multiply_factor = 2.0; |
| 21 endpoint_backoff_policy.jitter_factor = 0.1; | 23 endpoint_backoff_policy.jitter_factor = 0.1; |
| 22 endpoint_backoff_policy.maximum_backoff_ms = -1; // 1 hour | 24 endpoint_backoff_policy.maximum_backoff_ms = -1; // 1 hour |
| 23 endpoint_backoff_policy.entry_lifetime_ms = -1; // infinite | 25 endpoint_backoff_policy.entry_lifetime_ms = -1; // infinite |
| 24 endpoint_backoff_policy.always_use_initial_delay = false; | 26 endpoint_backoff_policy.always_use_initial_delay = false; |
| 25 } | 27 } |
| 26 | 28 |
| 27 ReportingPolicy::ReportingPolicy(const ReportingPolicy& other) | 29 ReportingPolicy::ReportingPolicy(const ReportingPolicy& other) |
| 28 : endpoint_backoff_policy(other.endpoint_backoff_policy), | 30 : endpoint_backoff_policy(other.endpoint_backoff_policy), |
| 29 persistence_interval(other.persistence_interval), | 31 persistence_interval(other.persistence_interval), |
| 30 persist_reports_across_restarts(other.persist_reports_across_restarts), | 32 persist_reports_across_restarts(other.persist_reports_across_restarts), |
| 31 persist_clients_across_restarts(other.persist_clients_across_restarts), | 33 persist_clients_across_restarts(other.persist_clients_across_restarts), |
| 32 garbage_collection_interval(other.garbage_collection_interval), | 34 garbage_collection_interval(other.garbage_collection_interval), |
| 33 max_report_age(other.max_report_age), | 35 max_report_age(other.max_report_age), |
| 34 max_report_attempts(other.max_report_attempts) {} | 36 max_report_attempts(other.max_report_attempts), |
| 37 clear_reports_on_network_changes(other.clear_reports_on_network_changes), |
| 38 clear_clients_on_network_changes(other.clear_clients_on_network_changes) { |
| 39 } |
| 35 | 40 |
| 36 ReportingPolicy::~ReportingPolicy() {} | 41 ReportingPolicy::~ReportingPolicy() {} |
| 37 | 42 |
| 38 } // namespace net | 43 } // namespace net |
| OLD | NEW |