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

Unified Diff: content/browser/appcache/appcache_disk_cache.h

Issue 1152543002: ServiceWorker: Migrate the script cache backend from BlockFile to Simple (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update comment Created 5 years, 6 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: content/browser/appcache/appcache_disk_cache.h
diff --git a/content/browser/appcache/appcache_disk_cache.h b/content/browser/appcache/appcache_disk_cache.h
index 6107f5b6b26f767d2a775ce8b1aa1a5d679ce888..98ac3c0a69f3a29ae14e650a0c65f8ea144d52d7 100644
--- a/content/browser/appcache/appcache_disk_cache.h
+++ b/content/browser/appcache/appcache_disk_cache.h
@@ -52,6 +52,10 @@ class CONTENT_EXPORT AppCacheDiskCache
const net::CompletionCallback& callback) override;
int DoomEntry(int64 key, const net::CompletionCallback& callback) override;
+ void set_is_waiting_to_initialize(bool is_waiting_to_initialize) {
+ is_waiting_to_initialize_ = is_waiting_to_initialize;
+ }
+
protected:
explicit AppCacheDiskCache(bool use_simple_cache);
disk_cache::Backend* disk_cache() { return disk_cache_.get(); }
@@ -89,9 +93,10 @@ class CONTENT_EXPORT AppCacheDiskCache
typedef std::set<ActiveCall*> ActiveCalls;
typedef std::set<EntryImpl*> OpenEntries;
- bool is_initializing() const {
- return create_backend_callback_.get() != NULL;
+ bool is_initializing_or_waiting_to_initialize() const {
+ return create_backend_callback_.get() != NULL || is_waiting_to_initialize_;
}
+
int Init(net::CacheType cache_type,
const base::FilePath& directory,
int cache_size,
@@ -104,6 +109,7 @@ class CONTENT_EXPORT AppCacheDiskCache
bool use_simple_cache_;
bool is_disabled_;
+ bool is_waiting_to_initialize_;
net::CompletionCallback init_callback_;
scoped_refptr<CreateBackendCallbackShim> create_backend_callback_;
PendingCalls pending_calls_;

Powered by Google App Engine
This is Rietveld 408576698