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); |