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

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

Issue 567903002: ServiceWorker: Change worker script fetch error code(2/3). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase & fix typo Created 6 years, 3 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 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;
}
}

Powered by Google App Engine
This is Rietveld 408576698