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

Unified Diff: chrome/browser/history/history_db_task.h

Issue 387923002: Make HistoryDBTask not refcounted, and ensure it's destroyed on its origin thread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 6 years, 5 months 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/history/history_db_task.h
diff --git a/chrome/browser/history/history_db_task.h b/chrome/browser/history/history_db_task.h
index 4e0d8114ef71c601b766151743326af5f3c68a72..e96c5910f1aaf7dc6831f1219a60c80a5c0f3799 100644
--- a/chrome/browser/history/history_db_task.h
+++ b/chrome/browser/history/history_db_task.h
@@ -5,8 +5,6 @@
#ifndef CHROME_BROWSER_HISTORY_HISTORY_DB_TASK_H_
#define CHROME_BROWSER_HISTORY_HISTORY_DB_TASK_H_
-#include "base/memory/ref_counted.h"
-
namespace history {
class HistoryBackend;
@@ -17,8 +15,10 @@ class HistoryDatabase;
// When HistoryBackend processes the task it invokes RunOnDBThread. Once the
// task completes and has not been canceled, DoneRunOnMainThread is invoked back
// on the main thread.
sky 2014/07/14 20:27:44 Document where destruction occurs.
Bernhard Bauer 2014/07/15 10:17:24 Done.
-class HistoryDBTask : public base::RefCountedThreadSafe<HistoryDBTask> {
+class HistoryDBTask {
public:
+ virtual ~HistoryDBTask() {}
+
// Invoked on the database thread. The return value indicates whether the
// task is done. A return value of true signals the task is done and
// RunOnDBThread should NOT be invoked again. A return value of false
@@ -30,11 +30,6 @@ class HistoryDBTask : public base::RefCountedThreadSafe<HistoryDBTask> {
// only invoked if the request was not canceled and returned true from
// RunOnDBThread.
virtual void DoneRunOnMainThread() = 0;
-
- protected:
- friend class base::RefCountedThreadSafe<HistoryDBTask>;
-
- virtual ~HistoryDBTask() {}
};
} // namespace history

Powered by Google App Engine
This is Rietveld 408576698