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 27 matching lines...) Expand all Loading... |
38 // TODO(noelutz): we're missing some fields here: server IPs, | 38 // TODO(noelutz): we're missing some fields here: server IPs, |
39 // tab URL redirect chain, ... | 39 // tab URL redirect chain, ... |
40 struct DownloadInfo { | 40 struct DownloadInfo { |
41 FilePath local_file; // Where the download is currently stored. | 41 FilePath local_file; // Where the download is currently stored. |
42 FilePath target_file; // Where the download will eventually be stored. | 42 FilePath target_file; // Where the download will eventually be stored. |
43 std::vector<GURL> download_url_chain; | 43 std::vector<GURL> download_url_chain; |
44 GURL referrer_url; | 44 GURL referrer_url; |
45 std::string sha256_hash; | 45 std::string sha256_hash; |
46 int64 total_bytes; | 46 int64 total_bytes; |
47 bool user_initiated; | 47 bool user_initiated; |
| 48 std::string remote_address; |
48 DownloadInfo(); | 49 DownloadInfo(); |
49 ~DownloadInfo(); | 50 ~DownloadInfo(); |
50 std::string DebugString() const; | 51 std::string DebugString() const; |
51 // Creates a DownloadInfo from a DownloadItem object. | 52 // Creates a DownloadInfo from a DownloadItem object. |
52 static DownloadInfo FromDownloadItem(const DownloadItem& item); | 53 static DownloadInfo FromDownloadItem(const DownloadItem& item); |
53 }; | 54 }; |
54 | 55 |
55 enum DownloadCheckResult { | 56 enum DownloadCheckResult { |
56 SAFE, | 57 SAFE, |
57 DANGEROUS, | 58 DANGEROUS, |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 // SignatureUtil object, may be overridden for testing. | 181 // SignatureUtil object, may be overridden for testing. |
181 scoped_refptr<SignatureUtil> signature_util_; | 182 scoped_refptr<SignatureUtil> signature_util_; |
182 | 183 |
183 int64 download_request_timeout_ms_; | 184 int64 download_request_timeout_ms_; |
184 | 185 |
185 DISALLOW_COPY_AND_ASSIGN(DownloadProtectionService); | 186 DISALLOW_COPY_AND_ASSIGN(DownloadProtectionService); |
186 }; | 187 }; |
187 } // namespace safe_browsing | 188 } // namespace safe_browsing |
188 | 189 |
189 #endif // CHROME_BROWSER_SAFE_BROWSING_DOWNLOAD_PROTECTION_SERVICE_H_ | 190 #endif // CHROME_BROWSER_SAFE_BROWSING_DOWNLOAD_PROTECTION_SERVICE_H_ |
OLD | NEW |