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

Unified Diff: chrome/browser/ui/app_list/search/common/webservice_cache.h

Issue 1763273002: base: Remove OwningMRUCache in favor of scoped_ptrs in MRUCache (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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/common/webservice_cache.h
diff --git a/chrome/browser/ui/app_list/search/common/webservice_cache.h b/chrome/browser/ui/app_list/search/common/webservice_cache.h
index b71c76b90a1a8b7e3372d7aaa3d26f28af6fa286..73a782094ac51f58182de66c54dcaa6d1ed9f71e 100644
--- a/chrome/browser/ui/app_list/search/common/webservice_cache.h
+++ b/chrome/browser/ui/app_list/search/common/webservice_cache.h
@@ -64,22 +64,15 @@ class WebserviceCache : public KeyedService,
private:
struct Payload {
- Payload(const base::Time& time,
- const base::DictionaryValue* result)
- : time(time), result(result) {}
- Payload() {}
+ Payload(const base::Time& time, scoped_ptr<base::DictionaryValue> result);
+ Payload();
+ ~Payload();
base::Time time;
- const base::DictionaryValue* result;
+ scoped_ptr<base::DictionaryValue> result;
};
- class CacheDeletor {
- public:
- void operator()(const Payload& payload);
- };
- typedef base::
- MRUCacheBase<std::string, Payload, std::less<std::string>, CacheDeletor>
- Cache;
+ typedef base::MRUCache<std::string, scoped_ptr<Payload>> Cache;
danakj 2016/03/07 21:27:10 using
vmpstr 2016/03/07 21:45:32 Done.
// Callback for when the cache is loaded from the dictionary data store.
void OnCacheLoaded(scoped_ptr<base::DictionaryValue>);
@@ -87,8 +80,7 @@ class WebserviceCache : public KeyedService,
// Populates the payload parameter with the corresponding payload stored
// in the given dictionary. If the dictionary is invalid for any reason,
// this method will return false.
- bool PayloadFromDict(const base::DictionaryValue* dict,
- Payload* payload);
+ bool PayloadFromDict(const base::DictionaryValue* dict, Payload* payload);
// Returns a dictionary value for a given payload. The returned dictionary
// will be owned by the data_store_ cached_dict, and freed on the destruction

Powered by Google App Engine
This is Rietveld 408576698