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

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

Issue 2599803002: Revert of Document that HistoryBackend is sequence-affine, not thread-affine. (Closed)
Patch Set: Created 4 years 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: components/history/core/browser/history_backend.h
diff --git a/components/history/core/browser/history_backend.h b/components/history/core/browser/history_backend.h
index 75f550fa81fe5f5c372fdb3b63fa07e1f9fb4247..6959994ab1ae814988b99a55bda09e7a17a89aaf 100644
--- a/components/history/core/browser/history_backend.h
+++ b/components/history/core/browser/history_backend.h
@@ -89,9 +89,10 @@
// *See the .cc file for more information on the design.*
//
// Internal history implementation which does most of the work of the history
-// system. This runs on a dedicated sequence (to not block the browser when we
-// do expensive operations). It is NOT threadsafe: unless otherwise noted, all
-// methods must be called from the same sequence.
+// system. This runs on a background thread (to not block the browser when we
+// do expensive operations) and is NOT threadsafe, so it must only be called
+// from message handlers on the background thread. Invoking on another thread
+// requires threadsafe refcounting.
//
// Most functions here are just the implementations of the corresponding
// functions in the history service. These functions are not documented
@@ -166,9 +167,9 @@
virtual void DBLoaded() = 0;
};
- // This constructor can be invoked on any sequence. Init() must then be called
- // on |task_runner|'s sequence to complete object creation. Unless otherwise
- // noted, all methods must be called on |task_runner|'s sequence.
+ // Init must be called to complete object creation. This object can be
+ // constructed on any thread, but all other functions including Init() must
+ // be called on the history thread.
//
// |history_dir| is the directory where the history files will be placed.
// See the definition of BroadcastNotificationsCallback above. This function
@@ -357,7 +358,6 @@
// Generic operations --------------------------------------------------------
- // This method can be called from any sequence.
void ProcessDBTask(
std::unique_ptr<HistoryDBTask> task,
scoped_refptr<base::SingleThreadTaskRunner> origin_loop,
@@ -762,9 +762,8 @@
// Generic stuff -------------------------------------------------------------
- // Processes the next scheduled HistoryDBTask, scheduling this method to be
- // invoked again if there are more tasks that need to run. This method can be
- // called from any sequence.
+ // Processes the next scheduled HistoryDBTask, scheduling this method
+ // to be invoked again if there are more tasks that need to run.
void ProcessDBTaskImpl();
// HistoryBackendNotifier:
« no previous file with comments | « components/browser_sync/profile_sync_service_typed_url_unittest.cc ('k') | components/history/core/browser/history_backend.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698