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

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

Issue 1964183004: Revert of Move DOMArrayBuffer, DOMArrayBufferViews and DataView to the heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
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(DOMArrayBuffer* data, const String& origin, const Str ing& suborigin) 120 MessageEvent::MessageEvent(PassRefPtr<DOMArrayBuffer> data, const String& origin , const String& 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);
210 visitor->trace(m_source); 209 visitor->trace(m_source);
211 visitor->trace(m_ports); 210 visitor->trace(m_ports);
212 Event::trace(visitor); 211 Event::trace(visitor);
213 } 212 }
214 213
215 v8::Local<v8::Object> MessageEvent::associateWithWrapper(v8::Isolate* isolate, c onst WrapperTypeInfo* wrapperType, v8::Local<v8::Object> wrapper) 214 v8::Local<v8::Object> MessageEvent::associateWithWrapper(v8::Isolate* isolate, c onst WrapperTypeInfo* wrapperType, v8::Local<v8::Object> wrapper)
216 { 215 {
217 wrapper = Event::associateWithWrapper(isolate, wrapperType, wrapper); 216 wrapper = Event::associateWithWrapper(isolate, wrapperType, wrapper);
218 217
219 // Ensures a wrapper is created for the data to return now so that V8 knows how 218 // Ensures a wrapper is created for the data to return now so that V8 knows how
(...skipping 10 matching lines...) Expand all
230 break; 229 break;
231 case MessageEvent::DataTypeArrayBuffer: 230 case MessageEvent::DataTypeArrayBuffer:
232 V8HiddenValue::setHiddenValue(ScriptState::current(isolate), wrapper, V8 HiddenValue::arrayBufferData(isolate), toV8(dataAsArrayBuffer(), wrapper, isolat e)); 231 V8HiddenValue::setHiddenValue(ScriptState::current(isolate), wrapper, V8 HiddenValue::arrayBufferData(isolate), toV8(dataAsArrayBuffer(), wrapper, isolat e));
233 break; 232 break;
234 } 233 }
235 234
236 return wrapper; 235 return wrapper;
237 } 236 }
238 237
239 } // namespace blink 238 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/events/MessageEvent.h ('k') | third_party/WebKit/Source/core/fileapi/Blob.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698