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