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

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

Issue 2847813002: Reporting: Cap number of reports in cache. (Closed)
Patch Set: Make requested change. Created 3 years, 7 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 | « no previous file | net/reporting/reporting_cache.cc » ('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 #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 <set> 10 #include <set>
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 152
153 bool IsReportPendingForTesting(const ReportingReport* report) const { 153 bool IsReportPendingForTesting(const ReportingReport* report) const {
154 return base::ContainsKey(pending_reports_, report); 154 return base::ContainsKey(pending_reports_, report);
155 } 155 }
156 156
157 bool IsReportDoomedForTesting(const ReportingReport* report) const { 157 bool IsReportDoomedForTesting(const ReportingReport* report) const {
158 return base::ContainsKey(doomed_reports_, report); 158 return base::ContainsKey(doomed_reports_, report);
159 } 159 }
160 160
161 private: 161 private:
162 const ReportingReport* FindReportToEvict() const;
163
162 void MaybeAddWildcardClient(const ReportingClient* client); 164 void MaybeAddWildcardClient(const ReportingClient* client);
163 165
164 void MaybeRemoveWildcardClient(const ReportingClient* client); 166 void MaybeRemoveWildcardClient(const ReportingClient* client);
165 167
166 void GetWildcardClientsForDomainAndGroup( 168 void GetWildcardClientsForDomainAndGroup(
167 const std::string& domain, 169 const std::string& domain,
168 const std::string& group, 170 const std::string& group,
169 std::vector<const ReportingClient*>* clients_out) const; 171 std::vector<const ReportingClient*>* clients_out) const;
170 172
171 ReportingContext* context_; 173 ReportingContext* context_;
(...skipping 20 matching lines...) Expand all
192 // Reports that have been marked doomed (would have been deleted, but were 194 // Reports that have been marked doomed (would have been deleted, but were
193 // pending when the deletion was requested). 195 // pending when the deletion was requested).
194 std::unordered_set<const ReportingReport*> doomed_reports_; 196 std::unordered_set<const ReportingReport*> doomed_reports_;
195 197
196 DISALLOW_COPY_AND_ASSIGN(ReportingCache); 198 DISALLOW_COPY_AND_ASSIGN(ReportingCache);
197 }; 199 };
198 200
199 } // namespace net 201 } // namespace net
200 202
201 #endif // NET_REPORTING_REPORTING_CACHE_H_ 203 #endif // NET_REPORTING_REPORTING_CACHE_H_
OLDNEW
« no previous file with comments | « no previous file | net/reporting/reporting_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698