| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_PROTOCOL_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_SAFE_BROWSING_PROTOCOL_MANAGER_H_ |
| 6 #define CHROME_BROWSER_SAFE_BROWSING_PROTOCOL_MANAGER_H_ | 6 #define CHROME_BROWSER_SAFE_BROWSING_PROTOCOL_MANAGER_H_ |
| 7 | 7 |
| 8 // A class that implements Chrome's interface with the SafeBrowsing protocol. | 8 // A class that implements Chrome's interface with the SafeBrowsing protocol. |
| 9 // See https://developers.google.com/safe-browsing/developers_guide_v2 for | 9 // See https://developers.google.com/safe-browsing/developers_guide_v2 for |
| 10 // protocol details. | 10 // protocol details. |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 | 156 |
| 157 // Gethash request failed (network error). | 157 // Gethash request failed (network error). |
| 158 GET_HASH_NETWORK_ERROR, | 158 GET_HASH_NETWORK_ERROR, |
| 159 | 159 |
| 160 // Gethash request returned HTTP result code other than 200 or 204. | 160 // Gethash request returned HTTP result code other than 200 or 204. |
| 161 GET_HASH_HTTP_ERROR, | 161 GET_HASH_HTTP_ERROR, |
| 162 | 162 |
| 163 // Gethash attempted during error backoff, no request sent. | 163 // Gethash attempted during error backoff, no request sent. |
| 164 GET_HASH_BACKOFF_ERROR, | 164 GET_HASH_BACKOFF_ERROR, |
| 165 | 165 |
| 166 // Gethash attempted before min wait duration elapsed, no request sent. |
| 167 GET_HASH_MIN_WAIT_DURATION_ERROR, |
| 168 |
| 166 // Memory space for histograms is determined by the max. ALWAYS | 169 // Memory space for histograms is determined by the max. ALWAYS |
| 167 // ADD NEW VALUES BEFORE THIS ONE. | 170 // ADD NEW VALUES BEFORE THIS ONE. |
| 168 GET_HASH_RESULT_MAX | 171 GET_HASH_RESULT_MAX |
| 169 }; | 172 }; |
| 170 | 173 |
| 171 // Record a GetHash result. |is_download| indicates if the get | 174 // Record a GetHash result. |is_download| indicates if the get |
| 172 // hash is triggered by download related lookup. | 175 // hash is triggered by download related lookup. |
| 173 static void RecordGetHashResult(bool is_download, | 176 static void RecordGetHashResult(bool is_download, |
| 174 ResultType result_type); | 177 ResultType result_type); |
| 175 | 178 |
| 179 // Record a V4 GetHash result. |
| 180 static void RecordGetV4HashResult(ResultType result_type); |
| 181 |
| 176 // Record HTTP response code when there's no error in fetching an HTTP | 182 // Record HTTP response code when there's no error in fetching an HTTP |
| 177 // request, and the error code, when there is. | 183 // request, and the error code, when there is. |
| 178 // |metric_name| is the name of the UMA metric to record the response code or | 184 // |metric_name| is the name of the UMA metric to record the response code or |
| 179 // error code against, |status| represents the status of the HTTP request, and | 185 // error code against, |status| represents the status of the HTTP request, and |
| 180 // |response code| represents the HTTP response code received from the server. | 186 // |response code| represents the HTTP response code received from the server. |
| 181 static void RecordHttpResponseOrErrorCode( | 187 static void RecordHttpResponseOrErrorCode( |
| 182 const char* metric_name, const net::URLRequestStatus& status, | 188 const char* metric_name, const net::URLRequestStatus& status, |
| 183 int response_code); | 189 int response_code); |
| 184 | 190 |
| 185 // Returns whether another update is currently scheduled. | 191 // Returns whether another update is currently scheduled. |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 AddChunksCallback callback) = 0; | 510 AddChunksCallback callback) = 0; |
| 505 | 511 |
| 506 // Delete chunks from the database. | 512 // Delete chunks from the database. |
| 507 virtual void DeleteChunks( | 513 virtual void DeleteChunks( |
| 508 scoped_ptr<std::vector<SBChunkDelete> > chunk_deletes) = 0; | 514 scoped_ptr<std::vector<SBChunkDelete> > chunk_deletes) = 0; |
| 509 }; | 515 }; |
| 510 | 516 |
| 511 } // namespace safe_browsing | 517 } // namespace safe_browsing |
| 512 | 518 |
| 513 #endif // CHROME_BROWSER_SAFE_BROWSING_PROTOCOL_MANAGER_H_ | 519 #endif // CHROME_BROWSER_SAFE_BROWSING_PROTOCOL_MANAGER_H_ |
| OLD | NEW |