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

Unified Diff: Source/core/dom/MessageEvent.h

Issue 23319002: Set MessageEvent.source to the newly created port for shared workers' connect events (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add test and assertions Created 7 years, 4 months 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/dom/MessageEvent.h
diff --git a/Source/core/dom/MessageEvent.h b/Source/core/dom/MessageEvent.h
index 7f54232288715596bde0a5bc36702584c84b1b9b..abb159b89f8c1041aab4ddc8d4df691cd36e83cb 100644
--- a/Source/core/dom/MessageEvent.h
+++ b/Source/core/dom/MessageEvent.h
@@ -30,6 +30,7 @@
#include "bindings/v8/SerializedScriptValue.h"
#include "core/dom/Event.h"
+#include "core/dom/EventTarget.h"
#include "core/dom/MessagePort.h"
#include "core/fileapi/Blob.h"
#include "core/page/DOMWindow.h"
@@ -37,8 +38,6 @@
namespace WebCore {
-class DOMWindow;
-
struct MessageEventInit : public EventInit {
MessageEventInit();
@@ -54,11 +53,11 @@ public:
{
return adoptRef(new MessageEvent);
}
- static PassRefPtr<MessageEvent> create(PassOwnPtr<MessagePortArray> ports, const String& origin = "", const String& lastEventId = "", PassRefPtr<DOMWindow> source = 0)
+ static PassRefPtr<MessageEvent> create(PassOwnPtr<MessagePortArray> ports, const String& origin = "", const String& lastEventId = "", PassRefPtr<EventTarget> source = 0)
{
return adoptRef(new MessageEvent(origin, lastEventId, source, ports));
}
- static PassRefPtr<MessageEvent> create(PassOwnPtr<MessagePortArray> ports, PassRefPtr<SerializedScriptValue> data, const String& origin = "", const String& lastEventId = "", PassRefPtr<DOMWindow> source = 0)
+ static PassRefPtr<MessageEvent> create(PassOwnPtr<MessagePortArray> ports, PassRefPtr<SerializedScriptValue> data, const String& origin = "", const String& lastEventId = "", PassRefPtr<EventTarget> source = 0)
{
return adoptRef(new MessageEvent(data, origin, lastEventId, source, ports));
}
@@ -85,7 +84,7 @@ public:
const String& origin() const { return m_origin; }
const String& lastEventId() const { return m_lastEventId; }
- DOMWindow* source() const { return m_source.get(); }
+ EventTarget* source() const { return m_source.get(); }
MessagePortArray ports() const { return m_ports ? *m_ports : MessagePortArray(); }
virtual const AtomicString& interfaceName() const;
@@ -112,8 +111,8 @@ public:
private:
MessageEvent();
MessageEvent(const AtomicString&, const MessageEventInit&);
- MessageEvent(const String& origin, const String& lastEventId, PassRefPtr<DOMWindow> source, PassOwnPtr<MessagePortArray>);
- MessageEvent(PassRefPtr<SerializedScriptValue> data, const String& origin, const String& lastEventId, PassRefPtr<DOMWindow> source, PassOwnPtr<MessagePortArray>);
+ MessageEvent(const String& origin, const String& lastEventId, PassRefPtr<EventTarget> source, PassOwnPtr<MessagePortArray>);
+ MessageEvent(PassRefPtr<SerializedScriptValue> data, const String& origin, const String& lastEventId, PassRefPtr<EventTarget> source, PassOwnPtr<MessagePortArray>);
explicit MessageEvent(const String& data, const String& origin);
explicit MessageEvent(PassRefPtr<Blob> data, const String& origin);
@@ -126,7 +125,7 @@ private:
RefPtr<ArrayBuffer> m_dataAsArrayBuffer;
String m_origin;
String m_lastEventId;
- RefPtr<DOMWindow> m_source;
+ RefPtr<EventTarget> m_source;
OwnPtr<MessagePortArray> m_ports;
};

Powered by Google App Engine
This is Rietveld 408576698