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

Unified Diff: chrome/browser/safe_browsing/safe_browsing_service.h

Issue 8548003: Some easy NewRunnableMethod conversions in safe_browsing. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Convert to WeakPtrFactory. 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/browser/safe_browsing/safe_browsing_service.h
diff --git a/chrome/browser/safe_browsing/safe_browsing_service.h b/chrome/browser/safe_browsing/safe_browsing_service.h
index 8844792e8151d8976b3c34e83b698857fae2eaf4..79003465448c7fafe2473ce5d3e6cb5017925d2a 100644
--- a/chrome/browser/safe_browsing/safe_browsing_service.h
+++ b/chrome/browser/safe_browsing/safe_browsing_service.h
@@ -102,13 +102,13 @@ class SafeBrowsingService
std::vector<SBPrefix> prefix_hits;
std::vector<SBFullHashResult> full_hits;
- // Task to make the callback to safebrowsing clients in case
- // safebrowsing check takes too long to finish. Not owned by
- // this class.
+ // Vends weak pointers for TimeoutCallback(). If the response is
+ // received before the timeout fires, factory is destructed and
+ // the timeout won't be fired.
// TODO(lzheng): We should consider to use this time out check
// for browsing too (instead of implementin in
// safe_browsing_resource_handler.cc).
- CancelableTask* timeout_task;
+ scoped_ptr<base::WeakPtrFactory<SafeBrowsingService> > timeout_factory_;
private:
DISALLOW_COPY_AND_ASSIGN(SafeBrowsingCheck);
@@ -458,7 +458,7 @@ class SafeBrowsingService
// success, otherwise TimeoutCallback will be called.
void StartDownloadCheck(SafeBrowsingCheck* check,
Client* client,
- CancelableTask* task,
+ const base::Closure& task,
int64 timeout_ms);
// Adds the given entry to the whitelist. Called on the UI thread.
« no previous file with comments | « chrome/browser/safe_browsing/protocol_manager.cc ('k') | chrome/browser/safe_browsing/safe_browsing_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698