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

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

Issue 24739002: Enable sending MessagePorts to a different renderer (Blink side) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Code review (jochen) Created 7 years, 2 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/events/MessageEvent.h ('k') | Source/core/frame/DOMWindow.cpp » ('j') | 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 , m_lastEventId(lastEventId) 80 , m_lastEventId(lastEventId)
81 , m_source(source) 81 , m_source(source)
82 , m_ports(ports) 82 , m_ports(ports)
83 { 83 {
84 ScriptWrappable::init(this); 84 ScriptWrappable::init(this);
85 if (m_dataAsSerializedScriptValue) 85 if (m_dataAsSerializedScriptValue)
86 m_dataAsSerializedScriptValue->registerMemoryAllocatedWithCurrentScriptC ontext(); 86 m_dataAsSerializedScriptValue->registerMemoryAllocatedWithCurrentScriptC ontext();
87 ASSERT(isValidSource(m_source.get())); 87 ASSERT(isValidSource(m_source.get()));
88 } 88 }
89 89
90 MessageEvent::MessageEvent(PassRefPtr<SerializedScriptValue> data, const String& origin, const String& lastEventId, PassRefPtr<EventTarget> source, PassOwnPtr<M essagePortChannelArray> channels)
91 : Event(EventTypeNames::message, false, false)
92 , m_dataType(DataTypeSerializedScriptValue)
93 , m_dataAsSerializedScriptValue(data)
94 , m_origin(origin)
95 , m_lastEventId(lastEventId)
96 , m_source(source)
97 , m_channels(channels)
98 {
99 ScriptWrappable::init(this);
100 if (m_dataAsSerializedScriptValue)
101 m_dataAsSerializedScriptValue->registerMemoryAllocatedWithCurrentScriptC ontext();
102 ASSERT(isValidSource(m_source.get()));
103 }
104
90 MessageEvent::MessageEvent(const String& data, const String& origin) 105 MessageEvent::MessageEvent(const String& data, const String& origin)
91 : Event(EventTypeNames::message, false, false) 106 : Event(EventTypeNames::message, false, false)
92 , m_dataType(DataTypeString) 107 , m_dataType(DataTypeString)
93 , m_dataAsString(data) 108 , m_dataAsString(data)
94 , m_origin(origin) 109 , m_origin(origin)
95 { 110 {
96 ScriptWrappable::init(this); 111 ScriptWrappable::init(this);
97 } 112 }
98 113
99 MessageEvent::MessageEvent(PassRefPtr<Blob> data, const String& origin) 114 MessageEvent::MessageEvent(PassRefPtr<Blob> data, const String& origin)
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 163
149 if (m_dataAsSerializedScriptValue) 164 if (m_dataAsSerializedScriptValue)
150 m_dataAsSerializedScriptValue->registerMemoryAllocatedWithCurrentScriptC ontext(); 165 m_dataAsSerializedScriptValue->registerMemoryAllocatedWithCurrentScriptC ontext();
151 } 166 }
152 167
153 const AtomicString& MessageEvent::interfaceName() const 168 const AtomicString& MessageEvent::interfaceName() const
154 { 169 {
155 return EventNames::MessageEvent; 170 return EventNames::MessageEvent;
156 } 171 }
157 172
173 void MessageEvent::entangleMessagePorts(ExecutionContext* context)
174 {
175 m_ports = MessagePort::entanglePorts(*context, m_channels.release());
176 }
177
158 } // namespace WebCore 178 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/events/MessageEvent.h ('k') | Source/core/frame/DOMWindow.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698