summaryrefslogtreecommitdiffstats
path: root/chrome/browser/history/top_sites_backend.h
diff options
context:
space:
mode:
authorkaiwang@chromium.org <kaiwang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-06 00:39:49 +0000
committerkaiwang@chromium.org <kaiwang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-06 00:39:49 +0000
commitda927a1b3383664096b109d223e8ef08a08734db (patch)
treef78104778c09cf1809efb0c63c2806479eefd91d /chrome/browser/history/top_sites_backend.h
parent62fec45584c0d5ef94cda3d1d02265369abe93ca (diff)
downloadchromium_src-da927a1b3383664096b109d223e8ef08a08734db.zip
chromium_src-da927a1b3383664096b109d223e8ef08a08734db.tar.gz
chromium_src-da927a1b3383664096b109d223e8ef08a08734db.tar.bz2
TopSites and TopSitesBackend stop depending on CancelabelRequest
Note TopSites::GetMostVisitedURLs() only need to be canceled from originating thread. So it's not necessary to use CancelabelTaskTracker Used WeakPtrFactory instead. BUG=155883 Review URL: https://chromiumcodereview.appspot.com/11273105 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@166095 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/history/top_sites_backend.h')
-rw-r--r--chrome/browser/history/top_sites_backend.h18
1 files changed, 4 insertions, 14 deletions
diff --git a/chrome/browser/history/top_sites_backend.h b/chrome/browser/history/top_sites_backend.h
index 270528c..163af2c 100644
--- a/chrome/browser/history/top_sites_backend.h
+++ b/chrome/browser/history/top_sites_backend.h
@@ -9,7 +9,6 @@
#include "base/file_path.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
-#include "chrome/browser/common/cancelable_request.h"
#include "chrome/browser/history/history_types.h"
class CancelableTaskTracker;
@@ -22,9 +21,7 @@ class TopSitesDatabase;
// Service used by TopSites to have db interaction happen on the DB thread. All
// public methods are invoked on the ui thread and get funneled to the DB
// thread.
-class TopSitesBackend
- : public base::RefCountedThreadSafe<TopSitesBackend>,
- public CancelableRequestProvider {
+class TopSitesBackend : public base::RefCountedThreadSafe<TopSitesBackend> {
public:
// The boolean parameter indicates if the DB existed on disk or needs to be
// migrated.
@@ -55,15 +52,11 @@ class TopSitesBackend
// Deletes the database and recreates it.
void ResetDatabase();
- typedef base::Callback<void(Handle)> EmptyRequestCallback;
- typedef CancelableRequest<TopSitesBackend::EmptyRequestCallback>
- EmptyRequestRequest;
-
// Schedules a request that does nothing on the DB thread, but then notifies
- // the callback on the calling thread. This is used to make sure the db has
+ // the the calling thread with a reply. This is used to make sure the db has
// finished processing a request.
- Handle DoEmptyRequest(CancelableRequestConsumerBase* consumer,
- const EmptyRequestCallback& callback);
+ void DoEmptyRequest(const base::Closure& reply,
+ CancelableTaskTracker* tracker);
private:
friend class base::RefCountedThreadSafe<TopSitesBackend>;
@@ -92,9 +85,6 @@ class TopSitesBackend
// Resets the database.
void ResetDatabaseOnDBThread(const FilePath& file_path);
- // Notifies the request.
- void DoEmptyRequestOnDBThread(scoped_refptr<EmptyRequestRequest> request);
-
FilePath db_path_;
scoped_ptr<TopSitesDatabase> db_;