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

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

Issue 845313004: Service Worker: Improve error messages from register(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: git-cl format Created 5 years, 11 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 852e0bf73646d6adf57575b1438918440d02f9f2..d1ae0609bdd60ac2615626ea69c73c2a60a7ca32 100644
--- a/content/browser/service_worker/service_worker_dispatcher_host.cc
+++ b/content/browser/service_worker/service_worker_dispatcher_host.cc
@@ -593,12 +593,13 @@ void ServiceWorkerDispatcherHost::RegistrationComplete(
int provider_id,
int request_id,
ServiceWorkerStatusCode status,
+ const std::string& status_message,
int64 registration_id) {
if (!GetContext())
return;
if (status != SERVICE_WORKER_OK) {
- SendRegistrationError(thread_id, request_id, status);
+ SendRegistrationError(thread_id, request_id, status, status_message);
return;
}
@@ -853,11 +854,12 @@ void ServiceWorkerDispatcherHost::GetRegistrationComplete(
void ServiceWorkerDispatcherHost::SendRegistrationError(
int thread_id,
int request_id,
- ServiceWorkerStatusCode status) {
+ ServiceWorkerStatusCode status,
+ const std::string& status_message) {
base::string16 error_message;
blink::WebServiceWorkerError::ErrorType error_type;
- GetServiceWorkerRegistrationStatusResponse(
- status, &error_type, &error_message);
+ GetServiceWorkerRegistrationStatusResponse(status, status_message,
+ &error_type, &error_message);
Send(new ServiceWorkerMsg_ServiceWorkerRegistrationError(
thread_id, request_id, error_type,
base::ASCIIToUTF16(kServiceWorkerRegisterErrorPrefix) + error_message));
@@ -869,8 +871,8 @@ void ServiceWorkerDispatcherHost::SendUnregistrationError(
ServiceWorkerStatusCode status) {
base::string16 error_message;
blink::WebServiceWorkerError::ErrorType error_type;
- GetServiceWorkerRegistrationStatusResponse(
- status, &error_type, &error_message);
+ GetServiceWorkerRegistrationStatusResponse(status, std::string(), &error_type,
+ &error_message);
Send(new ServiceWorkerMsg_ServiceWorkerUnregistrationError(
thread_id, request_id, error_type,
base::ASCIIToUTF16(kServiceWorkerUnregisterErrorPrefix) + error_message));
@@ -882,8 +884,8 @@ void ServiceWorkerDispatcherHost::SendGetRegistrationError(
ServiceWorkerStatusCode status) {
base::string16 error_message;
blink::WebServiceWorkerError::ErrorType error_type;
- GetServiceWorkerRegistrationStatusResponse(
- status, &error_type, &error_message);
+ GetServiceWorkerRegistrationStatusResponse(status, std::string(), &error_type,
+ &error_message);
Send(new ServiceWorkerMsg_ServiceWorkerGetRegistrationError(
thread_id, request_id, error_type,
base::ASCIIToUTF16(kServiceWorkerGetRegistrationErrorPrefix) +

Powered by Google App Engine
This is Rietveld 408576698