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

Unified Diff: content/browser/service_worker/service_worker_context_core.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_context_core.cc
diff --git a/content/browser/service_worker/service_worker_context_core.cc b/content/browser/service_worker/service_worker_context_core.cc
index 7af19648dcd39dbf3a2400690938880b95624eb8..5c3469234accb1119f8ac142349e83ab8a9e7969 100644
--- a/content/browser/service_worker/service_worker_context_core.cc
+++ b/content/browser/service_worker/service_worker_context_core.cc
@@ -209,7 +209,7 @@ void ServiceWorkerContextCore::RegisterServiceWorker(
const RegistrationCallback& callback) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (storage()->IsDisabled()) {
- callback.Run(SERVICE_WORKER_ERROR_ABORT,
+ callback.Run(SERVICE_WORKER_ERROR_ABORT, std::string(),
kInvalidServiceWorkerRegistrationId);
return;
}
@@ -292,15 +292,16 @@ void ServiceWorkerContextCore::RegistrationComplete(
const GURL& pattern,
const ServiceWorkerContextCore::RegistrationCallback& callback,
ServiceWorkerStatusCode status,
+ const std::string& status_message,
ServiceWorkerRegistration* registration) {
if (status != SERVICE_WORKER_OK) {
DCHECK(!registration);
- callback.Run(status, kInvalidServiceWorkerRegistrationId);
+ callback.Run(status, status_message, kInvalidServiceWorkerRegistrationId);
return;
}
DCHECK(registration);
- callback.Run(status, registration->id());
+ callback.Run(status, status_message, registration->id());
if (observer_list_.get()) {
observer_list_->Notify(&ServiceWorkerContextObserver::OnRegistrationStored,
pattern);

Powered by Google App Engine
This is Rietveld 408576698