Index: chrome/browser/safe_browsing/browser_feature_extractor.h |
diff --git a/chrome/browser/safe_browsing/browser_feature_extractor.h b/chrome/browser/safe_browsing/browser_feature_extractor.h |
index a9469fe2b9b8200213e88fd4831ab5423a6a3493..9b6ec7274022d04f053ed871c92bc9145f7a86e8 100644 |
--- a/chrome/browser/safe_browsing/browser_feature_extractor.h |
+++ b/chrome/browser/safe_browsing/browser_feature_extractor.h |
@@ -18,7 +18,7 @@ |
#include <vector> |
#include "base/basictypes.h" |
-#include "base/callback_old.h" |
+#include "base/callback.h" |
#include "base/memory/scoped_ptr.h" |
#include "base/task.h" |
#include "base/time.h" |
@@ -64,7 +64,7 @@ class BrowserFeatureExtractor { |
// true iff feature extraction succeeded. The second argument is the |
// phishing request which was modified by the feature extractor. The |
// DoneCallback takes ownership of the request object. |
- typedef Callback2<bool, ClientPhishingRequest*>::Type DoneCallback; |
+ typedef base::Callback<void(bool, ClientPhishingRequest*)> DoneCallback; |
// The caller keeps ownership of the tab and service objects and is |
// responsible for ensuring that they stay valid for the entire |
@@ -83,11 +83,11 @@ class BrowserFeatureExtractor { |
// ExtractFeatures returns. This method must run on the UI thread. |
virtual void ExtractFeatures(const BrowseInfo* info, |
ClientPhishingRequest* request, |
- DoneCallback* callback); |
+ const DoneCallback& callback); |
private: |
friend class DeleteTask<BrowserFeatureExtractor>; |
- typedef std::pair<ClientPhishingRequest*, DoneCallback*> ExtractionData; |
+ typedef std::pair<ClientPhishingRequest*, DoneCallback> ExtractionData; |
typedef std::map<CancelableRequestProvider::Handle, |
ExtractionData> PendingQueriesMap; |
@@ -97,7 +97,7 @@ class BrowserFeatureExtractor { |
// Actually starts feature extraction (does the real work). |
void StartExtractFeatures(ClientPhishingRequest* request, |
- DoneCallback* callback); |
+ const DoneCallback& callback); |
// HistoryService callback which is called when we're done querying URL visits |
// in the history. |
@@ -133,14 +133,14 @@ class BrowserFeatureExtractor { |
// query is being processed. |
void StorePendingQuery(CancelableRequestProvider::Handle handle, |
ClientPhishingRequest* request, |
- DoneCallback* callback); |
+ const DoneCallback& callback); |
// Helper function which is the counterpart of StorePendingQuery. If there |
// is a pending query for the given handle it will return false and set both |
// the request and cb pointers. Otherwise, it will return false. |
bool GetPendingQuery(CancelableRequestProvider::Handle handle, |
ClientPhishingRequest** request, |
- DoneCallback** callback); |
+ DoneCallback* callback); |
// Helper function which gets the history server if possible. If the pointer |
// is set it will return true and false otherwise. |
@@ -153,7 +153,7 @@ class BrowserFeatureExtractor { |
// Set of pending extractions (i.e. extractions for which ExtractFeatures was |
// called but not StartExtractFeatures). |
- std::set<ExtractionData> pending_extractions_; |
+ std::map<ClientPhishingRequest*, DoneCallback> pending_extractions_; |
// Set of pending queries (i.e., where history->Query...() was called but |
// the history callback hasn't been invoked yet). |
@@ -161,5 +161,6 @@ class BrowserFeatureExtractor { |
DISALLOW_COPY_AND_ASSIGN(BrowserFeatureExtractor); |
}; |
+ |
} // namespace safe_browsing |
#endif // CHROME_BROWSER_SAFE_BROWSING_BROWSER_FEATURE_EXTRACTOR_H_ |