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

Unified Diff: content/browser/service_worker/service_worker_script_cache_map.cc

Issue 369063004: ServiceWorker: SWRegisterJob should manage status of SWVersion (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 5 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/service_worker/service_worker_script_cache_map.cc
diff --git a/content/browser/service_worker/service_worker_script_cache_map.cc b/content/browser/service_worker/service_worker_script_cache_map.cc
index 60876b8d71694cdd720ec3c97bcb0365d209e070..54bcd77c955f19a74e238fad49b310f3ed3ad1c3 100644
--- a/content/browser/service_worker/service_worker_script_cache_map.cc
+++ b/content/browser/service_worker/service_worker_script_cache_map.cc
@@ -33,7 +33,8 @@ int64 ServiceWorkerScriptCacheMap::Lookup(const GURL& url) {
void ServiceWorkerScriptCacheMap::NotifyStartedCaching(
const GURL& url, int64 resource_id) {
DCHECK_EQ(kInvalidServiceWorkerResponseId, Lookup(url));
- DCHECK(owner_->status() == ServiceWorkerVersion::NEW);
+ DCHECK(owner_->status() == ServiceWorkerVersion::NEW ||
+ owner_->status() == ServiceWorkerVersion::INSTALLING);
resource_ids_[url] = resource_id;
context_->storage()->StoreUncommittedReponseId(resource_id);
}
@@ -41,7 +42,8 @@ void ServiceWorkerScriptCacheMap::NotifyStartedCaching(
void ServiceWorkerScriptCacheMap::NotifyFinishedCaching(
const GURL& url, bool success) {
DCHECK_NE(kInvalidServiceWorkerResponseId, Lookup(url));
- DCHECK(owner_->status() == ServiceWorkerVersion::NEW);
+ DCHECK(owner_->status() == ServiceWorkerVersion::NEW ||
+ owner_->status() == ServiceWorkerVersion::INSTALLING);
if (!success) {
context_->storage()->DoomUncommittedResponse(Lookup(url));
has_error_ = true;

Powered by Google App Engine
This is Rietveld 408576698