OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 } | 194 } |
195 | 195 |
196 void AudioBuffer::zero() | 196 void AudioBuffer::zero() |
197 { | 197 { |
198 for (unsigned i = 0; i < m_channels.size(); ++i) { | 198 for (unsigned i = 0; i < m_channels.size(); ++i) { |
199 if (getChannelData(i)) | 199 if (getChannelData(i)) |
200 getChannelData(i)->zeroRange(0, length()); | 200 getChannelData(i)->zeroRange(0, length()); |
201 } | 201 } |
202 } | 202 } |
203 | 203 |
204 v8::Handle<v8::Object> AudioBuffer::associateWithWrapper(const WrapperTypeInfo*
wrapperType, v8::Handle<v8::Object> wrapper, v8::Isolate* isolate) | 204 v8::Handle<v8::Object> AudioBuffer::associateWithWrapper(v8::Isolate* isolate, c
onst WrapperTypeInfo* wrapperType, v8::Handle<v8::Object> wrapper) |
205 { | 205 { |
206 ScriptWrappable::associateWithWrapper(wrapperType, wrapper, isolate); | 206 ScriptWrappable::associateWithWrapper(isolate, wrapperType, wrapper); |
207 | 207 |
208 if (!wrapper.IsEmpty()) { | 208 if (!wrapper.IsEmpty()) { |
209 // We only setDeallocationObservers on array buffers that are held by | 209 // We only setDeallocationObservers on array buffers that are held by |
210 // some object in the V8 heap, not in the ArrayBuffer constructor | 210 // some object in the V8 heap, not in the ArrayBuffer constructor |
211 // itself. This is because V8 GC only cares about memory it can free on | 211 // itself. This is because V8 GC only cares about memory it can free on |
212 // GC, and until the object is exposed to JavaScript, V8 GC doesn't | 212 // GC, and until the object is exposed to JavaScript, V8 GC doesn't |
213 // affect it. | 213 // affect it. |
214 for (unsigned i = 0, n = numberOfChannels(); i < n; ++i) { | 214 for (unsigned i = 0, n = numberOfChannels(); i < n; ++i) { |
215 getChannelData(i)->buffer()->setDeallocationObserver(DOMArrayBufferD
eallocationObserver::instance()); | 215 getChannelData(i)->buffer()->setDeallocationObserver(DOMArrayBufferD
eallocationObserver::instance()); |
216 } | 216 } |
217 } | 217 } |
218 return wrapper; | 218 return wrapper; |
219 } | 219 } |
220 | 220 |
221 } // namespace blink | 221 } // namespace blink |
222 | 222 |
223 #endif // ENABLE(WEB_AUDIO) | 223 #endif // ENABLE(WEB_AUDIO) |
OLD | NEW |