| 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 // This is used to keep some stats around. | 90 // This is used to keep some stats around. |
| 91 enum DownloadCheckResultReason { | 91 enum DownloadCheckResultReason { |
| 92 REASON_INVALID_URL, | 92 REASON_INVALID_URL, |
| 93 REASON_SB_DISABLED, | 93 REASON_SB_DISABLED, |
| 94 REASON_WHITELISTED_URL, | 94 REASON_WHITELISTED_URL, |
| 95 REASON_WHITELISTED_REFERRER, | 95 REASON_WHITELISTED_REFERRER, |
| 96 REASON_INVALID_REQUEST_PROTO, | 96 REASON_INVALID_REQUEST_PROTO, |
| 97 REASON_SERVER_PING_FAILED, | 97 REASON_SERVER_PING_FAILED, |
| 98 REASON_INVALID_RESPONSE_PROTO, | 98 REASON_INVALID_RESPONSE_PROTO, |
| 99 REASON_NOT_BINARY_FILE, | 99 REASON_NOT_BINARY_FILE, |
| 100 REASON_REQUEST_CANCELED, |
| 100 REASON_MAX // Always add new values before this one. | 101 REASON_MAX // Always add new values before this one. |
| 101 }; | 102 }; |
| 102 | 103 |
| 103 private: | 104 private: |
| 104 class CheckClientDownloadRequest; // Per-request state | 105 class CheckClientDownloadRequest; // Per-request state |
| 105 friend class DownloadProtectionServiceTest; | 106 friend class DownloadProtectionServiceTest; |
| 106 FRIEND_TEST_ALL_PREFIXES(DownloadProtectionServiceTest, | 107 FRIEND_TEST_ALL_PREFIXES(DownloadProtectionServiceTest, |
| 107 CheckClientDownloadValidateRequest); | 108 CheckClientDownloadValidateRequest); |
| 108 FRIEND_TEST_ALL_PREFIXES(DownloadProtectionServiceTest, | 109 FRIEND_TEST_ALL_PREFIXES(DownloadProtectionServiceTest, |
| 109 CheckClientDownloadSuccess); | 110 CheckClientDownloadSuccess); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 136 std::set<scoped_refptr<CheckClientDownloadRequest> > download_requests_; | 137 std::set<scoped_refptr<CheckClientDownloadRequest> > download_requests_; |
| 137 | 138 |
| 138 // Keeps track of the state of the service. | 139 // Keeps track of the state of the service. |
| 139 bool enabled_; | 140 bool enabled_; |
| 140 | 141 |
| 141 DISALLOW_COPY_AND_ASSIGN(DownloadProtectionService); | 142 DISALLOW_COPY_AND_ASSIGN(DownloadProtectionService); |
| 142 }; | 143 }; |
| 143 } // namespace safe_browsing | 144 } // namespace safe_browsing |
| 144 | 145 |
| 145 #endif // CHROME_BROWSER_SAFE_BROWSING_DOWNLOAD_PROTECTION_SERVICE_H_ | 146 #endif // CHROME_BROWSER_SAFE_BROWSING_DOWNLOAD_PROTECTION_SERVICE_H_ |
| OLD | NEW |