def _call_with_arguments(member, call_with_values=None): # Optional parameter so setter can override with [SetterCallWith] call_with_values = call_with_values or member.extended_attributes.get('CallWith') if not call_with_values: return [] return [_CALL_WITH_ARGUMENTS[value] for value in _CALL_WITH_VALUES if v8_utilities.extended_attribute_value_contains(call_with_values, value)]
def _call_with_arguments(call_with_values): if not call_with_values: return [] return [ _CALL_WITH_ARGUMENTS[value] for value in _CALL_WITH_VALUES if v8_utilities.extended_attribute_value_contains( call_with_values, value) ]
def dom_wrapper_conversion_type(): if ('CheckSecurity' in extended_attributes and extended_attribute_value_contains( extended_attributes['CheckSecurity'], 'ReturnValue')): return 'DOMWrapperAcrossContext' if is_static: return 'DOMWrapperStatic' if not script_wrappable: return 'DOMWrapperDefault' if for_main_world: return 'DOMWrapperForMainWorld' return 'DOMWrapperFast'
def generate_method(operation): if operation.idl_type != 'boolean': raise Exception("We don't yet support callbacks that return non-boolean values.") is_custom = 'Custom' in operation.extended_attributes if not is_custom: add_includes_for_operation(operation) extended_attributes = operation.extended_attributes call_with = extended_attributes.get('CallWith') contents = { 'call_with_this_handle': extended_attribute_value_contains(call_with, 'ThisValue'), 'custom': is_custom, 'name': operation.name, 'return_cpp_type': cpp_type(operation.idl_type, 'RefPtr'), } contents.update(generate_arguments_contents(operation.arguments, call_with_this_handle)) return contents
def method_context(operation): extended_attributes = operation.extended_attributes idl_type = operation.idl_type idl_type_str = str(idl_type) if idl_type_str not in ['boolean', 'void']: raise Exception('We only support callbacks that return boolean or void values.') add_includes_for_operation(operation) call_with = extended_attributes.get('CallWith') call_with_this_handle = v8_utilities.extended_attribute_value_contains(call_with, 'ThisValue') context = { 'call_with_this_handle': call_with_this_handle, 'cpp_type': idl_type.callback_cpp_type, 'idl_type': idl_type_str, 'name': operation.name, } context.update(arguments_context(operation.arguments, call_with_this_handle)) return context
def generate_method(operation): extended_attributes = operation.extended_attributes idl_type = operation.idl_type if idl_type not in ['boolean', 'void']: raise Exception('We only support callbacks that return boolean or void values.') is_custom = 'Custom' in extended_attributes if not is_custom: add_includes_for_operation(operation) call_with = extended_attributes.get('CallWith') call_with_this_handle = v8_utilities.extended_attribute_value_contains(call_with, 'ThisValue') contents = { 'call_with_this_handle': call_with_this_handle, 'custom': is_custom, 'name': operation.name, 'return_cpp_type': cpp_type(idl_type), 'return_idl_type': idl_type, } contents.update(generate_arguments_contents(operation.arguments, call_with_this_handle)) return contents
def method_context(operation): extended_attributes = operation.extended_attributes idl_type = operation.idl_type idl_type_str = str(idl_type) if idl_type_str not in ["boolean", "void"]: raise Exception("We only support callbacks that return boolean or void values.") is_custom = "Custom" in extended_attributes if not is_custom: add_includes_for_operation(operation) call_with = extended_attributes.get("CallWith") call_with_this_handle = v8_utilities.extended_attribute_value_contains(call_with, "ThisValue") context = { "call_with_this_handle": call_with_this_handle, "cpp_type": idl_type.callback_cpp_type, "idl_type": idl_type_str, "is_custom": is_custom, "name": operation.name, } context.update(arguments_context(operation.arguments, call_with_this_handle)) return context
def generate_method(operation): extended_attributes = operation.extended_attributes idl_type = operation.idl_type if idl_type not in ['boolean', 'void']: raise Exception( 'We only support callbacks that return boolean or void values.') is_custom = 'Custom' in extended_attributes if not is_custom: add_includes_for_operation(operation) call_with = extended_attributes.get('CallWith') call_with_this_handle = v8_utilities.extended_attribute_value_contains( call_with, 'ThisValue') contents = { 'call_with_this_handle': call_with_this_handle, 'custom': is_custom, 'name': operation.name, 'return_cpp_type': cpp_type(idl_type), 'return_idl_type': idl_type, } contents.update( generate_arguments_contents(operation.arguments, call_with_this_handle)) return contents
def generate_method(operation): if operation.idl_type != 'boolean': raise Exception( "We don't yet support callbacks that return non-boolean values.") is_custom = 'Custom' in operation.extended_attributes if not is_custom: add_includes_for_operation(operation) extended_attributes = operation.extended_attributes call_with = extended_attributes.get('CallWith') contents = { 'call_with_this_handle': extended_attribute_value_contains(call_with, 'ThisValue'), 'custom': is_custom, 'name': operation.name, 'return_cpp_type': cpp_type(operation.idl_type, 'RefPtr'), } contents.update( generate_arguments_contents(operation.arguments, call_with_this_handle)) return contents
def _call_with_arguments(call_with_values): if not call_with_values: return [] return [_CALL_WITH_ARGUMENTS[value] for value in _CALL_WITH_VALUES if v8_utilities.extended_attribute_value_contains(call_with_values, value)]