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

Side by Side Diff: net/reporting/reporting_garbage_collector.h

Issue 2740833004: Reporting: Implement garbage collector. (Closed)
Patch Set: Make requested changes. Created 3 years, 9 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/BUILD.gn ('k') | net/reporting/reporting_garbage_collector.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef NET_REPORTING_REPORTING_GARBAGE_COLLECTOR_H_
6 #define NET_REPORTING_REPORTING_GARBAGE_COLLECTOR_H_
7
8 #include "base/macros.h"
9 #include "base/time/time.h"
10 #include "net/base/net_export.h"
11
12 namespace net {
13
14 class ReportingCache;
15
16 // Removes reports that have remained undelivered for too long or that have been
17 // included in too many failed delivery attempts. Also, removes reports on
18 // network changes, if so configured.
19 class NET_EXPORT ReportingGarbageCollector {
Randy Smith (Not in Mondays) 2017/03/31 15:36:55 Why this design? What you've effectively got here
20 public:
21 struct Policy {
22 // How long a report can remain undelivered before being GCed.
23 base::TimeDelta report_max_age;
24
25 // How many times delivery of a report can fail before the report will be
26 // GCed.
27 int report_max_attempts;
28
29 // Whether reports are allowed to persist across network changes.
30 bool report_persist_across_network_changes;
31 };
32
33 static void CollectGarbage(ReportingCache* cache,
34 const Policy& policy,
35 base::TimeTicks now,
36 bool network_changed);
37
38 private:
39 DISALLOW_IMPLICIT_CONSTRUCTORS(ReportingGarbageCollector);
40 };
41
42 } // namespace net
43
44 #endif // NET_REPORTING_REPORTING_GARBAGE_COLLECTOR_H_
OLDNEW
« no previous file with comments | « net/BUILD.gn ('k') | net/reporting/reporting_garbage_collector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698