| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // Helper class which handles communication with the SafeBrowsing servers for | 5 // Helper class which handles communication with the SafeBrowsing servers for |
| 6 // improved binary download protection. | 6 // improved binary download protection. |
| 7 | 7 |
| 8 #ifndef CHROME_BROWSER_SAFE_BROWSING_DOWNLOAD_PROTECTION_SERVICE_H_ | 8 #ifndef CHROME_BROWSER_SAFE_BROWSING_DOWNLOAD_PROTECTION_SERVICE_H_ |
| 9 #define CHROME_BROWSER_SAFE_BROWSING_DOWNLOAD_PROTECTION_SERVICE_H_ | 9 #define CHROME_BROWSER_SAFE_BROWSING_DOWNLOAD_PROTECTION_SERVICE_H_ |
| 10 #pragma once | 10 #pragma once |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 REASON_INVALID_REQUEST_PROTO, | 107 REASON_INVALID_REQUEST_PROTO, |
| 108 REASON_SERVER_PING_FAILED, | 108 REASON_SERVER_PING_FAILED, |
| 109 REASON_INVALID_RESPONSE_PROTO, | 109 REASON_INVALID_RESPONSE_PROTO, |
| 110 REASON_NOT_BINARY_FILE, | 110 REASON_NOT_BINARY_FILE, |
| 111 REASON_REQUEST_CANCELED, | 111 REASON_REQUEST_CANCELED, |
| 112 REASON_DOWNLOAD_DANGEROUS, | 112 REASON_DOWNLOAD_DANGEROUS, |
| 113 REASON_DOWNLOAD_SAFE, | 113 REASON_DOWNLOAD_SAFE, |
| 114 REASON_EMPTY_URL_CHAIN, | 114 REASON_EMPTY_URL_CHAIN, |
| 115 REASON_HTTPS_URL, | 115 REASON_HTTPS_URL, |
| 116 REASON_PING_DISABLED, | 116 REASON_PING_DISABLED, |
| 117 REASON_TRUSTED_EXECUTABLE, |
| 117 REASON_MAX // Always add new values before this one. | 118 REASON_MAX // Always add new values before this one. |
| 118 }; | 119 }; |
| 119 | 120 |
| 120 private: | 121 private: |
| 121 class CheckClientDownloadRequest; // Per-request state | 122 class CheckClientDownloadRequest; // Per-request state |
| 122 friend class DownloadProtectionServiceTest; | 123 friend class DownloadProtectionServiceTest; |
| 123 FRIEND_TEST_ALL_PREFIXES(DownloadProtectionServiceTest, | 124 FRIEND_TEST_ALL_PREFIXES(DownloadProtectionServiceTest, |
| 124 CheckClientDownloadValidateRequest); | 125 CheckClientDownloadValidateRequest); |
| 125 FRIEND_TEST_ALL_PREFIXES(DownloadProtectionServiceTest, | 126 FRIEND_TEST_ALL_PREFIXES(DownloadProtectionServiceTest, |
| 126 CheckClientDownloadSuccess); | 127 CheckClientDownloadSuccess); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 156 bool enabled_; | 157 bool enabled_; |
| 157 | 158 |
| 158 // SignatureUtil object, may be overridden for testing. | 159 // SignatureUtil object, may be overridden for testing. |
| 159 scoped_refptr<SignatureUtil> signature_util_; | 160 scoped_refptr<SignatureUtil> signature_util_; |
| 160 | 161 |
| 161 DISALLOW_COPY_AND_ASSIGN(DownloadProtectionService); | 162 DISALLOW_COPY_AND_ASSIGN(DownloadProtectionService); |
| 162 }; | 163 }; |
| 163 } // namespace safe_browsing | 164 } // namespace safe_browsing |
| 164 | 165 |
| 165 #endif // CHROME_BROWSER_SAFE_BROWSING_DOWNLOAD_PROTECTION_SERVICE_H_ | 166 #endif // CHROME_BROWSER_SAFE_BROWSING_DOWNLOAD_PROTECTION_SERVICE_H_ |
| OLD | NEW |