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

Unified Diff: Source/modules/serviceworkers/WaitUntilObserver.cpp

Issue 641083002: Propagate error/exception information for rejected Promises in Service workers. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 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 | « Source/modules/serviceworkers/RespondWithObserver.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/serviceworkers/WaitUntilObserver.cpp
diff --git a/Source/modules/serviceworkers/WaitUntilObserver.cpp b/Source/modules/serviceworkers/WaitUntilObserver.cpp
index f3ca24703a470407c78dfe966aa11ff0dfef0776..42f6cc7adcd2d4b1ba66d29d555e06a868dce4e1 100644
--- a/Source/modules/serviceworkers/WaitUntilObserver.cpp
+++ b/Source/modules/serviceworkers/WaitUntilObserver.cpp
@@ -9,14 +9,22 @@
#include "bindings/core/v8/ScriptPromise.h"
#include "bindings/core/v8/ScriptValue.h"
#include "bindings/core/v8/V8Binding.h"
+#include "bindings/core/v8/V8ErrorEvent.h"
#include "core/dom/ExecutionContext.h"
+#include "core/events/ErrorEvent.h"
#include "platform/NotImplemented.h"
#include "public/platform/WebServiceWorkerEventResult.h"
#include "wtf/Assertions.h"
#include "wtf/RefCounted.h"
#include "wtf/RefPtr.h"
+#include "core/workers/WorkerGlobalScope.h"
+#include "core/workers/WorkerThread.h"
+#include "core/workers/WorkerReportingProxy.h"
+#include "core/dom/ExecutionContext.h"
#include <v8.h>
+#include "base/logging.h"
+
namespace blink {
class WaitUntilObserver::ThenFunction FINAL : public ScriptFunction {
@@ -95,8 +103,17 @@ WaitUntilObserver::WaitUntilObserver(ExecutionContext* context, EventType type,
void WaitUntilObserver::reportError(const ScriptValue& value)
{
- // FIXME: Propagate error message to the client for onerror handling.
- notImplemented();
+ VLOG(1) <<__FUNCTION__;
+ if(V8ErrorEvent::hasInstance(value.v8Value(), toIsolate(executionContext()))) {
+ ErrorEvent* errEvent = V8ErrorEvent::toImplWithTypeCheck(toIsolate(executionContext()), value.v8Value());
+ toWorkerGlobalScope(executionContext())->thread()->workerReportingProxy()
+ .reportException(errEvent->message(),
+ errEvent->lineno(),
+ errEvent->colno(),
+ errEvent->filename());
+ VLOG(1) << errEvent->message().ascii().data();
+ VLOG(1) << errEvent->filename().ascii().data()<< " : "<< errEvent->lineno() << " : " << errEvent->colno();
+ }
m_hasError = true;
}
« no previous file with comments | « Source/modules/serviceworkers/RespondWithObserver.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698