Index: chrome/browser/bookmarks/bookmark_model.cc |
diff --git a/chrome/browser/bookmarks/bookmark_model.cc b/chrome/browser/bookmarks/bookmark_model.cc |
index 52533b4c2be72210353f7fc5c17cb7d33441eae5..e7b3bb1f698bc5214112b3bdff1efdd72e3d801a 100644 |
--- a/chrome/browser/bookmarks/bookmark_model.cc |
+++ b/chrome/browser/bookmarks/bookmark_model.cc |
@@ -9,6 +9,7 @@ |
#include "base/bind.h" |
#include "base/bind_helpers.h" |
+#include "base/deferred_sequenced_task_runner.h" |
#include "base/json/json_string_value_serializer.h" |
#include "base/sequenced_task_runner.h" |
#include "base/string_util.h" |
@@ -250,10 +251,14 @@ void BookmarkModel::Load() { |
content::Source<Profile>(profile_)); |
// Load the bookmarks. BookmarkStorage notifies us when done. |
- store_ = new BookmarkStorage(profile_, this, profile_->GetIOTaskRunner()); |
+ store_ = new BookmarkStorage(profile_, this, GetBookmarkTaskRunner()); |
store_->LoadBookmarks(CreateLoadDetails()); |
} |
+void BookmarkModel::StartLoading() { |
+ GetBookmarkTaskRunner()->Start(); |
+} |
+ |
bool BookmarkModel::IsLoaded() const { |
return loaded_; |
} |
@@ -961,3 +966,12 @@ BookmarkLoadDetails* BookmarkModel::CreateLoadDetails() { |
new BookmarkIndex(profile_), |
next_node_id_); |
} |
+ |
+scoped_refptr<base::DeferredSequencedTaskRunner> |
+ BookmarkModel::GetBookmarkTaskRunner() { |
+ if (!bookmark_task_runner_) { |
+ bookmark_task_runner_ = |
+ new base::DeferredSequencedTaskRunner(profile_->GetIOTaskRunner()); |
tfarina
2013/03/28 22:57:01
Can we do something similar to |blocking_task_runn
msarda
2013/03/29 14:40:03
I think so. We should probably have a similar star
|
+ } |
+ return bookmark_task_runner_; |
+} |