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 b5477ab9a0195958a0be000ce5961f312dd8f918..8c6148f8ac98720d34c635f91236b15317026530 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 |
@@ -41,17 +41,11 @@ const char kRedirectError[] = |
"The script resource is behind a redirect, which is disallowed."; |
const char kServiceWorkerAllowed[] = "Service-Worker-Allowed"; |
-// The net error code used when the job fails the update attempt because the new |
-// script is byte-by-byte identical to the incumbent script. This error is shown |
-// in DevTools and in netlog, so we want something obscure enough that it won't |
-// conflict with a legitimate network error, and not too alarming if seen by |
-// developers. |
-// TODO(falken): Redesign this class so we don't have to fail at the network |
-// stack layer just to cancel the update. |
-const net::Error kIdenticalScriptError = net::ERR_FILE_EXISTS; |
- |
} // namespace |
+const net::Error ServiceWorkerWriteToCacheJob::kIdenticalScriptError = |
+ net::ERR_FILE_EXISTS; |
+ |
ServiceWorkerWriteToCacheJob::ServiceWorkerWriteToCacheJob( |
net::URLRequest* request, |
net::NetworkDelegate* network_delegate, |
@@ -472,8 +466,7 @@ net::Error ServiceWorkerWriteToCacheJob::NotifyFinishedCaching( |
// exists. |
if (status.status() == net::URLRequestStatus::SUCCESS && |
!cache_writer_->did_replace()) { |
- result = kIdenticalScriptError; |
- status = net::URLRequestStatus::FromError(result); |
+ status = net::URLRequestStatus::FromError(kIdenticalScriptError); |
version_->SetStartWorkerStatusCode(SERVICE_WORKER_ERROR_EXISTS); |
version_->script_cache_map()->NotifyFinishedCaching(url_, size, status, |
std::string()); |
@@ -489,7 +482,7 @@ net::Error ServiceWorkerWriteToCacheJob::NotifyFinishedCaching( |
scoped_ptr<ServiceWorkerResponseReader> |
ServiceWorkerWriteToCacheJob::CreateCacheResponseReader() { |
if (incumbent_resource_id_ == kInvalidServiceWorkerResourceId || |
- version_->skip_script_comparison()) { |
+ !version_->pause_after_download()) { |
return nullptr; |
} |
return context_->storage()->CreateResponseReader(incumbent_resource_id_); |