Chromium Code Reviews| 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 |