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

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

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: rebase 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.cc
diff --git a/content/browser/appcache/appcache_disk_cache.cc b/content/browser/appcache/appcache_disk_cache.cc
index 03d348c76bba246197ddaddad410ffccb63caa49..8419e11c5104714d8aaf27cba225f197fafa21c9 100644
--- a/content/browser/appcache/appcache_disk_cache.cc
+++ b/content/browser/appcache/appcache_disk_cache.cc
@@ -260,7 +260,7 @@ int AppCacheDiskCache::CreateEntry(int64 key, Entry** entry,
if (is_disabled_)
return net::ERR_ABORTED;
- if (is_initializing()) {
+ if (is_initializing_or_waiting_to_initialize()) {
pending_calls_.push_back(PendingCall(CREATE, key, entry, callback));
return net::ERR_IO_PENDING;
}
@@ -279,7 +279,7 @@ int AppCacheDiskCache::OpenEntry(int64 key, Entry** entry,
if (is_disabled_)
return net::ERR_ABORTED;
- if (is_initializing()) {
+ if (is_initializing_or_waiting_to_initialize()) {
pending_calls_.push_back(PendingCall(OPEN, key, entry, callback));
return net::ERR_IO_PENDING;
}
@@ -297,7 +297,7 @@ int AppCacheDiskCache::DoomEntry(int64 key,
if (is_disabled_)
return net::ERR_ABORTED;
- if (is_initializing()) {
+ if (is_initializing_or_waiting_to_initialize()) {
pending_calls_.push_back(PendingCall(DOOM, key, NULL, callback));
return net::ERR_IO_PENDING;
}
@@ -311,6 +311,7 @@ int AppCacheDiskCache::DoomEntry(int64 key,
AppCacheDiskCache::AppCacheDiskCache(bool use_simple_cache)
: use_simple_cache_(use_simple_cache),
is_disabled_(false),
+ is_waiting_to_initialize_(false),
weak_factory_(this) {
}
@@ -339,7 +340,7 @@ int AppCacheDiskCache::Init(
bool force,
const scoped_refptr<base::SingleThreadTaskRunner>& cache_thread,
const net::CompletionCallback& callback) {
- DCHECK(!is_initializing() && !disk_cache_.get());
+ DCHECK(!is_initializing_or_waiting_to_initialize() && !disk_cache_.get());
is_disabled_ = false;
create_backend_callback_ = new CreateBackendCallbackShim(this);
« no previous file with comments | « content/browser/appcache/appcache_disk_cache.h ('k') | content/browser/service_worker/service_worker_database.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698