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_ |
11 #define CHROME_BROWSER_SAFE_BROWSING_BROWSER_FEATURE_EXTRACTOR_H_ | 11 #define CHROME_BROWSER_SAFE_BROWSING_BROWSER_FEATURE_EXTRACTOR_H_ |
12 | 12 |
13 #include <map> | 13 #include <map> |
14 #include <set> | 14 #include <set> |
15 #include <string> | 15 #include <string> |
16 #include <utility> | 16 #include <utility> |
17 #include <vector> | 17 #include <vector> |
18 | 18 |
19 #include "base/basictypes.h" | 19 #include "base/basictypes.h" |
20 #include "base/callback.h" | 20 #include "base/callback.h" |
21 #include "base/containers/hash_tables.h" | 21 #include "base/containers/hash_tables.h" |
22 #include "base/memory/scoped_ptr.h" | 22 #include "base/memory/scoped_ptr.h" |
23 #include "base/task/cancelable_task_tracker.h" | 23 #include "base/task/cancelable_task_tracker.h" |
24 #include "base/time/time.h" | 24 #include "base/time/time.h" |
25 #include "chrome/browser/history/history_types.h" | 25 #include "chrome/browser/history/history_types.h" |
26 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 26 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
27 #include "chrome/browser/safe_browsing/ui_manager.h" | 27 #include "chrome/browser/safe_browsing/ui_manager.h" |
| 28 #include "content/public/common/resource_type.h" |
28 #include "url/gurl.h" | 29 #include "url/gurl.h" |
29 #include "webkit/common/resource_type.h" | |
30 | 30 |
31 | 31 |
32 class HistoryService; | 32 class HistoryService; |
33 | 33 |
34 namespace content { | 34 namespace content { |
35 class WebContents; | 35 class WebContents; |
36 } | 36 } |
37 | 37 |
38 namespace safe_browsing { | 38 namespace safe_browsing { |
39 class ClientMalwareRequest; | 39 class ClientMalwareRequest; |
40 class ClientPhishingRequest; | 40 class ClientPhishingRequest; |
41 class ClientSideDetectionHost; | 41 class ClientSideDetectionHost; |
42 | 42 |
43 struct IPUrlInfo { | 43 struct IPUrlInfo { |
44 // The url on the bad IP address. | 44 // The url on the bad IP address. |
45 std::string url; | 45 std::string url; |
46 std::string method; | 46 std::string method; |
47 std::string referrer; | 47 std::string referrer; |
48 ResourceType::Type resource_type; | 48 content::ResourceType::Type resource_type; |
49 | 49 |
50 IPUrlInfo(const std::string& url, | 50 IPUrlInfo(const std::string& url, |
51 const std::string& method, | 51 const std::string& method, |
52 const std::string& referrer, | 52 const std::string& referrer, |
53 const ResourceType::Type& resource_type); | 53 const content::ResourceType::Type& resource_type); |
54 ~IPUrlInfo(); | 54 ~IPUrlInfo(); |
55 }; | 55 }; |
56 | 56 |
57 typedef std::map<std::string, std::vector<IPUrlInfo> > IPUrlMap; | 57 typedef std::map<std::string, std::vector<IPUrlInfo> > IPUrlMap; |
58 | 58 |
59 struct BrowseInfo { | 59 struct BrowseInfo { |
60 // The URL we're currently browsing. | 60 // The URL we're currently browsing. |
61 GURL url; | 61 GURL url; |
62 | 62 |
63 // List of IPv4 and IPv6 addresses from which content was requested | 63 // List of IPv4 and IPv6 addresses from which content was requested |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 content::WebContents* tab_; | 183 content::WebContents* tab_; |
184 ClientSideDetectionHost* host_; | 184 ClientSideDetectionHost* host_; |
185 base::CancelableTaskTracker cancelable_task_tracker_; | 185 base::CancelableTaskTracker cancelable_task_tracker_; |
186 base::WeakPtrFactory<BrowserFeatureExtractor> weak_factory_; | 186 base::WeakPtrFactory<BrowserFeatureExtractor> weak_factory_; |
187 | 187 |
188 DISALLOW_COPY_AND_ASSIGN(BrowserFeatureExtractor); | 188 DISALLOW_COPY_AND_ASSIGN(BrowserFeatureExtractor); |
189 }; | 189 }; |
190 | 190 |
191 } // namespace safe_browsing | 191 } // namespace safe_browsing |
192 #endif // CHROME_BROWSER_SAFE_BROWSING_BROWSER_FEATURE_EXTRACTOR_H_ | 192 #endif // CHROME_BROWSER_SAFE_BROWSING_BROWSER_FEATURE_EXTRACTOR_H_ |
OLD | NEW |