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

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

Issue 22915005: MessageEvent constructor should accept a MessagePort as source (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
« no previous file with comments | « Source/core/dom/MessageEvent.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 : m_dataType(DataTypeScriptValue) 46 : m_dataType(DataTypeScriptValue)
47 { 47 {
48 ScriptWrappable::init(this); 48 ScriptWrappable::init(this);
49 } 49 }
50 50
51 MessageEvent::MessageEvent(const AtomicString& type, const MessageEventInit& ini tializer) 51 MessageEvent::MessageEvent(const AtomicString& type, const MessageEventInit& ini tializer)
52 : Event(type, initializer) 52 : Event(type, initializer)
53 , m_dataType(DataTypeScriptValue) 53 , m_dataType(DataTypeScriptValue)
54 , m_origin(initializer.origin) 54 , m_origin(initializer.origin)
55 , m_lastEventId(initializer.lastEventId) 55 , m_lastEventId(initializer.lastEventId)
56 , m_source(initializer.source) 56 , m_source(isValidSource(initializer.source.get()) ? initializer.source : 0)
57 , m_ports(adoptPtr(new MessagePortArray(initializer.ports))) 57 , m_ports(adoptPtr(new MessagePortArray(initializer.ports)))
58 { 58 {
59 ScriptWrappable::init(this); 59 ScriptWrappable::init(this);
60 ASSERT(isValidSource(m_source.get())); 60 ASSERT(isValidSource(m_source.get()));
61 } 61 }
62 62
63 MessageEvent::MessageEvent(const String& origin, const String& lastEventId, Pass RefPtr<EventTarget> source, PassOwnPtr<MessagePortArray> ports) 63 MessageEvent::MessageEvent(const String& origin, const String& lastEventId, Pass RefPtr<EventTarget> source, PassOwnPtr<MessagePortArray> ports)
64 : Event(eventNames().messageEvent, false, false) 64 : Event(eventNames().messageEvent, false, false)
65 , m_dataType(DataTypeScriptValue) 65 , m_dataType(DataTypeScriptValue)
66 , m_origin(origin) 66 , m_origin(origin)
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 if (m_dataAsSerializedScriptValue) 152 if (m_dataAsSerializedScriptValue)
153 m_dataAsSerializedScriptValue->registerMemoryAllocatedWithCurrentScriptC ontext(); 153 m_dataAsSerializedScriptValue->registerMemoryAllocatedWithCurrentScriptC ontext();
154 } 154 }
155 155
156 const AtomicString& MessageEvent::interfaceName() const 156 const AtomicString& MessageEvent::interfaceName() const
157 { 157 {
158 return eventNames().interfaceForMessageEvent; 158 return eventNames().interfaceForMessageEvent;
159 } 159 }
160 160
161 } // namespace WebCore 161 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/MessageEvent.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698