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

Unified Diff: chrome/browser/ui/app_list/search/webstore/webstore_provider.cc

Issue 49353006: Add caching for apps list search results. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 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
« no previous file with comments | « chrome/browser/ui/app_list/search/people/people_provider.cc ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/app_list/search/webstore/webstore_provider.cc
diff --git a/chrome/browser/ui/app_list/search/webstore/webstore_provider.cc b/chrome/browser/ui/app_list/search/webstore/webstore_provider.cc
index 973fc2e9a2b5fbb1250203c45be7596e9a3bbf06..b22b397bc19f959794e1c065d559c0312879d735 100644
--- a/chrome/browser/ui/app_list/search/webstore/webstore_provider.cc
+++ b/chrome/browser/ui/app_list/search/webstore/webstore_provider.cc
@@ -53,12 +53,13 @@ void WebstoreProvider::Start(const base::string16& query) {
}
query_ = UTF16ToUTF8(query);
- const base::DictionaryValue* cached_result = cache_.Get(query_);
- if (cached_result) {
- ProcessWebstoreSearchResults(cached_result);
+ const CacheResult result = cache_->Get(WebserviceCache::WEBSTORE, query_);
+ if (result.second) {
+ ProcessWebstoreSearchResults(result.second);
if (!webstore_search_fetched_callback_.is_null())
webstore_search_fetched_callback_.Run();
- return;
+ if (result.first == FRESH)
+ return;
}
if (UseWebstoreSearch()) {
@@ -96,7 +97,7 @@ void WebstoreProvider::StartQuery() {
void WebstoreProvider::OnWebstoreSearchFetched(
scoped_ptr<base::DictionaryValue> json) {
ProcessWebstoreSearchResults(json.get());
- cache_.Put(query_, json.Pass());
+ cache_->Put(WebserviceCache::WEBSTORE, query_, json.Pass());
if (!webstore_search_fetched_callback_.is_null())
webstore_search_fetched_callback_.Run();
« no previous file with comments | « chrome/browser/ui/app_list/search/people/people_provider.cc ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698