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

Unified Diff: chrome/browser/ui/app_list/search/history_data_store.h

Issue 518293002: App-list history cleanup. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: test fix Created 6 years, 3 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/ui/app_list/search/history_data_store.h
diff --git a/chrome/browser/ui/app_list/search/history_data_store.h b/chrome/browser/ui/app_list/search/history_data_store.h
index 56d8571091eba6ac254185bbbb51891f55798c50..0542dbe70596372cf6e74ad0958f684991dad6f6 100644
--- a/chrome/browser/ui/app_list/search/history_data_store.h
+++ b/chrome/browser/ui/app_list/search/history_data_store.h
@@ -10,8 +10,6 @@
#include "base/basictypes.h"
#include "base/callback_forward.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"
#include "chrome/browser/ui/app_list/search/common/dictionary_data_store.h"
@@ -34,7 +32,11 @@ class HistoryDataStore : public base::RefCountedThreadSafe<HistoryDataStore> {
typedef base::Callback<void(scoped_ptr<HistoryData::Associations>)>
OnLoadedCallback;
- explicit HistoryDataStore(const base::FilePath& data_file);
+ // A data store with no storage backend.
+ HistoryDataStore();
+
+ // |data_store| stores the history into the file.
+ explicit HistoryDataStore(scoped_refptr<DictionaryDataStore> data_store);
// Flushes pending writes. |on_flushed| is invoked when disk write is
// finished.
@@ -58,6 +60,8 @@ class HistoryDataStore : public base::RefCountedThreadSafe<HistoryDataStore> {
virtual ~HistoryDataStore();
+ void Init(base::DictionaryValue* cached_dict);
+
// Gets the dictionary for "associations" key.
base::DictionaryValue* GetAssociationDict();
@@ -67,6 +71,10 @@ class HistoryDataStore : public base::RefCountedThreadSafe<HistoryDataStore> {
void OnDictionaryLoadedCallback(OnLoadedCallback callback,
scoped_ptr<base::DictionaryValue> dict);
+ // |cached_dict_| and |data_store_| is mutually exclusive. |data_store_| is
+ // used if it's backed by a file storage, otherwise |cache_dict_| keeps
+ // on-memory data.
+ scoped_ptr<base::DictionaryValue> cached_dict_;
scoped_refptr<DictionaryDataStore> data_store_;
DISALLOW_COPY_AND_ASSIGN(HistoryDataStore);
« no previous file with comments | « chrome/browser/ui/app_list/search/history.cc ('k') | chrome/browser/ui/app_list/search/history_data_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698