| 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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 // Handles the destruction of a profile. Incidents reported for the profile | 156 // Handles the destruction of a profile. Incidents reported for the profile |
| 157 // but not yet uploaded are dropped. | 157 // but not yet uploaded are dropped. |
| 158 void OnProfileDestroyed(Profile* profile); | 158 void OnProfileDestroyed(Profile* profile); |
| 159 | 159 |
| 160 // Returns an initialized profile that participates in safe browsing. Profiles | 160 // Returns an initialized profile that participates in safe browsing. Profiles |
| 161 // participating in extended safe browsing are preferred. | 161 // participating in extended safe browsing are preferred. |
| 162 Profile* FindEligibleProfile() const; | 162 Profile* FindEligibleProfile() const; |
| 163 | 163 |
| 164 // Adds |incident_data| to the service. The incident_time_msec field is | 164 // Adds |incident_data| to the service. The incident_time_msec field is |
| 165 // populated with the current time if the caller has not already done so. | 165 // populated with the current time if the caller has not already done so. |
| 166 void AddIncident(Profile* profile, | 166 void AddIncident(Profile* profile, scoped_ptr<Incident> incident); |
| 167 scoped_ptr<ClientIncidentReport_IncidentData> incident_data); | |
| 168 | 167 |
| 169 // Begins processing a report. If processing is already underway, ensures that | 168 // Begins processing a report. If processing is already underway, ensures that |
| 170 // collection tasks have completed or are running. | 169 // collection tasks have completed or are running. |
| 171 void BeginReportProcessing(); | 170 void BeginReportProcessing(); |
| 172 | 171 |
| 173 // Begins the process of collating incidents by waiting for incidents to | 172 // Begins the process of collating incidents by waiting for incidents to |
| 174 // arrive. This function is idempotent. | 173 // arrive. This function is idempotent. |
| 175 void BeginIncidentCollation(); | 174 void BeginIncidentCollation(); |
| 176 | 175 |
| 177 // Starts a task to collect environment data in the blocking pool. | 176 // Starts a task to collect environment data in the blocking pool. |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 // that are posted during normal processing (e.g., environment collection, | 328 // that are posted during normal processing (e.g., environment collection, |
| 330 // safe browsing database checks, and report uploads). | 329 // safe browsing database checks, and report uploads). |
| 331 base::WeakPtrFactory<IncidentReportingService> weak_ptr_factory_; | 330 base::WeakPtrFactory<IncidentReportingService> weak_ptr_factory_; |
| 332 | 331 |
| 333 DISALLOW_COPY_AND_ASSIGN(IncidentReportingService); | 332 DISALLOW_COPY_AND_ASSIGN(IncidentReportingService); |
| 334 }; | 333 }; |
| 335 | 334 |
| 336 } // namespace safe_browsing | 335 } // namespace safe_browsing |
| 337 | 336 |
| 338 #endif // CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_INCIDENT_REPORTING_SE
RVICE_H_ | 337 #endif // CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_INCIDENT_REPORTING_SE
RVICE_H_ |
| OLD | NEW |