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

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

Issue 1675613002: service worker: use 200 OK for update requests even in the no update case (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 b5477ab9a0195958a0be000ce5961f312dd8f918..3fbdf3b44cf7b7b9222d80d9e7e967fa3af6174f 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
@@ -472,8 +472,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());
@@ -481,7 +480,6 @@ net::Error ServiceWorkerWriteToCacheJob::NotifyFinishedCaching(
version_->script_cache_map()->NotifyFinishedCaching(url_, size, status,
status_message);
}
-
did_notify_finished_ = true;
return result;
}
@@ -489,7 +487,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_);

Powered by Google App Engine
This is Rietveld 408576698