Chromium Code Reviews| 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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 172 }; | 172 }; |
| 173 | 173 |
| 174 // Record a GetHash result. |is_download| indicates if the get | 174 // Record a GetHash result. |is_download| indicates if the get |
| 175 // hash is triggered by download related lookup. | 175 // hash is triggered by download related lookup. |
| 176 static void RecordGetHashResult(bool is_download, | 176 static void RecordGetHashResult(bool is_download, |
| 177 ResultType result_type); | 177 ResultType result_type); |
| 178 | 178 |
| 179 // Record a V4 GetHash result. | 179 // Record a V4 GetHash result. |
| 180 static void RecordGetV4HashResult(ResultType result_type); | 180 static void RecordGetV4HashResult(ResultType result_type); |
| 181 | 181 |
| 182 // Enumerate V4 parsing failures for histogramming purposes. DO NOT CHANGE | |
|
Nathan Parker
2016/01/15 19:34:43
This could all go in a n anonymous namespace in th
kcarattini
2016/01/20 04:02:05
Done.
| |
| 183 // THE ORDERING OF THESE VALUES. | |
| 184 enum ParseResultType { | |
| 185 // Error parsing the protocol buffer from a string. | |
| 186 PARSE_FROM_STRING_ERROR, | |
|
Nathan Parker
2016/01/15 19:34:42
I like to add "= 1.." to each so that you can more
kcarattini
2016/01/20 04:02:05
Done.
| |
| 187 | |
| 188 // A match in the response had an unexpected THREAT_ENTRY_TYPE. | |
| 189 UNEXPECTED_THREAT_ENTRY_TYPE_ERROR, | |
| 190 | |
| 191 // A match in the response had an unexpected THREAT_TYPE. | |
| 192 UNEXPECTED_THREAT_TYPE_ERROR, | |
| 193 | |
| 194 // A match in the response had an unexpected PLATFORM_TYPE. | |
| 195 UNEXPECTED_PLATFORM_TYPE_ERROR, | |
| 196 | |
| 197 // A match in teh response contained no metadata where metadata was | |
| 198 // expected. | |
| 199 NO_METADATA_ERROR, | |
| 200 | |
| 201 // Memory space for histograms is determined by the max. ALWAYS | |
| 202 // ADD NEW VALUES BEFORE THIS ONE. | |
| 203 PARSE_GET_HASH_RESULT_MAX | |
| 204 }; | |
| 205 | |
| 206 // Record parsing errors of a GetHash result. | |
| 207 static void RecordParseGetHashResult(ParseResultType result_type); | |
| 208 | |
| 182 // Record HTTP response code when there's no error in fetching an HTTP | 209 // Record HTTP response code when there's no error in fetching an HTTP |
| 183 // request, and the error code, when there is. | 210 // request, and the error code, when there is. |
| 184 // |metric_name| is the name of the UMA metric to record the response code or | 211 // |metric_name| is the name of the UMA metric to record the response code or |
| 185 // error code against, |status| represents the status of the HTTP request, and | 212 // error code against, |status| represents the status of the HTTP request, and |
| 186 // |response code| represents the HTTP response code received from the server. | 213 // |response code| represents the HTTP response code received from the server. |
| 187 static void RecordHttpResponseOrErrorCode( | 214 static void RecordHttpResponseOrErrorCode( |
| 188 const char* metric_name, const net::URLRequestStatus& status, | 215 const char* metric_name, const net::URLRequestStatus& status, |
| 189 int response_code); | 216 int response_code); |
| 190 | 217 |
| 191 // Returns whether another update is currently scheduled. | 218 // Returns whether another update is currently scheduled. |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 517 AddChunksCallback callback) = 0; | 544 AddChunksCallback callback) = 0; |
| 518 | 545 |
| 519 // Delete chunks from the database. | 546 // Delete chunks from the database. |
| 520 virtual void DeleteChunks( | 547 virtual void DeleteChunks( |
| 521 scoped_ptr<std::vector<SBChunkDelete> > chunk_deletes) = 0; | 548 scoped_ptr<std::vector<SBChunkDelete> > chunk_deletes) = 0; |
| 522 }; | 549 }; |
| 523 | 550 |
| 524 } // namespace safe_browsing | 551 } // namespace safe_browsing |
| 525 | 552 |
| 526 #endif // CHROME_BROWSER_SAFE_BROWSING_PROTOCOL_MANAGER_H_ | 553 #endif // CHROME_BROWSER_SAFE_BROWSING_PROTOCOL_MANAGER_H_ |
| OLD | NEW |