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