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

Unified Diff: chrome/browser/ui/app_list/search/webstore_cache.cc

Issue 23874015: Implement people search. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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/webstore_cache.cc
diff --git a/chrome/browser/ui/app_list/search/webstore_cache.cc b/chrome/browser/ui/app_list/search/webstore_cache.cc
deleted file mode 100644
index be130e4c7b86a03668079459b75dd207aa36f56b..0000000000000000000000000000000000000000
--- a/chrome/browser/ui/app_list/search/webstore_cache.cc
+++ /dev/null
@@ -1,47 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/ui/app_list/search/webstore_cache.h"
-
-#include "base/values.h"
-
-namespace app_list {
-namespace {
-
-const int kWebstoreCacheMaxSize = 100;
-const int kWebstoreCacheTimeLimitInMinutes = 1;
-
-} // namespace
-
-void WebstoreCache::CacheDeletor::operator()(WebstoreCache::Payload& payload) {
- delete payload.second;
-}
-
-WebstoreCache::WebstoreCache()
- : cache_(kWebstoreCacheMaxSize) {
-}
-
-WebstoreCache::~WebstoreCache() {
-}
-
-const base::DictionaryValue* WebstoreCache::Get(const std::string& query) {
- Cache::iterator iter = cache_.Get(query);
- if (iter != cache_.end()) {
- if (base::Time::Now() - iter->second.first <=
- base::TimeDelta::FromMinutes(kWebstoreCacheTimeLimitInMinutes)) {
- return iter->second.second;
- } else {
- cache_.Erase(iter);
- }
- }
- return NULL;
-}
-
-void WebstoreCache::Put(const std::string& query,
- scoped_ptr<base::DictionaryValue> result) {
- if (result)
- cache_.Put(query, std::make_pair(base::Time::Now(), result.release()));
-}
-
-} // namespace app_list

Powered by Google App Engine
This is Rietveld 408576698