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

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

Issue 13844022: Remove code to support Objective-C bindings (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 7 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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 m_dataAsSerializedScriptValue = data; 141 m_dataAsSerializedScriptValue = data;
142 m_origin = origin; 142 m_origin = origin;
143 m_lastEventId = lastEventId; 143 m_lastEventId = lastEventId;
144 m_source = source; 144 m_source = source;
145 m_ports = ports; 145 m_ports = ports;
146 146
147 if (m_dataAsSerializedScriptValue) 147 if (m_dataAsSerializedScriptValue)
148 m_dataAsSerializedScriptValue->registerMemoryAllocatedWithCurrentScriptC ontext(); 148 m_dataAsSerializedScriptValue->registerMemoryAllocatedWithCurrentScriptC ontext();
149 } 149 }
150 150
151 // FIXME: Remove this when we have custom ObjC binding support.
152 SerializedScriptValue* MessageEvent::data() const
153 {
154 // WebSocket is not exposed in ObjC bindings, thus the data type should alwa ys be SerializedScriptValue.
155 ASSERT(m_dataType == DataTypeSerializedScriptValue);
156 return m_dataAsSerializedScriptValue.get();
157 }
158
159 MessagePort* MessageEvent::messagePort()
160 {
161 if (!m_ports)
162 return 0;
163 ASSERT(m_ports->size() == 1);
164 return (*m_ports)[0].get();
165 }
166
167 void MessageEvent::initMessageEvent(const AtomicString& type, bool canBubble, bo ol cancelable, PassRefPtr<SerializedScriptValue> data, const String& origin, con st String& lastEventId, DOMWindow* source, MessagePort* port)
168 {
169 OwnPtr<MessagePortArray> ports;
170 if (port) {
171 ports = adoptPtr(new MessagePortArray);
172 ports->append(port);
173 }
174 initMessageEvent(type, canBubble, cancelable, data, origin, lastEventId, sou rce, ports.release());
175 }
176
177 const AtomicString& MessageEvent::interfaceName() const 151 const AtomicString& MessageEvent::interfaceName() const
178 { 152 {
179 return eventNames().interfaceForMessageEvent; 153 return eventNames().interfaceForMessageEvent;
180 } 154 }
181 155
182 } // namespace WebCore 156 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698