Commit a0d741fc authored by nbarth@chromium.org's avatar nbarth@chromium.org

IDL compiler: AudioBuffer interfaces

BUG=239771
R=haraken
NOTRY=true

Review URL: https://codereview.chromium.org/131183002

git-svn-id: svn://svn.chromium.org/blink/trunk@165107 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 6e112842
...@@ -70,6 +70,10 @@ def generate_interface(interface): ...@@ -70,6 +70,10 @@ def generate_interface(interface):
header_includes.update(v8_types.includes_for_type(parent_interface)) header_includes.update(v8_types.includes_for_type(parent_interface))
extended_attributes = interface.extended_attributes extended_attributes = interface.extended_attributes
is_audio_buffer = inherits_interface(interface.name, 'AudioBuffer')
if is_audio_buffer:
includes.add('modules/webaudio/AudioBuffer.h')
is_document = inherits_interface(interface.name, 'Document') is_document = inherits_interface(interface.name, 'Document')
if is_document: if is_document:
includes.update(['bindings/v8/ScriptController.h', includes.update(['bindings/v8/ScriptController.h',
...@@ -159,6 +163,7 @@ def generate_interface(interface): ...@@ -159,6 +163,7 @@ def generate_interface(interface):
interface_length(interface, constructors + custom_constructors), interface_length(interface, constructors + custom_constructors),
'interface_name': interface.name, 'interface_name': interface.name,
'is_active_dom_object': 'ActiveDOMObject' in extended_attributes, # [ActiveDOMObject] 'is_active_dom_object': 'ActiveDOMObject' in extended_attributes, # [ActiveDOMObject]
'is_audio_buffer': is_audio_buffer,
'is_check_security': is_check_security, 'is_check_security': is_check_security,
'is_constructor_call_with_document': has_extended_attribute_value( 'is_constructor_call_with_document': has_extended_attribute_value(
interface, 'ConstructorCallWith', 'Document'), # [ConstructorCallWith=Document] interface, 'ConstructorCallWith', 'Document'), # [ConstructorCallWith=Document]
......
...@@ -728,6 +728,16 @@ v8::Handle<v8::Object> {{v8_class}}::createWrapper(PassRefPtr<{{cpp_class}}> imp ...@@ -728,6 +728,16 @@ v8::Handle<v8::Object> {{v8_class}}::createWrapper(PassRefPtr<{{cpp_class}}> imp
if (UNLIKELY(wrapper.IsEmpty())) if (UNLIKELY(wrapper.IsEmpty()))
return wrapper; return wrapper;
{% if is_audio_buffer %}
{# We only setDeallocationObservers on array buffers that are held by some
object in the V8 heap, not in the ArrayBuffer constructor itself.
This is because V8 GC only cares about memory it can free on GC, and
until the object is exposed to JavaScript, V8 GC doesn't affect it. #}
for (unsigned i = 0, n = impl->numberOfChannels(); i < n; i++) {
Float32Array* channelData = impl->getChannelData(i);
channelData->buffer()->setDeallocationObserver(V8ArrayBufferDeallocationObserver::instanceTemplate());
}
{% endif %}
installPerContextEnabledProperties(wrapper, impl.get(), isolate); installPerContextEnabledProperties(wrapper, impl.get(), isolate);
{% set wrapper_configuration = 'WrapperConfiguration::Dependent' {% set wrapper_configuration = 'WrapperConfiguration::Dependent'
if (has_visit_dom_wrapper or if (has_visit_dom_wrapper or
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment