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

Unified Diff: components/history/core/browser/history_service.h

Issue 2486603003: Redirect HistoryService thread to TaskScheduler via a field trial. (Closed)
Patch Set: CR brettw #17 (do not involve chrome_browser_main) Created 4 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
« no previous file with comments | « components/history/core/browser/DEPS ('k') | components/history/core/browser/history_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/history/core/browser/history_service.h
diff --git a/components/history/core/browser/history_service.h b/components/history/core/browser/history_service.h
index 430037133854ba0d0e65a1ab87763162f4f13eaa..22dcc9018f0d881b9ea30117b360f487e2728a28 100644
--- a/components/history/core/browser/history_service.h
+++ b/components/history/core/browser/history_service.h
@@ -22,6 +22,7 @@
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "base/observer_list.h"
+#include "base/sequenced_task_runner.h"
#include "base/strings/string16.h"
#include "base/task/cancelable_task_tracker.h"
#include "base/threading/thread_checker.h"
@@ -795,9 +796,15 @@ class HistoryService : public syncer::SyncableService, public KeyedService {
base::ThreadChecker thread_checker_;
- // The thread used by the history service to run complicated operations.
- // |thread_| is null once Cleanup() is called.
- base::Thread* thread_;
+ // The thread used by the history service to run HistoryBackend operations.
+ // Intentionally not a BrowserThread because the sync integration unit tests
+ // need to create multiple HistoryServices which each have their own thread.
+ // Nullptr if TaskScheduler is used for HistoryBackend operations.
+ std::unique_ptr<base::Thread> thread_;
+
+ // The TaskRunner to which HistoryBackend tasks are posted. Nullptr once
+ // Cleanup() is called.
+ scoped_refptr<base::SequencedTaskRunner> backend_task_runner_;
// This class has most of the implementation and runs on the 'thread_'.
// You MUST communicate with this class ONLY through the thread_'s
« no previous file with comments | « components/history/core/browser/DEPS ('k') | components/history/core/browser/history_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698