Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3189)

Unified Diff: chrome/renderer/safe_browsing/phishing_classifier.h

Issue 8573018: Convert to base::Callback in safe_browsing client-side-detection code. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Don't call Run() on null callbacks. Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/renderer/safe_browsing/phishing_classifier.h
diff --git a/chrome/renderer/safe_browsing/phishing_classifier.h b/chrome/renderer/safe_browsing/phishing_classifier.h
index 64d1d2608fc5554d3e96d13128084ddb487847c9..559dfbf3c17ebb0ed49b9216bf94677529ae1180 100644
--- a/chrome/renderer/safe_browsing/phishing_classifier.h
+++ b/chrome/renderer/safe_browsing/phishing_classifier.h
@@ -45,7 +45,7 @@ class PhishingClassifier {
// is true, the page is considered phishy by the client-side model,
// and the browser should ping back to get a final verdict. The
// verdict.client_score() is set to kInvalidScore if classification failed.
- typedef Callback1<const ClientPhishingRequest& /* verdict */>::Type
+ typedef base::Callback<void(const ClientPhishingRequest& /* verdict */)>
DoneCallback;
static const float kInvalidScore;
@@ -84,7 +84,7 @@ class PhishingClassifier {
// It is an error to call BeginClassification if the classifier is not yet
// ready.
virtual void BeginClassification(const string16* page_text,
- DoneCallback* callback);
+ const DoneCallback& callback);
// Called by the RenderView (on the render thread) when a page is unloading
// or the RenderView is being destroyed. This cancels any extraction that
@@ -136,7 +136,7 @@ class PhishingClassifier {
// State for any in-progress extraction.
scoped_ptr<FeatureMap> features_;
const string16* page_text_; // owned by the caller
- scoped_ptr<DoneCallback> done_callback_;
+ DoneCallback done_callback_;
// Used in scheduling BeginFeatureExtraction tasks.
// These pointers are invalidated if classification is cancelled.

Powered by Google App Engine
This is Rietveld 408576698