browser_feature_extractor.h revision a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7
15821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Copyright (c) 2011 The Chromium Authors. All rights reserved.
25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// found in the LICENSE file.
45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//
55821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// BrowserFeatureExtractor computes various browser features for client-side
65821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// phishing detection.  For now it does a bunch of lookups in the history
75821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// service to see whether a particular URL has been visited before by the
85821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// user.
95821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#ifndef CHROME_BROWSER_SAFE_BROWSING_BROWSER_FEATURE_EXTRACTOR_H_
115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define CHROME_BROWSER_SAFE_BROWSING_BROWSER_FEATURE_EXTRACTOR_H_
125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include <map>
145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include <set>
155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include <string>
165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include <utility>
175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include <vector>
185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "base/basictypes.h"
205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "base/callback.h"
217d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)#include "base/containers/hash_tables.h"
225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "base/memory/scoped_ptr.h"
235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "base/sequenced_task_runner_helpers.h"
24eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch#include "base/time/time.h"
255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "chrome/browser/common/cancelable_request.h"
265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "chrome/browser/history/history_types.h"
275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "chrome/browser/safe_browsing/safe_browsing_service.h"
282a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "chrome/browser/safe_browsing/ui_manager.h"
29eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch#include "url/gurl.h"
30a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)#include "webkit/common/resource_type.h"
31a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)
325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class HistoryService;
345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace content {
365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class WebContents;
375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}
385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace safe_browsing {
402a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)class ClientMalwareRequest;
415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class ClientPhishingRequest;
42f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)class ClientSideDetectionHost;
435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
44a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)struct IPUrlInfo {
45a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)  // The url on the bad IP address.
46a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)  std::string url;
47a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)  std::string method;
48a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)  std::string referrer;
49a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)  ResourceType::Type resource_type;
50a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)
51a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)  IPUrlInfo(const std::string& url,
52a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)            const std::string& method,
53a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)            const std::string& referrer,
54a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)            const ResourceType::Type& resource_type);
55a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)  ~IPUrlInfo();
56a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)};
57a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)
58a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)typedef std::map<std::string, std::vector<IPUrlInfo> > IPUrlMap;
592a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)struct BrowseInfo {
615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // List of IPv4 and IPv6 addresses from which content was requested
622a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // together with the hosts on it, while browsing to the |url|.
63a36e5920737c6adbddd3e43b760e5de8431db6e0Torne (Richard Coles)  IPUrlMap ips;
645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // If a SafeBrowsing interstitial was shown for the current URL
665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // this will contain the UnsafeResource struct for that URL.
672a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  scoped_ptr<SafeBrowsingUIManager::UnsafeResource> unsafe_resource;
685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // List of redirects that lead to the first page on the current host and
705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // the current url respectively. These may be the same if the current url
715821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // is the first page on its host.
725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  std::vector<GURL> host_redirects;
735821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  std::vector<GURL> url_redirects;
745821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
75f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)  // URL of the referrer of this URL load.
76f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)  GURL referrer;
77f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)
785821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // The HTTP status code from this navigation.
795821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  int http_status_code;
805821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
815821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  BrowseInfo();
825821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  ~BrowseInfo();
835821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)};
845821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
855821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// All methods of this class must be called on the UI thread (including
865821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// the constructor).
875821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class BrowserFeatureExtractor {
885821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) public:
895821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Called when feature extraction is done.  The first argument will be
905821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // true iff feature extraction succeeded.  The second argument is the
915821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // phishing request which was modified by the feature extractor.  The
925821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // DoneCallback takes ownership of the request object.
935821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  typedef base::Callback<void(bool, ClientPhishingRequest*)> DoneCallback;
94f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)  typedef base::Callback<void(bool, scoped_ptr<ClientMalwareRequest>)>
95f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)      MalwareDoneCallback;
965821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
97f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)  // The caller keeps ownership of the tab and host objects and is
985821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // responsible for ensuring that they stay valid for the entire
995821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // lifetime of this object.
1005821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  BrowserFeatureExtractor(content::WebContents* tab,
101f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)                          ClientSideDetectionHost* host);
1025821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1035821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // The destructor will cancel any pending requests.
1045821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual ~BrowserFeatureExtractor();
1055821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1065821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Begins extraction of the browser features.  We take ownership
1075821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // of the request object until |callback| is called (see DoneCallback above)
1085821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // and will write the extracted features to the feature map.  Once the
1095821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // feature extraction is complete, |callback| is run on the UI thread.  We
1105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // take ownership of the |callback| object.  |info| may not be valid after
1115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // ExtractFeatures returns.  This method must run on the UI thread.
1125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void ExtractFeatures(const BrowseInfo* info,
1135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                               ClientPhishingRequest* request,
1145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                               const DoneCallback& callback);
1155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
116f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)  // Begins extraction of the malware related features.  We take ownership
117f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)  // of the request object until |callback| is called.  Once feature extraction
118f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)  // is complete, |callback| will run on the UI thread.  |info| is not expected
119f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)  // to stay valid after ExtractMalwareFeatures returns.  All IPs stored in
120f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)  // |info| will be cleared by calling this function.
121f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)  virtual void ExtractMalwareFeatures(BrowseInfo* info,
122f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)                                      ClientMalwareRequest* request,
123f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)                                      const MalwareDoneCallback& callback);
1242a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
1255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) private:
1265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  friend class base::DeleteHelper<BrowserFeatureExtractor>;
1275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  typedef std::pair<ClientPhishingRequest*, DoneCallback> ExtractionData;
1285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  typedef std::map<CancelableRequestProvider::Handle,
1295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                   ExtractionData> PendingQueriesMap;
1305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Synchronous browser feature extraction.
1325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  void ExtractBrowseInfoFeatures(const BrowseInfo& info,
1335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                                 ClientPhishingRequest* request);
1345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Actually starts feature extraction (does the real work).
1365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  void StartExtractFeatures(ClientPhishingRequest* request,
1375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                            const DoneCallback& callback);
1385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // HistoryService callback which is called when we're done querying URL visits
1405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // in the history.
1415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  void QueryUrlHistoryDone(CancelableRequestProvider::Handle handle,
1425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                           bool success,
1435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                           const history::URLRow* row,
1445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                           history::VisitVector* visits);
1455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // HistoryService callback which is called when we're done querying HTTP host
1475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // visits in the history.
1485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  void QueryHttpHostVisitsDone(CancelableRequestProvider::Handle handle,
1495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                               bool success,
1505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                               int num_visits,
1515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                               base::Time first_visit);
1525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // HistoryService callback which is called when we're done querying HTTPS host
1545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // visits in the history.
1555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  void QueryHttpsHostVisitsDone(CancelableRequestProvider::Handle handle,
1565821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                                bool success,
1575821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                                int num_visits,
1585821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                                base::Time first_visit);
1595821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Helper function which sets the host history features given the
1615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // number of host visits and the time of the fist host visit.  Set
1625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // |is_http_query| to true if the URL scheme is HTTP and to false if
1635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // the scheme is HTTPS.
1645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  void SetHostVisitsFeatures(int num_visits,
1655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                             base::Time first_visit,
1665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                             bool is_http_query,
1675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                             ClientPhishingRequest* request);
1685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Helper function which stores the request and callback while the history
1705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // query is being processed.
1715821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  void StorePendingQuery(CancelableRequestProvider::Handle handle,
1725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                         ClientPhishingRequest* request,
1735821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                         const DoneCallback& callback);
1745821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1755821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Helper function which is the counterpart of StorePendingQuery.  If there
1765821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // is a pending query for the given handle it will return false and set both
1775821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // the request and cb pointers.  Otherwise, it will return false.
1785821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  bool GetPendingQuery(CancelableRequestProvider::Handle handle,
1795821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                       ClientPhishingRequest** request,
1805821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                       DoneCallback* callback);
1815821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1825821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Helper function which gets the history server if possible.  If the pointer
1835821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // is set it will return true and false otherwise.
1845821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  bool GetHistoryService(HistoryService** history);
1855821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
186f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)  // Helper function which is called when we're done filtering out benign IPs
187f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)  // on the IO thread.  This function is called on the UI thread.
188f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)  void FinishExtractMalwareFeatures(scoped_ptr<IPUrlMap> bad_ips,
189f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)                                    MalwareDoneCallback callback,
190f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)                                    scoped_ptr<ClientMalwareRequest> request);
191f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)
1925821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  content::WebContents* tab_;
193f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)  ClientSideDetectionHost* host_;
1945821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  CancelableRequestConsumer request_consumer_;
1955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  base::WeakPtrFactory<BrowserFeatureExtractor> weak_factory_;
1965821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1975821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Set of pending extractions (i.e. extractions for which ExtractFeatures was
1985821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // called but not StartExtractFeatures).
1995821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  std::map<ClientPhishingRequest*, DoneCallback> pending_extractions_;
2005821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2015821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Set of pending queries (i.e., where history->Query...() was called but
2025821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // the history callback hasn't been invoked yet).
2035821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  PendingQueriesMap pending_queries_;
2045821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2055821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  DISALLOW_COPY_AND_ASSIGN(BrowserFeatureExtractor);
2065821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)};
2075821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2085821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}  // namespace safe_browsing
2095821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#endif  // CHROME_BROWSER_SAFE_BROWSING_BROWSER_FEATURE_EXTRACTOR_H_
210