Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(318)

Side by Side Diff: net/reporting/reporting_policy.cc

Issue 2740833004: Reporting: Implement garbage collector. (Closed)
Patch Set: rebase Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/reporting/reporting_policy.h ('k') | net/reporting/reporting_test_util.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 namespace net { 7 namespace net {
8 8
9 ReportingPolicy::ReportingPolicy() { 9 ReportingPolicy::ReportingPolicy()
10 : max_report_age(base::TimeDelta::FromMinutes(15)),
11 max_report_attempts(5),
12 garbage_collection_interval(base::TimeDelta::FromMinutes(5)) {
10 endpoint_backoff_policy.num_errors_to_ignore = 0; 13 endpoint_backoff_policy.num_errors_to_ignore = 0;
11 endpoint_backoff_policy.initial_delay_ms = 60 * 1000; // 1 minute 14 endpoint_backoff_policy.initial_delay_ms = 60 * 1000; // 1 minute
12 endpoint_backoff_policy.multiply_factor = 2.0; 15 endpoint_backoff_policy.multiply_factor = 2.0;
13 endpoint_backoff_policy.jitter_factor = 0.1; 16 endpoint_backoff_policy.jitter_factor = 0.1;
14 endpoint_backoff_policy.maximum_backoff_ms = -1; // 1 hour 17 endpoint_backoff_policy.maximum_backoff_ms = -1; // 1 hour
15 endpoint_backoff_policy.entry_lifetime_ms = -1; // infinite 18 endpoint_backoff_policy.entry_lifetime_ms = -1; // infinite
16 endpoint_backoff_policy.always_use_initial_delay = false; 19 endpoint_backoff_policy.always_use_initial_delay = false;
17 } 20 }
18 21
19 ReportingPolicy::ReportingPolicy(const ReportingPolicy& other) 22 ReportingPolicy::ReportingPolicy(const ReportingPolicy& other)
20 : endpoint_backoff_policy(other.endpoint_backoff_policy) {} 23 : max_report_age(other.max_report_age),
24 max_report_attempts(other.max_report_attempts),
25 endpoint_backoff_policy(other.endpoint_backoff_policy),
26 garbage_collection_interval(other.garbage_collection_interval) {}
21 27
22 ReportingPolicy::~ReportingPolicy() {} 28 ReportingPolicy::~ReportingPolicy() {}
23 29
24 } // namespace net 30 } // namespace net
OLDNEW
« no previous file with comments | « net/reporting/reporting_policy.h ('k') | net/reporting/reporting_test_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698