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

Unified Diff: content/browser/service_worker/service_worker_write_to_cache_job.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: 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_write_to_cache_job.cc
diff --git a/content/browser/service_worker/service_worker_write_to_cache_job.cc b/content/browser/service_worker/service_worker_write_to_cache_job.cc
index bb923eb013aa331f52594f6aa74682249859329d..e6cfb51f4b0b476bbf31dceb900d2afb9cafe9df 100644
--- a/content/browser/service_worker/service_worker_write_to_cache_job.cc
+++ b/content/browser/service_worker/service_worker_write_to_cache_job.cc
@@ -280,6 +280,7 @@ void ServiceWorkerWriteToCacheJob::OnReceivedRedirect(
// Script resources can't redirect.
AsyncNotifyDoneHelper(net::URLRequestStatus(
net::URLRequestStatus::FAILED, net::ERR_FAILED));
+ version_->NotifyStartWorkerURLRequestError(SERVICE_WORKER_ERROR_SECURITY);
michaeln 2014/09/13 01:21:34 This class is used for more than the main resource
xiang 2014/09/16 06:24:31 I see. However from the spec seems the imports red
}
void ServiceWorkerWriteToCacheJob::OnAuthRequired(
@@ -337,6 +338,7 @@ void ServiceWorkerWriteToCacheJob::OnResponseStarted(
if (request->GetResponseCode() / 100 != 2) {
AsyncNotifyDoneHelper(net::URLRequestStatus(
net::URLRequestStatus::FAILED, net::ERR_FAILED));
+ version_->NotifyStartWorkerURLRequestError(SERVICE_WORKER_ERROR_NETWORK);
// TODO(michaeln): Instead of error'ing immediately, send the net
// response to our consumer, just don't cache it?
return;
@@ -350,6 +352,7 @@ void ServiceWorkerWriteToCacheJob::OnResponseStarted(
mime_type != "application/javascript") {
AsyncNotifyDoneHelper(net::URLRequestStatus(
net::URLRequestStatus::FAILED, net::ERR_FAILED));
+ version_->NotifyStartWorkerURLRequestError(SERVICE_WORKER_ERROR_SECURITY);
return;
}
}

Powered by Google App Engine
This is Rietveld 408576698