| 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 // 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 | 10 |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 DEPRECATED_REASON_HTTPS_URL, | 150 DEPRECATED_REASON_HTTPS_URL, |
| 151 REASON_PING_DISABLED, | 151 REASON_PING_DISABLED, |
| 152 REASON_TRUSTED_EXECUTABLE, | 152 REASON_TRUSTED_EXECUTABLE, |
| 153 REASON_OS_NOT_SUPPORTED, | 153 REASON_OS_NOT_SUPPORTED, |
| 154 REASON_DOWNLOAD_UNCOMMON, | 154 REASON_DOWNLOAD_UNCOMMON, |
| 155 REASON_DOWNLOAD_NOT_SUPPORTED, | 155 REASON_DOWNLOAD_NOT_SUPPORTED, |
| 156 REASON_INVALID_RESPONSE_VERDICT, | 156 REASON_INVALID_RESPONSE_VERDICT, |
| 157 REASON_ARCHIVE_WITHOUT_BINARIES, | 157 REASON_ARCHIVE_WITHOUT_BINARIES, |
| 158 REASON_DOWNLOAD_DANGEROUS_HOST, | 158 REASON_DOWNLOAD_DANGEROUS_HOST, |
| 159 REASON_DOWNLOAD_POTENTIALLY_UNWANTED, | 159 REASON_DOWNLOAD_POTENTIALLY_UNWANTED, |
| 160 REASON_UNSUPPORTED_URL_SCHEME, |
| 160 REASON_MAX // Always add new values before this one. | 161 REASON_MAX // Always add new values before this one. |
| 161 }; | 162 }; |
| 162 | 163 |
| 163 private: | 164 private: |
| 164 class CheckClientDownloadRequest; // Per-request state | 165 class CheckClientDownloadRequest; // Per-request state |
| 165 friend class DownloadProtectionServiceTest; | 166 friend class DownloadProtectionServiceTest; |
| 166 FRIEND_TEST_ALL_PREFIXES(DownloadProtectionServiceTest, | 167 FRIEND_TEST_ALL_PREFIXES(DownloadProtectionServiceTest, |
| 167 CheckClientDownloadWhitelistedUrl); | 168 CheckClientDownloadWhitelistedUrl); |
| 168 FRIEND_TEST_ALL_PREFIXES(DownloadProtectionServiceTest, | 169 FRIEND_TEST_ALL_PREFIXES(DownloadProtectionServiceTest, |
| 169 CheckClientDownloadValidateRequest); | 170 CheckClientDownloadValidateRequest); |
| 170 FRIEND_TEST_ALL_PREFIXES(DownloadProtectionServiceTest, | 171 FRIEND_TEST_ALL_PREFIXES(DownloadProtectionServiceTest, |
| 171 CheckClientDownloadSuccess); | 172 CheckClientDownloadSuccess); |
| 172 FRIEND_TEST_ALL_PREFIXES(DownloadProtectionServiceTest, | 173 FRIEND_TEST_ALL_PREFIXES(DownloadProtectionServiceTest, |
| 173 CheckClientDownloadHTTPS); | 174 CheckClientDownloadHTTPS); |
| 174 FRIEND_TEST_ALL_PREFIXES(DownloadProtectionServiceTest, | 175 FRIEND_TEST_ALL_PREFIXES(DownloadProtectionServiceTest, |
| 176 CheckClientDownloadBlob); |
| 177 FRIEND_TEST_ALL_PREFIXES(DownloadProtectionServiceTest, |
| 175 CheckClientDownloadZip); | 178 CheckClientDownloadZip); |
| 176 FRIEND_TEST_ALL_PREFIXES(DownloadProtectionServiceTest, | 179 FRIEND_TEST_ALL_PREFIXES(DownloadProtectionServiceTest, |
| 177 CheckClientDownloadFetchFailed); | 180 CheckClientDownloadFetchFailed); |
| 178 FRIEND_TEST_ALL_PREFIXES(DownloadProtectionServiceTest, | 181 FRIEND_TEST_ALL_PREFIXES(DownloadProtectionServiceTest, |
| 179 TestDownloadRequestTimeout); | 182 TestDownloadRequestTimeout); |
| 180 FRIEND_TEST_ALL_PREFIXES(DownloadProtectionServiceTest, | 183 FRIEND_TEST_ALL_PREFIXES(DownloadProtectionServiceTest, |
| 181 CheckClientCrxDownloadSuccess); | 184 CheckClientCrxDownloadSuccess); |
| 182 static const char kDownloadRequestUrl[]; | 185 static const char kDownloadRequestUrl[]; |
| 183 | 186 |
| 184 // Cancels all requests in |download_requests_|, and empties it, releasing | 187 // Cancels all requests in |download_requests_|, and empties it, releasing |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 | 227 |
| 225 // A list of callbacks to be run on the main thread when a | 228 // A list of callbacks to be run on the main thread when a |
| 226 // ClientDownloadRequest has been formed. | 229 // ClientDownloadRequest has been formed. |
| 227 ClientDownloadRequestCallbackList client_download_request_callbacks_; | 230 ClientDownloadRequestCallbackList client_download_request_callbacks_; |
| 228 | 231 |
| 229 DISALLOW_COPY_AND_ASSIGN(DownloadProtectionService); | 232 DISALLOW_COPY_AND_ASSIGN(DownloadProtectionService); |
| 230 }; | 233 }; |
| 231 } // namespace safe_browsing | 234 } // namespace safe_browsing |
| 232 | 235 |
| 233 #endif // CHROME_BROWSER_SAFE_BROWSING_DOWNLOAD_PROTECTION_SERVICE_H_ | 236 #endif // CHROME_BROWSER_SAFE_BROWSING_DOWNLOAD_PROTECTION_SERVICE_H_ |
| OLD | NEW |