Chromium Code Reviews| Index: Source/core/events/MessageEvent.cpp |
| diff --git a/Source/core/events/MessageEvent.cpp b/Source/core/events/MessageEvent.cpp |
| index 651cec4e62fb6d0b2bc23ca05f7f553470d28148..6b40623731b5258ae8bd36da9f747300cda727f2 100644 |
| --- a/Source/core/events/MessageEvent.cpp |
| +++ b/Source/core/events/MessageEvent.cpp |
| @@ -28,6 +28,7 @@ |
| #include "config.h" |
| #include "core/events/MessageEvent.h" |
| +#include "bindings/v8/ExceptionMessages.h" |
| #include "core/events/ThreadLocalEventNames.h" |
| #include "core/frame/DOMWindow.h" |
| @@ -133,6 +134,15 @@ MessageEvent::~MessageEvent() |
| { |
| } |
| +PassRefPtr<MessageEvent> MessageEvent::create(const AtomicString& type, const MessageEventInit& initializer, ExceptionState& exceptionState) |
| +{ |
| + if (initializer.source.get() && !isValidSource(initializer.source.get())) { |
| + exceptionState.throwTypeError(ExceptionMessages::failedToConstruct("MessageEvent", "The optional 'source' property is not a Window nor MessagePort.")); |
|
Mike West
2013/11/25 08:22:48
Nit: "neither ... nor"
sof
2013/11/25 23:24:05
Done.
|
| + return 0; |
| + } |
| + return adoptRef(new MessageEvent(type, initializer)); |
| +} |
| + |
| void MessageEvent::initMessageEvent(const AtomicString& type, bool canBubble, bool cancelable, const String& origin, const String& lastEventId, DOMWindow* source, PassOwnPtr<MessagePortArray> ports) |
| { |
| if (dispatched()) |