| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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_ |
| OLD | NEW |