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

Unified Diff: third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerError.cpp

Issue 1481523006: ServiceWorker: Should throw TypeError instead of Unknown/SecurityError. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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: third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerError.cpp
diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerError.cpp b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerError.cpp
index 53a41ba2907fd5d7921efe1de50de899ec11a559..550d67b793457f9aba17f0b22230bce81317e977 100644
--- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerError.cpp
+++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerError.cpp
@@ -58,6 +58,10 @@ DOMException* ServiceWorkerError::take(ScriptPromiseResolver*, const WebServiceW
case WebServiceWorkerError::ErrorTypeInstall:
// FIXME: Introduce new InstallError type to ExceptionCodes?
return createException(AbortError, "The Service Worker installation failed.", webError.message);
+ case WebServiceWorkerError::ErrorTypeNavigation:
+ // ErrorTypeNavigation should have bailed out before calling this.
+ ASSERT_NOT_REACHED();
+ return DOMException::create(UnknownError);
case WebServiceWorkerError::ErrorTypeNetwork:
return createException(NetworkError, "The Service Worker failed by network.", webError.message);
case WebServiceWorkerError::ErrorTypeNotFound:

Powered by Google App Engine
This is Rietveld 408576698