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

Side by Side Diff: chrome/browser/safe_browsing/incident_reporting_service.h

Issue 348433004: Prune all safe browsing incidents when already reported. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more test cleanups Created 6 years, 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_SERVICE_H_ 5 #ifndef CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_SERVICE_H_
6 #define CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_SERVICE_H_ 6 #define CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_SERVICE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 // A callback invoked on the UI thread after which incident collection has 147 // A callback invoked on the UI thread after which incident collection has
148 // completed. Incident report processing continues, either by waiting for 148 // completed. Incident report processing continues, either by waiting for
149 // environment data to arrive or by sending an incident report. 149 // environment data to arrive or by sending an incident report.
150 void OnCollectionTimeout(); 150 void OnCollectionTimeout();
151 151
152 // Populates |download_details| with information about the most recent 152 // Populates |download_details| with information about the most recent
153 // download. 153 // download.
154 void CollectDownloadDetails( 154 void CollectDownloadDetails(
155 ClientIncidentReport_DownloadDetails* download_details); 155 ClientIncidentReport_DownloadDetails* download_details);
156 156
157 // Record the incidents that were reported for future pruning.
158 void RecordReportedIncidents();
159
160 // Prunes incidents that have previously been reported.
161 void PruneReportedIncidents(ClientIncidentReport* report);
162
163 // Uploads an incident report if all data collection is complete. Incidents 157 // Uploads an incident report if all data collection is complete. Incidents
164 // originating from profiles that do not participate in safe browsing are 158 // originating from profiles that do not participate in safe browsing are
165 // dropped. 159 // dropped.
166 void UploadIfCollectionComplete(); 160 void UploadIfCollectionComplete();
167 161
168 // Cancels all uploads, discarding all reports and responses in progress. 162 // Cancels all uploads, discarding all reports and responses in progress.
169 void CancelAllReportUploads(); 163 void CancelAllReportUploads();
170 164
171 // Continues an upload after checking for the CSD whitelist killswitch. 165 // Continues an upload after checking for the CSD whitelist killswitch.
172 void OnKillSwitchResult(UploadContext* context, bool is_killswitch_on); 166 void OnKillSwitchResult(UploadContext* context, bool is_killswitch_on);
173 167
174 // Performs processing for a report after succesfully receiving a response. 168 // Performs processing for a report after succesfully receiving a response.
175 void HandleResponse(scoped_ptr<ClientIncidentReport> report, 169 void HandleResponse(const UploadContext& context);
176 scoped_ptr<ClientIncidentResponse> response);
177 170
178 // IncidentReportUploader::OnResultCallback implementation. 171 // IncidentReportUploader::OnResultCallback implementation.
179 void OnReportUploadResult(UploadContext* context, 172 void OnReportUploadResult(UploadContext* context,
180 IncidentReportUploader::Result result, 173 IncidentReportUploader::Result result,
181 scoped_ptr<ClientIncidentResponse> response); 174 scoped_ptr<ClientIncidentResponse> response);
182 175
183 // content::NotificationObserver methods. 176 // content::NotificationObserver methods.
184 virtual void Observe(int type, 177 virtual void Observe(int type,
185 const content::NotificationSource& source, 178 const content::NotificationSource& source,
186 const content::NotificationDetails& details) OVERRIDE; 179 const content::NotificationDetails& details) OVERRIDE;
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 // that are posted during normal processing (e.g., environment collection, 240 // that are posted during normal processing (e.g., environment collection,
248 // safe browsing database checks, and report uploads). 241 // safe browsing database checks, and report uploads).
249 base::WeakPtrFactory<IncidentReportingService> weak_ptr_factory_; 242 base::WeakPtrFactory<IncidentReportingService> weak_ptr_factory_;
250 243
251 DISALLOW_COPY_AND_ASSIGN(IncidentReportingService); 244 DISALLOW_COPY_AND_ASSIGN(IncidentReportingService);
252 }; 245 };
253 246
254 } // namespace safe_browsing 247 } // namespace safe_browsing
255 248
256 #endif // CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_SERVICE_H_ 249 #endif // CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_SERVICE_H_
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile.cc ('k') | chrome/browser/safe_browsing/incident_reporting_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698