From e313ec3dd91acefea0a41c35c97710e8c501a126 Mon Sep 17 00:00:00 2001 From: Sebastian Hengst Date: Tue, 12 Sep 2017 14:16:37 +0200 Subject: [PATCH] Backed out changeset 65146cc073d4 (bug 1359017) --- dom/webidl/DedicatedWorkerGlobalScope.webidl | 1 - dom/webidl/Worker.webidl | 1 - dom/workers/WorkerPrivate.cpp | 17 +---------------- dom/workers/WorkerPrivate.h | 1 - dom/workers/WorkerScope.h | 2 -- 5 files changed, 1 insertion(+), 21 deletions(-) diff --git a/dom/webidl/DedicatedWorkerGlobalScope.webidl b/dom/webidl/DedicatedWorkerGlobalScope.webidl index 57b48839f70d..761f2520039a 100644 --- a/dom/webidl/DedicatedWorkerGlobalScope.webidl +++ b/dom/webidl/DedicatedWorkerGlobalScope.webidl @@ -24,5 +24,4 @@ interface DedicatedWorkerGlobalScope : WorkerGlobalScope { void close(); attribute EventHandler onmessage; - attribute EventHandler onmessageerror; }; diff --git a/dom/webidl/Worker.webidl b/dom/webidl/Worker.webidl index e2044e434495..d10e40aa16c0 100644 --- a/dom/webidl/Worker.webidl +++ b/dom/webidl/Worker.webidl @@ -22,7 +22,6 @@ interface Worker : EventTarget { void postMessage(any message, optional sequence transfer = []); attribute EventHandler onmessage; - attribute EventHandler onmessageerror; }; Worker implements AbstractWorker; diff --git a/dom/workers/WorkerPrivate.cpp b/dom/workers/WorkerPrivate.cpp index d1d00d1a750a..80174cdbc549 100644 --- a/dom/workers/WorkerPrivate.cpp +++ b/dom/workers/WorkerPrivate.cpp @@ -755,7 +755,7 @@ public: } if (NS_WARN_IF(rv.Failed())) { - DispatchError(aTarget); + xpc::Throw(aCx, rv.StealNSResult()); return false; } @@ -814,21 +814,6 @@ private: return DispatchDOMEvent(aCx, aWorkerPrivate, aWorkerPrivate->GlobalScope(), false); } - - void - DispatchError(DOMEventTargetHelper* aTarget) - { - MessageEventInit init; - init.mBubbles = false; - init.mCancelable = false; - - RefPtr event = - MessageEvent::Constructor(aTarget, NS_LITERAL_STRING("messageerror"), init); - event->SetTrusted(true); - - bool dummy; - aTarget->DispatchEvent(event, &dummy); - } }; class DebuggerMessageEventRunnable : public WorkerDebuggerRunnable { diff --git a/dom/workers/WorkerPrivate.h b/dom/workers/WorkerPrivate.h index e0e1bff68c6b..ebc001654891 100644 --- a/dom/workers/WorkerPrivate.h +++ b/dom/workers/WorkerPrivate.h @@ -882,7 +882,6 @@ public: FlushReportsToSharedWorkers(nsIConsoleReportCollector* aReporter); IMPL_EVENT_HANDLER(message) - IMPL_EVENT_HANDLER(messageerror) IMPL_EVENT_HANDLER(error) // Check whether this worker is a secure context. For use from the parent diff --git a/dom/workers/WorkerScope.h b/dom/workers/WorkerScope.h index a00b3c2f5e6a..7900359966fb 100644 --- a/dom/workers/WorkerScope.h +++ b/dom/workers/WorkerScope.h @@ -251,7 +251,6 @@ public: Close(JSContext* aCx); IMPL_EVENT_HANDLER(message) - IMPL_EVENT_HANDLER(messageerror) }; class SharedWorkerGlobalScope final : public WorkerGlobalScope @@ -397,7 +396,6 @@ public: PostMessage(const nsAString& aMessage); IMPL_EVENT_HANDLER(message) - IMPL_EVENT_HANDLER(messageerror) void SetImmediate(Function& aHandler, ErrorResult& aRv);