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

Unified Diff: services/url_response_disk_cache/url_response_disk_cache_db.h

Issue 1351693007: Add invalidation to url_response_disk_cache. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Follow review Created 5 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: services/url_response_disk_cache/url_response_disk_cache_db.h
diff --git a/services/url_response_disk_cache/url_response_disk_cache_db.h b/services/url_response_disk_cache/url_response_disk_cache_db.h
index c8aee1b58012320e3d9841bc54c2b55a078846e2..cdf5da159fd1356136b37bcd0d1c1fa78d8d8f9e 100644
--- a/services/url_response_disk_cache/url_response_disk_cache_db.h
+++ b/services/url_response_disk_cache/url_response_disk_cache_db.h
@@ -44,6 +44,10 @@ class URLResponseDiskCacheDB
uint64_t GetVersion();
void SetVersion(uint64_t version);
+ // Set and get an entry for a given key.
+ void Put(CacheKeyPtr key, CacheEntryPtr entry);
+ CacheEntryPtr Get(CacheKeyPtr key);
+
// Put an entry for the given |request_origin| and |url|. Older entry for the
// same |request_origin| and |url| will not be removed, but will be shadowed
// by the new one.
@@ -52,9 +56,11 @@ class URLResponseDiskCacheDB
CacheEntryPtr entry);
// Returns the newest entry for the given |request_origin| and |url|, or null
- // if none exist.
+ // if none exist. If |key| is not null and GetNewest returns an entry, |*key|
+ // will contain the actual key of the entry.
CacheEntryPtr GetNewest(const std::string& request_origin,
- const std::string& url);
+ const std::string& url,
+ CacheKeyPtr* key);
// Delete the entry for the given |key|.
void Delete(CacheKeyPtr key);

Powered by Google App Engine
This is Rietveld 408576698