| 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 // BrowserFeatureExtractor computes various browser features for client-side | 5 // BrowserFeatureExtractor computes various browser features for client-side |
| 6 // phishing detection. For now it does a bunch of lookups in the history | 6 // phishing detection. For now it does a bunch of lookups in the history |
| 7 // service to see whether a particular URL has been visited before by the | 7 // service to see whether a particular URL has been visited before by the |
| 8 // user. | 8 // user. |
| 9 | 9 |
| 10 #ifndef CHROME_BROWSER_SAFE_BROWSING_BROWSER_FEATURE_EXTRACTOR_H_ | 10 #ifndef CHROME_BROWSER_SAFE_BROWSING_BROWSER_FEATURE_EXTRACTOR_H_ |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 | 32 |
| 33 namespace content { | 33 namespace content { |
| 34 class WebContents; | 34 class WebContents; |
| 35 } | 35 } |
| 36 | 36 |
| 37 namespace safe_browsing { | 37 namespace safe_browsing { |
| 38 class ClientMalwareRequest; | 38 class ClientMalwareRequest; |
| 39 class ClientPhishingRequest; | 39 class ClientPhishingRequest; |
| 40 class ClientSideDetectionService; | 40 class ClientSideDetectionService; |
| 41 | 41 |
| 42 typedef std::map<std::string, std::set<std::string> > IPHostMap; | 42 typedef std::map<std::string, std::set<std::string> > IPUrlMap; |
| 43 | 43 |
| 44 struct BrowseInfo { | 44 struct BrowseInfo { |
| 45 // List of IPv4 and IPv6 addresses from which content was requested | 45 // List of IPv4 and IPv6 addresses from which content was requested |
| 46 // together with the hosts on it, while browsing to the |url|. | 46 // together with the hosts on it, while browsing to the |url|. |
| 47 IPHostMap ips; | 47 IPUrlMap ips; |
| 48 | 48 |
| 49 // If a SafeBrowsing interstitial was shown for the current URL | 49 // If a SafeBrowsing interstitial was shown for the current URL |
| 50 // this will contain the UnsafeResource struct for that URL. | 50 // this will contain the UnsafeResource struct for that URL. |
| 51 scoped_ptr<SafeBrowsingUIManager::UnsafeResource> unsafe_resource; | 51 scoped_ptr<SafeBrowsingUIManager::UnsafeResource> unsafe_resource; |
| 52 | 52 |
| 53 // List of redirects that lead to the first page on the current host and | 53 // List of redirects that lead to the first page on the current host and |
| 54 // the current url respectively. These may be the same if the current url | 54 // the current url respectively. These may be the same if the current url |
| 55 // is the first page on its host. | 55 // is the first page on its host. |
| 56 std::vector<GURL> host_redirects; | 56 std::vector<GURL> host_redirects; |
| 57 std::vector<GURL> url_redirects; | 57 std::vector<GURL> url_redirects; |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 base::WeakPtrFactory<BrowserFeatureExtractor> weak_factory_; | 165 base::WeakPtrFactory<BrowserFeatureExtractor> weak_factory_; |
| 166 | 166 |
| 167 // Set of pending extractions (i.e. extractions for which ExtractFeatures was | 167 // Set of pending extractions (i.e. extractions for which ExtractFeatures was |
| 168 // called but not StartExtractFeatures). | 168 // called but not StartExtractFeatures). |
| 169 std::map<ClientPhishingRequest*, DoneCallback> pending_extractions_; | 169 std::map<ClientPhishingRequest*, DoneCallback> pending_extractions_; |
| 170 | 170 |
| 171 // Set of pending queries (i.e., where history->Query...() was called but | 171 // Set of pending queries (i.e., where history->Query...() was called but |
| 172 // the history callback hasn't been invoked yet). | 172 // the history callback hasn't been invoked yet). |
| 173 PendingQueriesMap pending_queries_; | 173 PendingQueriesMap pending_queries_; |
| 174 | 174 |
| 175 // Max number of malware IPs can be sent in one malware request |
| 176 static const int kMaxMalwareIPPerRequest; |
| 177 |
| 175 DISALLOW_COPY_AND_ASSIGN(BrowserFeatureExtractor); | 178 DISALLOW_COPY_AND_ASSIGN(BrowserFeatureExtractor); |
| 176 }; | 179 }; |
| 177 | 180 |
| 178 } // namespace safe_browsing | 181 } // namespace safe_browsing |
| 179 #endif // CHROME_BROWSER_SAFE_BROWSING_BROWSER_FEATURE_EXTRACTOR_H_ | 182 #endif // CHROME_BROWSER_SAFE_BROWSING_BROWSER_FEATURE_EXTRACTOR_H_ |
| OLD | NEW |