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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 // If a SafeBrowsing interstitial was shown for the current URL | 42 // If a SafeBrowsing interstitial was shown for the current URL |
43 // this will contain the UnsafeResource struct for that URL. | 43 // this will contain the UnsafeResource struct for that URL. |
44 scoped_ptr<SafeBrowsingService::UnsafeResource> unsafe_resource; | 44 scoped_ptr<SafeBrowsingService::UnsafeResource> unsafe_resource; |
45 | 45 |
46 // List of redirects that lead to the first page on the current host and | 46 // List of redirects that lead to the first page on the current host and |
47 // the current url respectively. These may be the same if the current url | 47 // the current url respectively. These may be the same if the current url |
48 // is the first page on its host. | 48 // is the first page on its host. |
49 std::vector<GURL> host_redirects; | 49 std::vector<GURL> host_redirects; |
50 std::vector<GURL> url_redirects; | 50 std::vector<GURL> url_redirects; |
51 | 51 |
| 52 // The HTTP status code from this navigation. |
| 53 int http_status_code; |
| 54 |
52 BrowseInfo(); | 55 BrowseInfo(); |
53 ~BrowseInfo(); | 56 ~BrowseInfo(); |
54 }; | 57 }; |
55 | 58 |
56 // All methods of this class must be called on the UI thread (including | 59 // All methods of this class must be called on the UI thread (including |
57 // the constructor). | 60 // the constructor). |
58 class BrowserFeatureExtractor { | 61 class BrowserFeatureExtractor { |
59 public: | 62 public: |
60 // Called when feature extraction is done. The first argument will be | 63 // Called when feature extraction is done. The first argument will be |
61 // true iff feature extraction succeeded. The second argument is the | 64 // true iff feature extraction succeeded. The second argument is the |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 std::set<ExtractionData> pending_extractions_; | 156 std::set<ExtractionData> pending_extractions_; |
154 | 157 |
155 // Set of pending queries (i.e., where history->Query...() was called but | 158 // Set of pending queries (i.e., where history->Query...() was called but |
156 // the history callback hasn't been invoked yet). | 159 // the history callback hasn't been invoked yet). |
157 PendingQueriesMap pending_queries_; | 160 PendingQueriesMap pending_queries_; |
158 | 161 |
159 DISALLOW_COPY_AND_ASSIGN(BrowserFeatureExtractor); | 162 DISALLOW_COPY_AND_ASSIGN(BrowserFeatureExtractor); |
160 }; | 163 }; |
161 } // namespace safe_browsing | 164 } // namespace safe_browsing |
162 #endif // CHROME_BROWSER_SAFE_BROWSING_BROWSER_FEATURE_EXTRACTOR_H_ | 165 #endif // CHROME_BROWSER_SAFE_BROWSING_BROWSER_FEATURE_EXTRACTOR_H_ |
OLD | NEW |