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

Unified Diff: content/browser/devtools/protocol/service_worker_handler.cc

Issue 1841863003: DevTools: move the force update SW on reload checkbox to the Resources / Service Workers view. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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/devtools/protocol/service_worker_handler.cc
diff --git a/content/browser/devtools/protocol/service_worker_handler.cc b/content/browser/devtools/protocol/service_worker_handler.cc
index 3b529f6414e605f3751ab2bea8a99dde4724066c..d6e89a71dda90d448c0cd9eacd5c4e847568bb70 100644
--- a/content/browser/devtools/protocol/service_worker_handler.cc
+++ b/content/browser/devtools/protocol/service_worker_handler.cc
@@ -133,10 +133,7 @@ scoped_refptr<ServiceWorkerRegistration> CreateRegistrationDictionaryValue(
base::Int64ToString(registration_info.registration_id))
->set_scope_url(registration_info.pattern.spec())
->set_is_deleted(registration_info.delete_flag ==
- ServiceWorkerRegistrationInfo::IS_DELETED)
- ->set_force_update_on_page_load(
- registration_info.force_update_on_page_load ==
- ServiceWorkerRegistrationInfo::IS_FORCED));
+ ServiceWorkerRegistrationInfo::IS_DELETED));
return registration;
}
@@ -429,18 +426,10 @@ Response ServiceWorkerHandler::SetDebugOnStart(bool debug_on_start) {
}
Response ServiceWorkerHandler::SetForceUpdateOnPageLoad(
- const std::string& registration_id,
bool force_update_on_page_load) {
if (!context_)
return CreateContextErrorResponse();
- int64_t id = kInvalidServiceWorkerRegistrationId;
- if (!base::StringToInt64(registration_id, &id))
- return CreateInvalidVersionIdErrorResponse();
- if (force_update_on_page_load)
- force_update_enabled_registrations_.insert(id);
- else
- force_update_enabled_registrations_.erase(id);
- context_->SetForceUpdateOnPageLoad(id, force_update_on_page_load);
+ context_->SetForceUpdateOnPageLoad(force_update_on_page_load);
return Response::OK();
}
@@ -616,11 +605,8 @@ void ServiceWorkerHandler::ReportWorkerTerminated(
}
void ServiceWorkerHandler::ClearForceUpdate() {
- if (context_) {
- for (const auto registration_id : force_update_enabled_registrations_)
- context_->SetForceUpdateOnPageLoad(registration_id, false);
- }
- force_update_enabled_registrations_.clear();
+ if (context_)
+ context_->SetForceUpdateOnPageLoad(false);
}
} // namespace service_worker

Powered by Google App Engine
This is Rietveld 408576698