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 #ifndef NET_REPORTING_REPORTING_GARBAGE_COLLECTOR_H_ | 5 #ifndef NET_REPORTING_REPORTING_GARBAGE_COLLECTOR_H_ |
6 #define NET_REPORTING_REPORTING_GARBAGE_COLLECTOR_H_ | 6 #define NET_REPORTING_REPORTING_GARBAGE_COLLECTOR_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "net/base/net_export.h" | 10 #include "net/base/net_export.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 // included in too many failed delivery attempts. | 21 // included in too many failed delivery attempts. |
22 class NET_EXPORT ReportingGarbageCollector { | 22 class NET_EXPORT ReportingGarbageCollector { |
23 public: | 23 public: |
24 // Creates a ReportingGarbageCollector. |context| must outlive the garbage | 24 // Creates a ReportingGarbageCollector. |context| must outlive the garbage |
25 // collector. | 25 // collector. |
26 static std::unique_ptr<ReportingGarbageCollector> Create( | 26 static std::unique_ptr<ReportingGarbageCollector> Create( |
27 ReportingContext* context); | 27 ReportingContext* context); |
28 | 28 |
29 virtual ~ReportingGarbageCollector(); | 29 virtual ~ReportingGarbageCollector(); |
30 | 30 |
31 // Initializes the GarbageCollector, which performs an initial garbage | |
32 // collection pass over any data already in the Cache. | |
33 virtual void Initialize() = 0; | |
34 | |
35 // Replaces the internal Timer used for scheduling garbage collection passes | 31 // Replaces the internal Timer used for scheduling garbage collection passes |
36 // with a caller-specified one so that unittests can provide a MockTimer. | 32 // with a caller-specified one so that unittests can provide a MockTimer. |
37 virtual void SetTimerForTesting(std::unique_ptr<base::Timer> timer) = 0; | 33 virtual void SetTimerForTesting(std::unique_ptr<base::Timer> timer) = 0; |
38 }; | 34 }; |
39 | 35 |
40 } // namespace net | 36 } // namespace net |
41 | 37 |
42 #endif // NET_REPORTING_REPORTING_GARBAGE_COLLECTOR_H_ | 38 #endif // NET_REPORTING_REPORTING_GARBAGE_COLLECTOR_H_ |
OLD | NEW |