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

Unified Diff: Source/core/events/MessageEvent.cpp

Issue 85263002: Improve handling of dictionary conversions. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 1 month 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
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())

Powered by Google App Engine
This is Rietveld 408576698