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

Unified Diff: chrome/browser/android/thumbnail/scoped_ptr_expiring_cache.h

Issue 2244783005: Android: Don't evict thumbnails for last visible tab on stop (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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/android/thumbnail/scoped_ptr_expiring_cache.h
diff --git a/chrome/browser/android/thumbnail/scoped_ptr_expiring_cache.h b/chrome/browser/android/thumbnail/scoped_ptr_expiring_cache.h
index 912a4a15b746601423401c11dfa08fab2c79480f..00a680178da2c4240377a56fde619376d4ba1221 100644
--- a/chrome/browser/android/thumbnail/scoped_ptr_expiring_cache.h
+++ b/chrome/browser/android/thumbnail/scoped_ptr_expiring_cache.h
@@ -38,12 +38,14 @@ class ScopedPtrExpiringCache {
return NULL;
}
- void Remove(const Key& key) {
+ std::unique_ptr<Value> Remove(const Key& key) {
iterator iter = map_.find(key);
+ std::unique_ptr<Value> value;
if (iter != map_.end()) {
- delete iter->second;
+ value.reset(iter->second);
map_.erase(key);
}
+ return std::move(value);
}
void Clear() {
« no previous file with comments | « no previous file | chrome/browser/android/thumbnail/thumbnail_cache.h » ('j') | chrome/browser/android/thumbnail/thumbnail_cache.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698