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

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

Issue 2059953003: service worker: Fix the type of a register promise reject value (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/registration-tests.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainer.cpp
diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainer.cpp b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainer.cpp
index efd57b705ecb0132efe521ca599154baee0085e0..ff4c793c14f092ff6b3103f00adef70c3a461a53 100644
--- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainer.cpp
+++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainer.cpp
@@ -76,9 +76,16 @@ public:
{
if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContext()->activeDOMObjectsAreStopped())
return;
- if (error.errorType == WebServiceWorkerError::ErrorTypeType) {
- m_resolver->reject(V8ThrowException::createTypeError(m_resolver->getScriptState()->isolate(), error.message));
- } else {
+ switch (error.errorType) {
+ case WebServiceWorkerError::ErrorTypeNetwork:
+ case WebServiceWorkerError::ErrorTypeScriptEvaluateFailed:
+ case WebServiceWorkerError::ErrorTypeType: {
+ ScriptState* scriptState = m_resolver->getScriptState();
+ ScriptState::Scope scope(scriptState);
+ m_resolver->reject(V8ThrowException::createTypeError(scriptState->isolate(), error.message));
+ break;
falken 2016/06/14 02:29:18 Why are these types the ones in the switch? This
e_hakkinen 2016/07/08 12:21:13 Done.
+ }
+ default:
m_resolver->reject(ServiceWorkerError::take(m_resolver.get(), error));
}
}
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/registration-tests.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698