Index: third_party/WebKit/Source/core/events/MessageEvent.cpp |
diff --git a/third_party/WebKit/Source/core/events/MessageEvent.cpp b/third_party/WebKit/Source/core/events/MessageEvent.cpp |
index 2be9e88218e66332a4859e41566290e8a8881add..ed0b6285e8391796d0351fdda73df83b1d6ec8cb 100644 |
--- a/third_party/WebKit/Source/core/events/MessageEvent.cpp |
+++ b/third_party/WebKit/Source/core/events/MessageEvent.cpp |
@@ -36,7 +36,8 @@ |
namespace blink { |
static inline bool isValidSource(EventTarget* source) { |
- return !source || source->toLocalDOMWindow() || source->toMessagePort(); |
+ return !source || source->toLocalDOMWindow() || source->toMessagePort() || |
+ source->toServiceWorker(); |
} |
MessageEvent::MessageEvent() : m_dataType(DataTypeScriptValue) {} |
@@ -155,7 +156,7 @@ void MessageEvent::initMessageEvent(const AtomicString& type, |
ScriptValue data, |
const String& origin, |
const String& lastEventId, |
- DOMWindow* source, |
+ EventTarget* source, |
MessagePortArray* ports) { |
if (isBeingDispatched()) |
return; |
@@ -177,7 +178,7 @@ void MessageEvent::initMessageEvent(const AtomicString& type, |
PassRefPtr<SerializedScriptValue> data, |
const String& origin, |
const String& lastEventId, |
- DOMWindow* source, |
+ EventTarget* source, |
MessagePortArray* ports) { |
if (isBeingDispatched()) |
return; |