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

Side by Side Diff: Source/core/dom/MessageEvent.cpp

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: 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007 Henry Mason (hmason@mac.com) 2 * Copyright (C) 2007 Henry Mason (hmason@mac.com)
3 * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 3 * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 : Event(type, initializer) 47 : Event(type, initializer)
48 , m_dataType(DataTypeScriptValue) 48 , m_dataType(DataTypeScriptValue)
49 , m_origin(initializer.origin) 49 , m_origin(initializer.origin)
50 , m_lastEventId(initializer.lastEventId) 50 , m_lastEventId(initializer.lastEventId)
51 , m_source(initializer.source) 51 , m_source(initializer.source)
52 , m_ports(adoptPtr(new MessagePortArray(initializer.ports))) 52 , m_ports(adoptPtr(new MessagePortArray(initializer.ports)))
53 { 53 {
54 ScriptWrappable::init(this); 54 ScriptWrappable::init(this);
55 } 55 }
56 56
57 MessageEvent::MessageEvent(const String& origin, const String& lastEventId, Pass RefPtr<DOMWindow> source, PassOwnPtr<MessagePortArray> ports) 57 MessageEvent::MessageEvent(const String& origin, const String& lastEventId, Pass RefPtr<EventTarget> source, PassOwnPtr<MessagePortArray> ports)
58 : Event(eventNames().messageEvent, false, false) 58 : Event(eventNames().messageEvent, false, false)
59 , m_dataType(DataTypeScriptValue) 59 , m_dataType(DataTypeScriptValue)
60 , m_origin(origin) 60 , m_origin(origin)
61 , m_lastEventId(lastEventId) 61 , m_lastEventId(lastEventId)
62 , m_source(source) 62 , m_source(source)
63 , m_ports(ports) 63 , m_ports(ports)
64 { 64 {
65 ScriptWrappable::init(this); 65 ScriptWrappable::init(this);
66 } 66 }
abarth-chromium 2013/08/19 19:24:58 For example, the ASSERT could go here (and in othe
67 67
68 MessageEvent::MessageEvent(PassRefPtr<SerializedScriptValue> data, const String& origin, const String& lastEventId, PassRefPtr<DOMWindow> source, PassOwnPtr<Mes sagePortArray> ports) 68 MessageEvent::MessageEvent(PassRefPtr<SerializedScriptValue> data, const String& origin, const String& lastEventId, PassRefPtr<EventTarget> source, PassOwnPtr<M essagePortArray> ports)
69 : Event(eventNames().messageEvent, false, false) 69 : Event(eventNames().messageEvent, false, false)
70 , m_dataType(DataTypeSerializedScriptValue) 70 , m_dataType(DataTypeSerializedScriptValue)
71 , m_dataAsSerializedScriptValue(data) 71 , m_dataAsSerializedScriptValue(data)
72 , m_origin(origin) 72 , m_origin(origin)
73 , m_lastEventId(lastEventId) 73 , m_lastEventId(lastEventId)
74 , m_source(source) 74 , m_source(source)
75 , m_ports(ports) 75 , m_ports(ports)
76 { 76 {
77 ScriptWrappable::init(this); 77 ScriptWrappable::init(this);
78 if (m_dataAsSerializedScriptValue) 78 if (m_dataAsSerializedScriptValue)
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 if (m_dataAsSerializedScriptValue) 144 if (m_dataAsSerializedScriptValue)
145 m_dataAsSerializedScriptValue->registerMemoryAllocatedWithCurrentScriptC ontext(); 145 m_dataAsSerializedScriptValue->registerMemoryAllocatedWithCurrentScriptC ontext();
146 } 146 }
147 147
148 const AtomicString& MessageEvent::interfaceName() const 148 const AtomicString& MessageEvent::interfaceName() const
149 { 149 {
150 return eventNames().interfaceForMessageEvent; 150 return eventNames().interfaceForMessageEvent;
151 } 151 }
152 152
153 } // namespace WebCore 153 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698