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

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

Issue 2774403003: Reporting: Clarify "pending" reports, add README.md. (Closed)
Patch Set: 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/README.md ('k') | no next file » | 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 #ifndef NET_REPORTING_REPORTING_CACHE_H_ 5 #ifndef NET_REPORTING_REPORTING_CACHE_H_
6 #define NET_REPORTING_REPORTING_CACHE_H_ 6 #define NET_REPORTING_REPORTING_CACHE_H_
7 7
8 #include <map> 8 #include <map>
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 13 matching lines...) Expand all
24 namespace net { 24 namespace net {
25 25
26 struct ReportingReport; 26 struct ReportingReport;
27 27
28 // The cache holds undelivered reports and clients (per-origin endpoint 28 // The cache holds undelivered reports and clients (per-origin endpoint
29 // configurations) in memory. (It is not responsible for persisting them.) 29 // configurations) in memory. (It is not responsible for persisting them.)
30 // 30 //
31 // This corresponds roughly to the "Reporting cache" in the spec, except that 31 // This corresponds roughly to the "Reporting cache" in the spec, except that
32 // endpoints and clients are stored in a more structurally-convenient way, and 32 // endpoints and clients are stored in a more structurally-convenient way, and
33 // endpoint failures/retry-after are tracked in ReportingEndpointManager. 33 // endpoint failures/retry-after are tracked in ReportingEndpointManager.
34 //
35 // The cache implementation has the notion of "pending" reports. These are
36 // reports that are part of an active delivery attempt, so they won't be
37 // actually deallocated. Any attempt to remove a pending report wil mark it
38 // "doomed", which will cause it to be deallocated once it is no longer pending.
34 class NET_EXPORT ReportingCache { 39 class NET_EXPORT ReportingCache {
35 public: 40 public:
36 ReportingCache(); 41 ReportingCache();
37 42
38 ~ReportingCache(); 43 ~ReportingCache();
39 44
40 // Adds a report to the cache. 45 // Adds a report to the cache.
41 // 46 //
42 // All parameters correspond to the desired values for the relevant fields in 47 // All parameters correspond to the desired values for the relevant fields in
43 // ReportingReport. 48 // ReportingReport.
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 // Reports that have been marked "doomed" (would have been deleted, but were 162 // Reports that have been marked "doomed" (would have been deleted, but were
158 // pending when the deletion was requested). 163 // pending when the deletion was requested).
159 std::unordered_set<const ReportingReport*> doomed_reports_; 164 std::unordered_set<const ReportingReport*> doomed_reports_;
160 165
161 DISALLOW_COPY_AND_ASSIGN(ReportingCache); 166 DISALLOW_COPY_AND_ASSIGN(ReportingCache);
162 }; 167 };
163 168
164 } // namespace net 169 } // namespace net
165 170
166 #endif // NET_REPORTING_REPORTING_CACHE_H_ 171 #endif // NET_REPORTING_REPORTING_CACHE_H_
OLDNEW
« no previous file with comments | « net/reporting/README.md ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698