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_BROWSING_DATA_REMOVER_H_ | 5 #ifndef NET_REPORTING_REPORTING_BROWSING_DATA_REMOVER_H_ |
6 #define NET_REPORTING_REPORTING_BROWSING_DATA_REMOVER_H_ | 6 #define NET_REPORTING_REPORTING_BROWSING_DATA_REMOVER_H_ |
7 | 7 |
| 8 #include <memory> |
| 9 |
8 #include "base/callback.h" | 10 #include "base/callback.h" |
9 #include "base/macros.h" | 11 #include "base/macros.h" |
10 #include "net/base/net_export.h" | 12 #include "net/base/net_export.h" |
11 #include "url/gurl.h" | 13 #include "url/gurl.h" |
12 | 14 |
13 namespace net { | 15 namespace net { |
14 | 16 |
15 class ReportingContext; | 17 class ReportingContext; |
16 | 18 |
17 // Clears browsing data (reports and clients) from the Reporting system. | 19 // Clears browsing data (reports and clients) from the Reporting system. |
18 class NET_EXPORT ReportingBrowsingDataRemover { | 20 class NET_EXPORT ReportingBrowsingDataRemover { |
19 public: | 21 public: |
20 enum DataType { | 22 enum DataType { |
21 DATA_TYPE_REPORTS = 0x1, | 23 DATA_TYPE_REPORTS = 0x1, |
22 DATA_TYPE_CLIENTS = 0x2, | 24 DATA_TYPE_CLIENTS = 0x2, |
23 }; | 25 }; |
24 | 26 |
25 static void RemoveBrowsingData( | 27 // Creates a ReportingBrowsingDataRemover. |context| must outlive the |
26 ReportingContext* context, | 28 // browsing data remover. |
| 29 static std::unique_ptr<ReportingBrowsingDataRemover> Create( |
| 30 ReportingContext* context); |
| 31 |
| 32 virtual ~ReportingBrowsingDataRemover(); |
| 33 |
| 34 // Removes browsing data from the Reporting system. |data_type_mask| specifies |
| 35 // which types of data to remove: reports queued by browser features and/or |
| 36 // clients (endpoints configured by origins). |origin_filter|, if not null, |
| 37 // specifies which origins' data to remove. |
| 38 virtual void RemoveBrowsingData( |
27 int data_type_mask, | 39 int data_type_mask, |
28 base::Callback<bool(const GURL&)> origin_filter); | 40 base::Callback<bool(const GURL&)> origin_filter) = 0; |
29 | |
30 private: | |
31 DISALLOW_IMPLICIT_CONSTRUCTORS(ReportingBrowsingDataRemover); | |
32 }; | 41 }; |
33 | 42 |
34 } // namespace net | 43 } // namespace net |
35 | 44 |
36 #endif // NET_REPORTING_REPORTING_BROWSING_DATA_REMOVER_H_ | 45 #endif // NET_REPORTING_REPORTING_BROWSING_DATA_REMOVER_H_ |
OLD | NEW |