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

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

Issue 2812953002: Stop passing raw pointers to base::Value API in c/b/ui (Closed)
Patch Set: No ListValue::SetDouble Created 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_UI_APP_LIST_SEARCH_COMMON_WEBSERVICE_CACHE_H_ 5 #ifndef CHROME_BROWSER_UI_APP_LIST_SEARCH_COMMON_WEBSERVICE_CACHE_H_
6 #define CHROME_BROWSER_UI_APP_LIST_SEARCH_COMMON_WEBSERVICE_CACHE_H_ 6 #define CHROME_BROWSER_UI_APP_LIST_SEARCH_COMMON_WEBSERVICE_CACHE_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 void OnCacheLoaded(std::unique_ptr<base::DictionaryValue>); 81 void OnCacheLoaded(std::unique_ptr<base::DictionaryValue>);
82 82
83 // Populates the payload parameter with the corresponding payload stored 83 // Populates the payload parameter with the corresponding payload stored
84 // in the given dictionary. If the dictionary is invalid for any reason, 84 // in the given dictionary. If the dictionary is invalid for any reason,
85 // this method will return false. 85 // this method will return false.
86 bool PayloadFromDict(const base::DictionaryValue* dict, Payload* payload); 86 bool PayloadFromDict(const base::DictionaryValue* dict, Payload* payload);
87 87
88 // Returns a dictionary value for a given payload. The returned dictionary 88 // Returns a dictionary value for a given payload. The returned dictionary
89 // will be owned by the data_store_ cached_dict, and freed on the destruction 89 // will be owned by the data_store_ cached_dict, and freed on the destruction
90 // of our dictionary datastore. 90 // of our dictionary datastore.
91 base::DictionaryValue* DictFromPayload(const Payload& payload); 91 std::unique_ptr<base::DictionaryValue> DictFromPayload(
92 const Payload& payload);
92 93
93 // Trims our MRU cache, making sure that any element that is removed is also 94 // Trims our MRU cache, making sure that any element that is removed is also
94 // removed from the dictionary data store. 95 // removed from the dictionary data store.
95 void TrimCache(); 96 void TrimCache();
96 97
97 // Prepends a type string to the given query and returns a new query string. 98 // Prepends a type string to the given query and returns a new query string.
98 std::string PrependType(QueryType type, const std::string& query); 99 std::string PrependType(QueryType type, const std::string& query);
99 100
100 Cache cache_; 101 Cache cache_;
101 scoped_refptr<DictionaryDataStore> data_store_; 102 scoped_refptr<DictionaryDataStore> data_store_;
102 103
103 bool cache_loaded_; 104 bool cache_loaded_;
104 105
105 DISALLOW_COPY_AND_ASSIGN(WebserviceCache); 106 DISALLOW_COPY_AND_ASSIGN(WebserviceCache);
106 }; 107 };
107 108
108 } // namespace app_list 109 } // namespace app_list
109 110
110 #endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_COMMON_WEBSERVICE_CACHE_H_ 111 #endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_COMMON_WEBSERVICE_CACHE_H_
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/proxy_cros_settings_parser.cc ('k') | chrome/browser/ui/app_list/search/common/webservice_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698