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

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

Issue 1693303002: ServiceWorker: Make ServiceWorkerStorage more self-defensive (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_dispatcher_host.cc
diff --git a/content/browser/service_worker/service_worker_dispatcher_host.cc b/content/browser/service_worker/service_worker_dispatcher_host.cc
index 0d16327cb92178a0933a1b75e9828d87fc99ff44..343e6dad7797565f3cbf505348f8fd717e02091d 100644
--- a/content/browser/service_worker/service_worker_dispatcher_host.cc
+++ b/content/browser/service_worker/service_worker_dispatcher_host.cc
@@ -583,11 +583,6 @@ void ServiceWorkerDispatcherHost::OnGetRegistration(
return;
}
- if (GetContext()->storage()->IsDisabled()) {
- SendGetRegistrationError(thread_id, request_id, SERVICE_WORKER_ERROR_ABORT);
- return;
- }
-
TRACE_EVENT_ASYNC_BEGIN1(
"ServiceWorker",
"ServiceWorkerDispatcherHost::GetRegistration",
@@ -656,12 +651,6 @@ void ServiceWorkerDispatcherHost::OnGetRegistrations(int thread_id,
return;
}
- if (GetContext()->storage()->IsDisabled()) {
- SendGetRegistrationsError(thread_id, request_id,
- SERVICE_WORKER_ERROR_ABORT);
- return;
- }
-
TRACE_EVENT_ASYNC_BEGIN0("ServiceWorker",
"ServiceWorkerDispatcherHost::GetRegistrations",
request_id);
@@ -1214,6 +1203,7 @@ void ServiceWorkerDispatcherHost::GetRegistrationsComplete(
int thread_id,
int provider_id,
int request_id,
+ ServiceWorkerStatusCode status,
const std::vector<scoped_refptr<ServiceWorkerRegistration>>&
registrations) {
TRACE_EVENT_ASYNC_END0("ServiceWorker",
@@ -1227,6 +1217,11 @@ void ServiceWorkerDispatcherHost::GetRegistrationsComplete(
if (!provider_host)
return; // The provider has already been destroyed.
+ if (status != SERVICE_WORKER_OK) {
+ SendGetRegistrationsError(thread_id, request_id, status);
+ return;
+ }
+
std::vector<ServiceWorkerRegistrationObjectInfo> object_infos;
std::vector<ServiceWorkerVersionAttributes> version_attrs;

Powered by Google App Engine
This is Rietveld 408576698