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 415c4bf6a1e3b24ed87e7835a6d9d0811a2153de..52a27588f9c2ae3fb5dd5bc380f3a3638ba2cfe6 100644 |
--- a/content/browser/service_worker/service_worker_script_cache_map.cc |
+++ b/content/browser/service_worker/service_worker_script_cache_map.cc |
@@ -16,8 +16,7 @@ ServiceWorkerScriptCacheMap::ServiceWorkerScriptCacheMap( |
ServiceWorkerVersion* owner, |
base::WeakPtr<ServiceWorkerContextCore> context) |
: owner_(owner), |
- context_(context), |
- has_error_(false) { |
+ context_(context) { |
} |
ServiceWorkerScriptCacheMap::~ServiceWorkerScriptCacheMap() { |
@@ -40,14 +39,15 @@ void ServiceWorkerScriptCacheMap::NotifyStartedCaching( |
} |
void ServiceWorkerScriptCacheMap::NotifyFinishedCaching( |
- const GURL& url, bool success) { |
+ const GURL& url, const net::URLRequestStatus& status) { |
DCHECK_NE(kInvalidServiceWorkerResponseId, Lookup(url)); |
DCHECK(owner_->status() == ServiceWorkerVersion::NEW || |
owner_->status() == ServiceWorkerVersion::INSTALLING); |
- if (!success) { |
+ if (!status.is_success()) { |
context_->storage()->DoomUncommittedResponse(Lookup(url)); |
- has_error_ = true; |
resource_ids_.erase(url); |
+ if (owner_->script_url() == url) |
+ main_script_status_ = status; |
} |
} |