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

Unified Diff: chrome/browser/bookmarks/bookmark_storage.h

Issue 242693003: Introduce BookmarkClient interface to abstract embedder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 8 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/bookmarks/bookmark_storage.h
diff --git a/chrome/browser/bookmarks/bookmark_storage.h b/chrome/browser/bookmarks/bookmark_storage.h
index ce6cc7c95de1b3d2b9f7ac2091a76c8a034e8c3d..478a0273aaf1fa6dd2037a17d6b2c0fd213c0897 100644
--- a/chrome/browser/bookmarks/bookmark_storage.h
+++ b/chrome/browser/bookmarks/bookmark_storage.h
@@ -5,6 +5,7 @@
#ifndef CHROME_BROWSER_BOOKMARKS_BOOKMARK_STORAGE_H_
#define CHROME_BROWSER_BOOKMARKS_BOOKMARK_STORAGE_H_
+#include "base/files/file_path.h"
#include "base/files/important_file_writer.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
@@ -18,10 +19,6 @@ namespace base {
class SequencedTaskRunner;
}
-namespace content {
-class BrowserContext;
-}
-
// BookmarkLoadDetails is used by BookmarkStorage when loading bookmarks.
// BookmarkModel creates a BookmarkLoadDetails and passes it (including
// ownership) to BookmarkStorage. BookmarkStorage loads the bookmarks (and
@@ -116,14 +113,19 @@ class BookmarkLoadDetails {
class BookmarkStorage : public base::ImportantFileWriter::DataSerializer,
public base::RefCountedThreadSafe<BookmarkStorage> {
public:
- // Creates a BookmarkStorage for the specified model
- BookmarkStorage(content::BrowserContext* context,
- BookmarkModel* model,
+ // Creates a BookmarkStorage for the specified model. The data will be loaded
+ // from and saved to a location derived from |profile_path|. The IO code will
+ // be run as task in |sequenced_task_runner|.
+ BookmarkStorage(BookmarkModel* model,
+ const base::FilePath& profile_path,
base::SequencedTaskRunner* sequenced_task_runner);
// Loads the bookmarks into the model, notifying the model when done. This
- // takes ownership of |details|. See BookmarkLoadDetails for details.
- void LoadBookmarks(BookmarkLoadDetails* details);
+ // takes ownership of |details|, and send the |OnLoadFinished| callback from
+ // a task in |task_runner|. See BookmarkLoadDetails for details.
+ void LoadBookmarks(
+ BookmarkLoadDetails* details,
+ const scoped_refptr<base::SequencedTaskRunner>& task_runner);
// Schedules saving the bookmark bar model to disk.
void ScheduleSave();

Powered by Google App Engine
This is Rietveld 408576698