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

Unified Diff: chrome/browser/history/history_backend.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: revert unnecessary changes 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
« no previous file with comments | « chrome/browser/history/delete_directive_handler.cc ('k') | chrome/browser/history/history_backend.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/history/history_backend.h
diff --git a/chrome/browser/history/history_backend.h b/chrome/browser/history/history_backend.h
index 41ff49f9e2052aee21600914a14d1468e7fda879..eb7c3fa27aea6b9698f3ddaf9d15f101fc4020ab 100644
--- a/chrome/browser/history/history_backend.h
+++ b/chrome/browser/history/history_backend.h
@@ -51,22 +51,26 @@ static const size_t kMaxFaviconsPerPage = 8;
// the thumbnail database.
static const size_t kMaxFaviconBitmapsPerIconURL = 8;
+// Keeps track of a queued HistoryDBTask. This class lives solely on the
+// DB thread.
class QueuedHistoryDBTask {
public:
QueuedHistoryDBTask(
- scoped_refptr<HistoryDBTask> task,
+ scoped_ptr<HistoryDBTask> task,
scoped_refptr<base::SingleThreadTaskRunner> origin_loop,
const base::CancelableTaskTracker::IsCanceledCallback& is_canceled);
~QueuedHistoryDBTask();
bool is_canceled();
- bool RunOnDBThread(HistoryBackend* backend, HistoryDatabase* db);
- void DoneRunOnMainThread();
+ bool Run(HistoryBackend* backend, HistoryDatabase* db);
+ void DoneRun();
private:
- scoped_refptr<HistoryDBTask> task_;
+ scoped_ptr<HistoryDBTask> task_;
scoped_refptr<base::SingleThreadTaskRunner> origin_loop_;
base::CancelableTaskTracker::IsCanceledCallback is_canceled_;
+
+ DISALLOW_COPY_AND_ASSIGN(QueuedHistoryDBTask);
};
// *See the .cc file for more information on the design.*
@@ -373,7 +377,7 @@ class HistoryBackend : public base::RefCountedThreadSafe<HistoryBackend>,
// Generic operations --------------------------------------------------------
void ProcessDBTask(
- scoped_refptr<HistoryDBTask> task,
+ scoped_ptr<HistoryDBTask> task,
scoped_refptr<base::SingleThreadTaskRunner> origin_loop,
const base::CancelableTaskTracker::IsCanceledCallback& is_canceled);
@@ -861,7 +865,7 @@ class HistoryBackend : public base::RefCountedThreadSafe<HistoryBackend>,
bool segment_queried_;
// List of QueuedHistoryDBTasks to run;
- std::list<QueuedHistoryDBTask> queued_history_db_tasks_;
+ std::list<QueuedHistoryDBTask*> queued_history_db_tasks_;
// Used to determine if a URL is bookmarked; may be NULL.
//
« no previous file with comments | « chrome/browser/history/delete_directive_handler.cc ('k') | chrome/browser/history/history_backend.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698