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

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

Issue 1878463002: Move DOMArrayBuffer, DOMArrayBufferViews and DataView to the heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tidy Created 4 years, 8 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
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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 } 110 }
111 111
112 MessageEvent::MessageEvent(Blob* data, const String& origin, const String& subor igin) 112 MessageEvent::MessageEvent(Blob* data, const String& origin, const String& subor igin)
113 : Event(EventTypeNames::message, false, false) 113 : Event(EventTypeNames::message, false, false)
114 , m_dataType(DataTypeBlob) 114 , m_dataType(DataTypeBlob)
115 , m_dataAsBlob(data) 115 , m_dataAsBlob(data)
116 , m_origin(origin) 116 , m_origin(origin)
117 { 117 {
118 } 118 }
119 119
120 MessageEvent::MessageEvent(PassRefPtr<DOMArrayBuffer> data, const String& origin , const String& suborigin) 120 MessageEvent::MessageEvent(DOMArrayBuffer* data, const String& origin, const Str ing& suborigin)
121 : Event(EventTypeNames::message, false, false) 121 : Event(EventTypeNames::message, false, false)
122 , m_dataType(DataTypeArrayBuffer) 122 , m_dataType(DataTypeArrayBuffer)
123 , m_dataAsArrayBuffer(data) 123 , m_dataAsArrayBuffer(data)
124 , m_origin(origin) 124 , m_origin(origin)
125 { 125 {
126 } 126 }
127 127
128 MessageEvent::~MessageEvent() 128 MessageEvent::~MessageEvent()
129 { 129 {
130 } 130 }
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 } 199 }
200 200
201 void MessageEvent::entangleMessagePorts(ExecutionContext* context) 201 void MessageEvent::entangleMessagePorts(ExecutionContext* context)
202 { 202 {
203 m_ports = MessagePort::entanglePorts(*context, m_channels.release()); 203 m_ports = MessagePort::entanglePorts(*context, m_channels.release());
204 } 204 }
205 205
206 DEFINE_TRACE(MessageEvent) 206 DEFINE_TRACE(MessageEvent)
207 { 207 {
208 visitor->trace(m_dataAsBlob); 208 visitor->trace(m_dataAsBlob);
209 visitor->trace(m_dataAsArrayBuffer);
209 visitor->trace(m_source); 210 visitor->trace(m_source);
210 visitor->trace(m_ports); 211 visitor->trace(m_ports);
211 Event::trace(visitor); 212 Event::trace(visitor);
212 } 213 }
213 214
214 v8::Local<v8::Object> MessageEvent::associateWithWrapper(v8::Isolate* isolate, c onst WrapperTypeInfo* wrapperType, v8::Local<v8::Object> wrapper) 215 v8::Local<v8::Object> MessageEvent::associateWithWrapper(v8::Isolate* isolate, c onst WrapperTypeInfo* wrapperType, v8::Local<v8::Object> wrapper)
215 { 216 {
216 wrapper = Event::associateWithWrapper(isolate, wrapperType, wrapper); 217 wrapper = Event::associateWithWrapper(isolate, wrapperType, wrapper);
217 218
218 // Ensures a wrapper is created for the data to return now so that V8 knows how 219 // Ensures a wrapper is created for the data to return now so that V8 knows how
(...skipping 10 matching lines...) Expand all
229 break; 230 break;
230 case MessageEvent::DataTypeArrayBuffer: 231 case MessageEvent::DataTypeArrayBuffer:
231 V8HiddenValue::setHiddenValue(ScriptState::current(isolate), wrapper, V8 HiddenValue::arrayBufferData(isolate), toV8(dataAsArrayBuffer(), wrapper, isolat e)); 232 V8HiddenValue::setHiddenValue(ScriptState::current(isolate), wrapper, V8 HiddenValue::arrayBufferData(isolate), toV8(dataAsArrayBuffer(), wrapper, isolat e));
232 break; 233 break;
233 } 234 }
234 235
235 return wrapper; 236 return wrapper;
236 } 237 }
237 238
238 } // namespace blink 239 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698