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

Side by Side Diff: third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerWindowClientCallback.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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "config.h"
6 #include "modules/serviceworkers/ServiceWorkerWindowClientCallback.h"
7
8 #include "bindings/core/v8/ScriptPromiseResolver.h"
9 #include "core/dom/DOMException.h"
10 #include "modules/serviceworkers/ServiceWorkerError.h"
11 #include "modules/serviceworkers/ServiceWorkerWindowClient.h"
12
13 namespace blink {
14
15 void NavigateClientCallback::onSuccess(WebPassOwnPtr<WebServiceWorkerClientInfo> clientInfo)
16 {
17 if (!m_resolver->executionContext() || m_resolver->executionContext()->activ eDOMObjectsAreStopped())
18 return;
19 m_resolver->resolve(ServiceWorkerWindowClient::take(m_resolver.get(), client Info.release()));
20 }
21
22 void NavigateClientCallback::onError(const WebServiceWorkerError& error)
23 {
24 if (!m_resolver->executionContext() || m_resolver->executionContext()->activ eDOMObjectsAreStopped())
25 return;
26
27 if (error.errorType == WebServiceWorkerError::ErrorTypeNavigation) {
28 ScriptState::Scope scope(m_resolver->scriptState());
29 m_resolver->reject(V8ThrowException::createTypeError(m_resolver->scriptS tate()->isolate(), error.message));
30 return;
31 }
32
33 m_resolver->reject(ServiceWorkerError::take(m_resolver.get(), error));
34 }
35
36 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698