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

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

Issue 516823003: ServiceWorker: Change the return value of ServiceWorkerRegistration::unregister to boolean (2/4) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase 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_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 44d5b796cc17791de8f48d6c013f442d26eb09ab..b7705561e80b197bebfd9d906f17e9d507b916ee 100644
--- a/content/browser/service_worker/service_worker_dispatcher_host.cc
+++ b/content/browser/service_worker/service_worker_dispatcher_host.cc
@@ -231,7 +231,7 @@ void ServiceWorkerDispatcherHost::OnUnregisterServiceWorker(
int provider_id,
const GURL& pattern) {
if (!GetContext()) {
- Send(new ServiceWorkerMsg_ServiceWorkerRegistrationError(
+ Send(new ServiceWorkerMsg_ServiceWorkerUnregistrationError(
thread_id,
request_id,
blink::WebServiceWorkerError::ErrorTypeAbort,
@@ -246,7 +246,7 @@ void ServiceWorkerDispatcherHost::OnUnregisterServiceWorker(
return;
}
if (!provider_host->IsContextAlive()) {
- Send(new ServiceWorkerMsg_ServiceWorkerRegistrationError(
+ Send(new ServiceWorkerMsg_ServiceWorkerUnregistrationError(
thread_id,
request_id,
blink::WebServiceWorkerError::ErrorTypeAbort,
@@ -535,7 +535,7 @@ void ServiceWorkerDispatcherHost::UnregistrationComplete(
int request_id,
ServiceWorkerStatusCode status) {
if (status != SERVICE_WORKER_OK) {
- SendRegistrationError(thread_id, request_id, status);
+ SendUnregistrationError(thread_id, request_id, status);
return;
}
@@ -554,6 +554,18 @@ void ServiceWorkerDispatcherHost::SendRegistrationError(
thread_id, request_id, error_type, error_message));
}
+void ServiceWorkerDispatcherHost::SendUnregistrationError(
+ int thread_id,
+ int request_id,
+ ServiceWorkerStatusCode status) {
+ base::string16 error_message;
+ blink::WebServiceWorkerError::ErrorType error_type;
+ GetServiceWorkerRegistrationStatusResponse(
+ status, &error_type, &error_message);
+ Send(new ServiceWorkerMsg_ServiceWorkerUnregistrationError(
+ thread_id, request_id, error_type, error_message));
+}
+
ServiceWorkerContextCore* ServiceWorkerDispatcherHost::GetContext() {
return context_wrapper_->context();
}

Powered by Google App Engine
This is Rietveld 408576698