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

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

Issue 562223002: Release resources properly from safe browsing incident reporting service. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@collect
Patch Set: clarity Created 6 years, 3 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 | chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.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 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_INCIDENT_REPORTING_SERVI CE_H_ 5 #ifndef CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_INCIDENT_REPORTING_SERVI CE_H_
6 #define CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_INCIDENT_REPORTING_SERVI CE_H_ 6 #define CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_INCIDENT_REPORTING_SERVI CE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 // tests to provide a fake finder. 122 // tests to provide a fake finder.
123 virtual scoped_ptr<LastDownloadFinder> CreateDownloadFinder( 123 virtual scoped_ptr<LastDownloadFinder> CreateDownloadFinder(
124 const LastDownloadFinder::LastDownloadCallback& callback); 124 const LastDownloadFinder::LastDownloadCallback& callback);
125 125
126 // Initiates an upload. Overridden by unit tests to provide a fake uploader. 126 // Initiates an upload. Overridden by unit tests to provide a fake uploader.
127 virtual scoped_ptr<IncidentReportUploader> StartReportUpload( 127 virtual scoped_ptr<IncidentReportUploader> StartReportUpload(
128 const IncidentReportUploader::OnResultCallback& callback, 128 const IncidentReportUploader::OnResultCallback& callback,
129 const scoped_refptr<net::URLRequestContextGetter>& request_context_getter, 129 const scoped_refptr<net::URLRequestContextGetter>& request_context_getter,
130 const ClientIncidentReport& report); 130 const ClientIncidentReport& report);
131 131
132 // Returns true if a report is currently being processed.
133 bool IsProcessingReport() const;
134
132 private: 135 private:
133 struct ProfileContext; 136 struct ProfileContext;
134 class UploadContext; 137 class UploadContext;
135 138
136 // A mapping of profiles to contexts holding state about received incidents. 139 // A mapping of profiles to contexts holding state about received incidents.
137 typedef std::map<Profile*, ProfileContext*> ProfileContextCollection; 140 typedef std::map<Profile*, ProfileContext*> ProfileContextCollection;
138 141
139 // Returns the context for |profile|, creating it if it does not exist. 142 // Returns the context for |profile|, creating it if it does not exist.
140 ProfileContext* GetOrCreateProfileContext(Profile* profile); 143 ProfileContext* GetOrCreateProfileContext(Profile* profile);
141 144
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 // that are posted during normal processing (e.g., environment collection, 310 // that are posted during normal processing (e.g., environment collection,
308 // safe browsing database checks, and report uploads). 311 // safe browsing database checks, and report uploads).
309 base::WeakPtrFactory<IncidentReportingService> weak_ptr_factory_; 312 base::WeakPtrFactory<IncidentReportingService> weak_ptr_factory_;
310 313
311 DISALLOW_COPY_AND_ASSIGN(IncidentReportingService); 314 DISALLOW_COPY_AND_ASSIGN(IncidentReportingService);
312 }; 315 };
313 316
314 } // namespace safe_browsing 317 } // namespace safe_browsing
315 318
316 #endif // CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_INCIDENT_REPORTING_SE RVICE_H_ 319 #endif // CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_INCIDENT_REPORTING_SE RVICE_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698