Index: Source/modules/serviceworkers/ServiceWorkerContainer.cpp |
diff --git a/Source/modules/serviceworkers/ServiceWorkerContainer.cpp b/Source/modules/serviceworkers/ServiceWorkerContainer.cpp |
index 7218343c7d6762070601ac46fb0ede71750f2fc7..ba7e343f99203cbc8b40581266e91c9e7209f2b7 100644 |
--- a/Source/modules/serviceworkers/ServiceWorkerContainer.cpp |
+++ b/Source/modules/serviceworkers/ServiceWorkerContainer.cpp |
@@ -40,12 +40,12 @@ |
#include "core/dom/ExceptionCode.h" |
#include "core/dom/ExecutionContext.h" |
#include "core/dom/MessagePort.h" |
-#include "core/events/MessageEvent.h" |
#include "core/frame/LocalDOMWindow.h" |
#include "modules/EventTargetModules.h" |
#include "modules/serviceworkers/ServiceWorker.h" |
#include "modules/serviceworkers/ServiceWorkerContainerClient.h" |
#include "modules/serviceworkers/ServiceWorkerError.h" |
+#include "modules/serviceworkers/ServiceWorkerMessageEvent.h" |
#include "modules/serviceworkers/ServiceWorkerRegistration.h" |
#include "platform/RuntimeEnabledFeatures.h" |
#include "public/platform/WebServiceWorker.h" |
@@ -372,14 +372,15 @@ void ServiceWorkerContainer::setController(WebServiceWorker* serviceWorker, bool |
dispatchEvent(Event::create(EventTypeNames::controllerchange)); |
} |
-void ServiceWorkerContainer::dispatchMessageEvent(const WebString& message, const WebMessagePortChannelArray& webChannels) |
+void ServiceWorkerContainer::dispatchMessageEvent(WebServiceWorker* serviceWorker, const WebString& message, const WebMessagePortChannelArray& webChannels) |
{ |
if (!executionContext() || !executionContext()->executingWindow()) |
return; |
OwnPtrWillBeRawPtr<MessagePortArray> ports = MessagePort::toMessagePortArray(executionContext(), webChannels); |
RefPtr<SerializedScriptValue> value = SerializedScriptValueFactory::instance().createFromWire(message); |
- executionContext()->executingWindow()->dispatchEvent(MessageEvent::create(ports.release(), value)); |
+ RefPtrWillBeRawPtr<ServiceWorker> source = ServiceWorker::from(executionContext(), serviceWorker); |
+ dispatchEvent(ServiceWorkerMessageEvent::create(ports.release(), value, source)); |
} |
const AtomicString& ServiceWorkerContainer::interfaceName() const |