• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python v8_utilities.scoped_name函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中v8_utilities.scoped_name函数的典型用法代码示例。如果您正苦于以下问题:Python scoped_name函数的具体用法?Python scoped_name怎么用?Python scoped_name使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了scoped_name函数的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: setter_expression

def setter_expression(interface, attribute, contents):
    extended_attributes = attribute.extended_attributes
    arguments = v8_utilities.call_with_arguments(attribute, extended_attributes.get('SetterCallWith'))

    this_setter_base_name = setter_base_name(attribute, arguments)
    setter_name = v8_utilities.scoped_name(interface, attribute, this_setter_base_name)

    if ('ImplementedBy' in extended_attributes and
        not attribute.is_static):
        arguments.append('imp')
    idl_type = attribute.idl_type
    if idl_type == 'EventHandler':
        getter_name = v8_utilities.scoped_name(interface, attribute, cpp_name(attribute))
        contents['event_handler_getter_expression'] = '%s(%s)' % (
            getter_name, ', '.join(arguments))
        if (interface.name in ['Window', 'WorkerGlobalScope'] and
            attribute.name == 'onerror'):
            includes.add('bindings/v8/V8ErrorHandler.h')
            arguments.append('V8EventListenerList::findOrCreateWrapper<V8ErrorHandler>(jsValue, true, info.GetIsolate())')
        else:
            arguments.append('V8EventListenerList::getEventListener(jsValue, true, ListenerFindOrCreate)')
    elif v8_types.is_interface_type(idl_type) and not v8_types.array_type(idl_type):
        # FIXME: should be able to eliminate WTF::getPtr in most or all cases
        arguments.append('WTF::getPtr(cppValue)')
    else:
        arguments.append('cppValue')
    if contents['is_setter_raises_exception']:
        arguments.append('exceptionState')

    return '%s(%s)' % (setter_name, ', '.join(arguments))
开发者ID:glenkim-dev,项目名称:blink-crosswalk,代码行数:30,代码来源:v8_attributes.py


示例2: setter_expression

def setter_expression(interface, attribute, contents):
    extended_attributes = attribute.extended_attributes
    arguments = v8_utilities.call_with_arguments(attribute, extended_attributes.get('SetterCallWith'))

    this_setter_base_name = setter_base_name(interface, attribute, arguments)
    setter_name = scoped_name(interface, attribute, this_setter_base_name)

    # Members of IDL partial interface definitions are implemented in C++ as
    # static member functions, which for instance members (non-static members)
    # take *impl as their first argument
    if ('PartialInterfaceImplementedAs' in extended_attributes and
        not attribute.is_static):
        arguments.append('*impl')
    idl_type = attribute.idl_type
    if idl_type.base_type == 'EventHandler':
        getter_name = scoped_name(interface, attribute, cpp_name(attribute))
        contents['event_handler_getter_expression'] = '%s(%s)' % (
            getter_name, ', '.join(arguments))
        if (interface.name in ['Window', 'WorkerGlobalScope'] and
            attribute.name == 'onerror'):
            includes.add('bindings/v8/V8ErrorHandler.h')
            arguments.append('V8EventListenerList::findOrCreateWrapper<V8ErrorHandler>(v8Value, true, info.GetIsolate())')
        else:
            arguments.append('V8EventListenerList::getEventListener(v8Value, true, ListenerFindOrCreate)')
    elif idl_type.is_interface_type and not idl_type.array_type:
        # FIXME: should be able to eliminate WTF::getPtr in most or all cases
        arguments.append('WTF::getPtr(cppValue)')
    else:
        arguments.append('cppValue')
    if contents['is_setter_raises_exception']:
        arguments.append('exceptionState')

    return '%s(%s)' % (setter_name, ', '.join(arguments))
开发者ID:TheTypoMaster,项目名称:evita,代码行数:33,代码来源:v8_attributes.py


示例3: cpp_value

def cpp_value(interface, method, number_of_arguments):
    def cpp_argument(argument):
        idl_type = argument.idl_type
        if (v8_types.is_callback_interface(idl_type) or
            idl_type in ['NodeFilter', 'XPathNSResolver']):
            # FIXME: remove this special case
            return '%s.release()' % argument.name
        return argument.name

    # Truncate omitted optional arguments
    arguments = method.arguments[:number_of_arguments]
    cpp_arguments = v8_utilities.call_with_arguments(method)
    if ('ImplementedBy' in method.extended_attributes and
        not method.is_static):
        cpp_arguments.append('imp')
    cpp_arguments.extend(cpp_argument(argument) for argument in arguments)
    this_union_arguments = union_arguments(method.idl_type)
    if this_union_arguments:
        cpp_arguments.extend(this_union_arguments)

    if 'RaisesException' in method.extended_attributes:
        cpp_arguments.append('exceptionState')

    cpp_method_name = v8_utilities.scoped_name(interface, method, v8_utilities.cpp_name(method))
    return '%s(%s)' % (cpp_method_name, ', '.join(cpp_arguments))
开发者ID:wangshijun,项目名称:Blink,代码行数:25,代码来源:v8_methods.py


示例4: getter_expression

def getter_expression(interface, attribute, context):
    arguments = []
    this_getter_base_name = getter_base_name(interface, attribute, arguments)
    getter_name = scoped_name(interface, attribute, this_getter_base_name)

    if "ImplementedInPrivateScript" in attribute.extended_attributes:
        arguments.append("toLocalFrame(toFrameIfNotDetached(info.GetIsolate()->GetCurrentContext()))")
        arguments.append("impl")
        arguments.append("&result")
    arguments.extend(v8_utilities.call_with_arguments(attribute.extended_attributes.get("CallWith")))
    # Members of IDL partial interface definitions are implemented in C++ as
    # static member functions, which for instance members (non-static members)
    # take *impl as their first argument
    if (
        "PartialInterfaceImplementedAs" in attribute.extended_attributes
        and not "ImplementedInPrivateScript" in attribute.extended_attributes
        and not attribute.is_static
    ):
        arguments.append("*impl")
    if attribute.idl_type.is_explicit_nullable:
        arguments.append("isNull")
    if context["is_getter_raises_exception"]:
        arguments.append("exceptionState")
    if attribute.idl_type.use_output_parameter_for_result:
        arguments.append("result")
    return "%s(%s)" % (getter_name, ", ".join(arguments))
开发者ID:howardroark2018,项目名称:chromium,代码行数:26,代码来源:v8_attributes.py


示例5: cpp_value

def cpp_value(interface, method, number_of_arguments):
    def cpp_argument(argument):
        idl_type = argument.idl_type
        if idl_type.name == "EventListener":
            return argument.name
        if idl_type.is_dictionary:
            return "*%s" % argument.name
        if idl_type.name in ["NodeFilter", "NodeFilterOrNull", "XPathNSResolver", "XPathNSResolverOrNull"]:
            # FIXME: remove this special case
            return "%s.release()" % argument.name
        return argument.name

    # Truncate omitted optional arguments
    arguments = method.arguments[:number_of_arguments]
    cpp_arguments = []
    if "ImplementedInPrivateScript" in method.extended_attributes:
        cpp_arguments.append("toFrameIfNotDetached(info.GetIsolate()->GetCurrentContext())")
        cpp_arguments.append("impl")

    if method.is_constructor:
        call_with_values = interface.extended_attributes.get("ConstructorCallWith")
    else:
        call_with_values = method.extended_attributes.get("CallWith")
    cpp_arguments.extend(v8_utilities.call_with_arguments(call_with_values))

    # Members of IDL partial interface definitions are implemented in C++ as
    # static member functions, which for instance members (non-static members)
    # take *impl as their first argument
    if (
        "PartialInterfaceImplementedAs" in method.extended_attributes
        and not "ImplementedInPrivateScript" in method.extended_attributes
        and not method.is_static
    ):
        cpp_arguments.append("*impl")
    cpp_arguments.extend(cpp_argument(argument) for argument in arguments)

    this_union_arguments = method.idl_type and method.idl_type.union_arguments
    if this_union_arguments:
        cpp_arguments.extend([member_argument["cpp_value"] for member_argument in this_union_arguments])

    if "ImplementedInPrivateScript" in method.extended_attributes:
        if method.idl_type.name != "void":
            cpp_arguments.append("&result")
    elif "RaisesException" in method.extended_attributes or (
        method.is_constructor and has_extended_attribute_value(interface, "RaisesException", "Constructor")
    ):
        cpp_arguments.append("exceptionState")

    if method.name == "Constructor":
        base_name = "create"
    elif method.name == "NamedConstructor":
        base_name = "createForJSConstructor"
    elif "ImplementedInPrivateScript" in method.extended_attributes:
        base_name = "%sMethod" % method.name
    else:
        base_name = v8_utilities.cpp_name(method)

    cpp_method_name = v8_utilities.scoped_name(interface, method, base_name)
    return "%s(%s)" % (cpp_method_name, ", ".join(cpp_arguments))
开发者ID:wulala-wuwu,项目名称:Blink,代码行数:59,代码来源:v8_methods.py


示例6: cpp_value

def cpp_value(interface, method, number_of_arguments):
    def cpp_argument(argument):
        idl_type = argument.idl_type
        if idl_type.name == 'EventListener':
            return argument.name
        if (idl_type.name in ['NodeFilter', 'NodeFilterOrNull',
                              'XPathNSResolver', 'XPathNSResolverOrNull']):
            # FIXME: remove this special case
            return '%s.release()' % argument.name
        return argument.name

    # Truncate omitted optional arguments
    arguments = method.arguments[:number_of_arguments]
    cpp_arguments = []
    if 'ImplementedInPrivateScript' in method.extended_attributes:
        cpp_arguments.append('toLocalFrame(toFrameIfNotDetached(info.GetIsolate()->GetCurrentContext()))')
        cpp_arguments.append('impl')

    if method.is_constructor:
        call_with_values = interface.extended_attributes.get('ConstructorCallWith')
    else:
        call_with_values = method.extended_attributes.get('CallWith')
    cpp_arguments.extend(v8_utilities.call_with_arguments(call_with_values))

    # Members of IDL partial interface definitions are implemented in C++ as
    # static member functions, which for instance members (non-static members)
    # take *impl as their first argument
    if ('PartialInterfaceImplementedAs' in method.extended_attributes and
        not 'ImplementedInPrivateScript' in method.extended_attributes and
        not method.is_static):
        cpp_arguments.append('*impl')
    cpp_arguments.extend(cpp_argument(argument) for argument in arguments)

    if 'ImplementedInPrivateScript' in method.extended_attributes:
        if method.idl_type.name != 'void':
            cpp_arguments.append('&result')
    elif ('RaisesException' in method.extended_attributes or
        (method.is_constructor and
         has_extended_attribute_value(interface, 'RaisesException', 'Constructor'))):
        cpp_arguments.append('exceptionState')

    # If a method returns an IDL dictionary or union type, the return value is
    # passed as an argument to impl classes.
    idl_type = method.idl_type
    if idl_type and idl_type.use_output_parameter_for_result:
        cpp_arguments.append('result')

    if method.name == 'Constructor':
        base_name = 'create'
    elif method.name == 'NamedConstructor':
        base_name = 'createForJSConstructor'
    elif 'ImplementedInPrivateScript' in method.extended_attributes:
        base_name = '%sMethod' % method.name
    else:
        base_name = v8_utilities.cpp_name(method)

    cpp_method_name = v8_utilities.scoped_name(interface, method, base_name)
    return '%s(%s)' % (cpp_method_name, ', '.join(cpp_arguments))
开发者ID:dstockwell,项目名称:blink,代码行数:58,代码来源:v8_methods.py


示例7: setter_expression

def setter_expression(interface, attribute, context):
    extended_attributes = attribute.extended_attributes
    arguments = v8_utilities.call_with_arguments(
        extended_attributes.get("SetterCallWith") or extended_attributes.get("CallWith")
    )

    this_setter_base_name = setter_base_name(interface, attribute, arguments)
    setter_name = scoped_name(interface, attribute, this_setter_base_name)

    # Members of IDL partial interface definitions are implemented in C++ as
    # static member functions, which for instance members (non-static members)
    # take *impl as their first argument
    if (
        "PartialInterfaceImplementedAs" in extended_attributes
        and not "ImplementedInPrivateScript" in extended_attributes
        and not attribute.is_static
    ):
        arguments.append("*impl")
    idl_type = attribute.idl_type
    if "ImplementedInPrivateScript" in extended_attributes:
        arguments.append("toLocalFrame(toFrameIfNotDetached(info.GetIsolate()->GetCurrentContext()))")
        arguments.append("impl")
        arguments.append("cppValue")
    elif idl_type.base_type == "EventHandler":
        getter_name = scoped_name(interface, attribute, cpp_name(attribute))
        context["event_handler_getter_expression"] = "%s(%s)" % (getter_name, ", ".join(arguments))
        if interface.name in ["Window", "WorkerGlobalScope"] and attribute.name == "onerror":
            includes.add("bindings/core/v8/V8ErrorHandler.h")
            arguments.append(
                "V8EventListenerList::findOrCreateWrapper<V8ErrorHandler>(v8Value, true, ScriptState::current(info.GetIsolate()))"
            )
        else:
            arguments.append(
                "V8EventListenerList::getEventListener(ScriptState::current(info.GetIsolate()), v8Value, true, ListenerFindOrCreate)"
            )
    elif idl_type.is_interface_type:
        # FIXME: should be able to eliminate WTF::getPtr in most or all cases
        arguments.append("WTF::getPtr(cppValue)")
    else:
        arguments.append("cppValue")
    if context["is_setter_raises_exception"]:
        arguments.append("exceptionState")

    return "%s(%s)" % (setter_name, ", ".join(arguments))
开发者ID:howardroark2018,项目名称:chromium,代码行数:44,代码来源:v8_attributes.py


示例8: setter_expression

def setter_expression(interface, attribute, context):
    extended_attributes = attribute.extended_attributes
    arguments = v8_utilities.call_with_arguments(
        extended_attributes.get('SetterCallWith') or
        extended_attributes.get('CallWith'))

    this_setter_base_name = setter_base_name(interface, attribute, arguments)
    setter_name = scoped_name(interface, attribute, this_setter_base_name)

    # Members of IDL partial interface definitions are implemented in C++ as
    # static member functions, which for instance members (non-static members)
    # take *impl as their first argument
    if ('PartialInterfaceImplementedAs' in extended_attributes and
            not attribute.is_static):
        arguments.append('*impl')
    idl_type = attribute.idl_type
    if idl_type.base_type == 'EventHandler':
        getter_name = scoped_name(interface, attribute, cpp_name(attribute))
        context['event_handler_getter_expression'] = '%s(%s)' % (
            getter_name, ', '.join(arguments))
        if (interface.name in ['Window', 'WorkerGlobalScope'] and
                attribute.name == 'onerror'):
            includes.add('bindings/core/v8/V8ErrorHandler.h')
            arguments.append(
                'V8EventListenerHelper::EnsureErrorHandler(' +
                'ScriptState::ForRelevantRealm(info), v8Value)')
        else:
            arguments.append(
                'V8EventListenerHelper::GetEventListener(' +
                'ScriptState::ForRelevantRealm(info), v8Value, true, ' +
                'kListenerFindOrCreate)')
    else:
        arguments.append('cppValue')
    if idl_type.is_explicit_nullable:
        arguments.append('isNull')
    if context['is_setter_raises_exception']:
        arguments.append('exceptionState')

    return '%s(%s)' % (setter_name, ', '.join(arguments))
开发者ID:eval1749,项目名称:evita,代码行数:39,代码来源:v8_attributes.py


示例9: cpp_value

def cpp_value(interface, method, number_of_arguments):
    # Truncate omitted optional arguments
    arguments = method.arguments[:number_of_arguments]
    cpp_arguments = []
    if "ImplementedInPrivateScript" in method.extended_attributes:
        cpp_arguments.append("toLocalFrame(toFrameIfNotDetached(info.GetIsolate()->GetCurrentContext()))")
        cpp_arguments.append("impl")

    if method.is_constructor:
        call_with_values = interface.extended_attributes.get("ConstructorCallWith")
    else:
        call_with_values = method.extended_attributes.get("CallWith")
    cpp_arguments.extend(v8_utilities.call_with_arguments(call_with_values))

    # Members of IDL partial interface definitions are implemented in C++ as
    # static member functions, which for instance members (non-static members)
    # take *impl as their first argument
    if (
        "PartialInterfaceImplementedAs" in method.extended_attributes
        and "ImplementedInPrivateScript" not in method.extended_attributes
        and not method.is_static
    ):
        cpp_arguments.append("*impl")
    cpp_arguments.extend(argument.name for argument in arguments)

    if "ImplementedInPrivateScript" in method.extended_attributes:
        if method.idl_type.name != "void":
            cpp_arguments.append("&result")
    elif "RaisesException" in method.extended_attributes or (
        method.is_constructor and has_extended_attribute_value(interface, "RaisesException", "Constructor")
    ):
        cpp_arguments.append("exceptionState")

    # If a method returns an IDL dictionary or union type, the return value is
    # passed as an argument to impl classes.
    idl_type = method.idl_type
    if idl_type and idl_type.use_output_parameter_for_result:
        cpp_arguments.append("result")

    if method.name == "Constructor":
        base_name = "create"
    elif method.name == "NamedConstructor":
        base_name = "createForJSConstructor"
    elif "ImplementedInPrivateScript" in method.extended_attributes:
        base_name = "%sMethod" % method.name
    else:
        base_name = v8_utilities.cpp_name(method)

    cpp_method_name = v8_utilities.scoped_name(interface, method, base_name)
    return "%s(%s)" % (cpp_method_name, ", ".join(cpp_arguments))
开发者ID:endlessm,项目名称:chromium-browser,代码行数:50,代码来源:v8_methods.py


示例10: getter_expression

def getter_expression(interface, attribute, contents):
    arguments = []
    this_getter_base_name = getter_base_name(attribute, arguments)
    getter_name = v8_utilities.scoped_name(interface, attribute, this_getter_base_name)

    arguments.extend(v8_utilities.call_with_arguments(attribute))
    if ('ImplementedBy' in attribute.extended_attributes and
        not attribute.is_static):
        arguments.append('imp')
    if attribute.is_nullable:
        arguments.append('isNull')
    if contents['is_getter_raises_exception']:
        arguments.append('exceptionState')
    return '%s(%s)' % (getter_name, ', '.join(arguments))
开发者ID:glenkim-dev,项目名称:blink-crosswalk,代码行数:14,代码来源:v8_attributes.py


示例11: cpp_value

def cpp_value(interface, method, number_of_arguments):
    def cpp_argument(argument):
        idl_type = argument.idl_type
        if idl_type.name == 'EventListener':
            if (interface.name == 'EventTarget' and
                method.name == 'removeEventListener'):
                # FIXME: remove this special case by moving get() into
                # EventTarget::removeEventListener
                return '%s.get()' % argument.name
            return argument.name
        if (idl_type.is_callback_interface or
            idl_type.name in ['NodeFilter', 'XPathNSResolver']):
            # FIXME: remove this special case
            return '%s.release()' % argument.name
        return argument.name

    # Truncate omitted optional arguments
    arguments = method.arguments[:number_of_arguments]
    cpp_arguments = []
    if method.is_constructor:
        call_with_values = interface.extended_attributes.get('ConstructorCallWith')
    else:
        call_with_values = method.extended_attributes.get('CallWith')
    cpp_arguments.extend(v8_utilities.call_with_arguments(call_with_values))
    # Members of IDL partial interface definitions are implemented in C++ as
    # static member functions, which for instance members (non-static members)
    # take *impl as their first argument
    if ('PartialInterfaceImplementedAs' in method.extended_attributes and
        not method.is_static):
        cpp_arguments.append('*impl')
    cpp_arguments.extend(cpp_argument(argument) for argument in arguments)
    this_union_arguments = method.idl_type and method.idl_type.union_arguments
    if this_union_arguments:
        cpp_arguments.extend(this_union_arguments)

    if ('RaisesException' in method.extended_attributes or
        (method.is_constructor and
         has_extended_attribute_value(interface, 'RaisesException', 'Constructor'))):
        cpp_arguments.append('exceptionState')

    if method.name == 'Constructor':
        base_name = 'create'
    elif method.name == 'NamedConstructor':
        base_name = 'createForJSConstructor'
    else:
        base_name = v8_utilities.cpp_name(method)

    cpp_method_name = v8_utilities.scoped_name(interface, method, base_name)
    return '%s(%s)' % (cpp_method_name, ', '.join(cpp_arguments))
开发者ID:Drakey83,项目名称:steamlink-sdk,代码行数:49,代码来源:v8_methods.py


示例12: getter_expression

def getter_expression(interface, attribute, context):
    arguments = []
    this_getter_base_name = getter_base_name(interface, attribute, arguments)
    getter_name = scoped_name(interface, attribute, this_getter_base_name)

    arguments.extend(v8_utilities.call_with_arguments(attribute.extended_attributes.get("CallWith")))
    # Members of IDL partial interface definitions are implemented in C++ as
    # static member functions, which for instance members (non-static members)
    # take *impl as their first argument
    if "PartialInterfaceImplementedAs" in attribute.extended_attributes and not attribute.is_static:
        arguments.append("*impl")
    if attribute.idl_type.is_explicit_nullable:
        arguments.append("isNull")
    if context["is_getter_raises_exception"]:
        arguments.append("exceptionState")
    return "%s(%s)" % (getter_name, ", ".join(arguments))
开发者ID:Miaque,项目名称:mojo,代码行数:16,代码来源:v8_attributes.py


示例13: cpp_value

def cpp_value(interface, method, number_of_arguments):
    def cpp_argument(argument):
        if argument.idl_type in ['NodeFilter', 'XPathNSResolver']:
            # FIXME: remove this special case
            return '%s.release()' % argument.name
        return argument.name

    # Truncate omitted optional arguments
    arguments = method.arguments[:number_of_arguments]
    cpp_arguments = v8_utilities.call_with_arguments(method)
    cpp_arguments.extend(cpp_argument(argument) for argument in arguments)
    if 'RaisesException' in method.extended_attributes:
        cpp_arguments.append('exceptionState')

    cpp_method_name = v8_utilities.scoped_name(interface, method, v8_utilities.cpp_name(method))
    return '%s(%s)' % (cpp_method_name, ', '.join(cpp_arguments))
开发者ID:Metrological,项目名称:chromium,代码行数:16,代码来源:v8_methods.py


示例14: getter_expression

def getter_expression(interface, attribute, contents):
    arguments = []
    this_getter_base_name = getter_base_name(interface, attribute, arguments)
    getter_name = scoped_name(interface, attribute, this_getter_base_name)

    arguments.extend(v8_utilities.call_with_arguments(attribute))
    # Members of IDL partial interface definitions are implemented in C++ as
    # static member functions, which for instance members (non-static members)
    # take *impl as their first argument
    if ('PartialInterfaceImplementedAs' in attribute.extended_attributes and
        not attribute.is_static):
        arguments.append('*impl')
    if attribute.idl_type.is_nullable and not contents['has_strict_type_checking']:
        arguments.append('isNull')
    if contents['is_getter_raises_exception']:
        arguments.append('exceptionState')
    return '%s(%s)' % (getter_name, ', '.join(arguments))
开发者ID:TheTypoMaster,项目名称:evita,代码行数:17,代码来源:v8_attributes.py


示例15: cpp_value

def cpp_value(interface, method, number_of_arguments):
    def cpp_argument(argument):
        idl_type = argument.idl_type
        if idl_type.is_callback_interface or idl_type.name in ["NodeFilter", "NodeFilterOrNull"]:
            # FIXME: remove this special case
            return "%s.release()" % argument.name
        return argument.name

    # Truncate omitted optional arguments
    arguments = method.arguments[:number_of_arguments]
    cpp_arguments = []

    if method.is_constructor:
        call_with_values = interface.extended_attributes.get("ConstructorCallWith")
    else:
        call_with_values = method.extended_attributes.get("CallWith")
    cpp_arguments.extend(v8_utilities.call_with_arguments(call_with_values))

    # Members of IDL partial interface definitions are implemented in C++ as
    # static member functions, which for instance members (non-static members)
    # take *impl as their first argument
    if "PartialInterfaceImplementedAs" in method.extended_attributes and not method.is_static:
        cpp_arguments.append("*impl")
    cpp_arguments.extend(cpp_argument(argument) for argument in arguments)

    this_union_arguments = method.idl_type and method.idl_type.union_arguments
    if this_union_arguments:
        cpp_arguments.extend([member_argument["cpp_value"] for member_argument in this_union_arguments])

    if "RaisesException" in method.extended_attributes or (
        method.is_constructor and has_extended_attribute_value(interface, "RaisesException", "Constructor")
    ):
        cpp_arguments.append("exceptionState")

    if method.name == "Constructor":
        base_name = "create"
    elif method.name == "NamedConstructor":
        base_name = "createForJSConstructor"
    else:
        base_name = v8_utilities.cpp_name(method)

    cpp_method_name = v8_utilities.scoped_name(interface, method, base_name)
    return "%s(%s)" % (cpp_method_name, ", ".join(cpp_arguments))
开发者ID:takaaptech,项目名称:sky_engine,代码行数:43,代码来源:v8_methods.py


示例16: cpp_value

def cpp_value(interface, method, number_of_arguments):
    # Truncate omitted optional arguments
    arguments = method.arguments[:number_of_arguments]
    cpp_arguments = []

    if method.is_constructor:
        call_with_values = interface.extended_attributes.get('ConstructorCallWith')
    else:
        call_with_values = method.extended_attributes.get('CallWith')
    cpp_arguments.extend(v8_utilities.call_with_arguments(call_with_values))

    # Members of IDL partial interface definitions are implemented in C++ as
    # static member functions, which for instance members (non-static members)
    # take *impl as their first argument
    if ('PartialInterfaceImplementedAs' in method.extended_attributes and
            not method.is_static):
        cpp_arguments.append('*impl')
    cpp_arguments.extend(argument.name for argument in arguments)

    if ('RaisesException' in method.extended_attributes or
          (method.is_constructor and
           has_extended_attribute_value(interface, 'RaisesException', 'Constructor'))):
        cpp_arguments.append('exceptionState')

    # If a method returns an IDL dictionary or union type, the return value is
    # passed as an argument to impl classes.
    idl_type = method.idl_type
    if idl_type and idl_type.use_output_parameter_for_result:
        cpp_arguments.append('result')

    if method.name == 'Constructor':
        base_name = 'Create'
    elif method.name == 'NamedConstructor':
        base_name = 'CreateForJSConstructor'
    else:
        base_name = v8_utilities.cpp_name(method)

    cpp_method_name = v8_utilities.scoped_name(interface, method, base_name)
    return '%s(%s)' % (cpp_method_name, ', '.join(cpp_arguments))
开发者ID:eval1749,项目名称:evita,代码行数:39,代码来源:v8_methods.py


示例17: getter_expression

def getter_expression(interface, attribute, context):
    arguments = []
    this_getter_base_name = getter_base_name(interface, attribute, arguments)
    getter_name = scoped_name(interface, attribute, this_getter_base_name)

    if 'ImplementedInPrivateScript' in attribute.extended_attributes:
        arguments.append('toFrameIfNotDetached(info.GetIsolate()->GetCurrentContext())')
        arguments.append('impl')
        arguments.append('&result')
    arguments.extend(v8_utilities.call_with_arguments(
        attribute.extended_attributes.get('CallWith')))
    # Members of IDL partial interface definitions are implemented in C++ as
    # static member functions, which for instance members (non-static members)
    # take *impl as their first argument
    if ('PartialInterfaceImplementedAs' in attribute.extended_attributes and
        not attribute.is_static):
        arguments.append('*impl')
    if attribute.idl_type.is_nullable and not context['is_nullable_simple']:
        arguments.append('isNull')
    if context['is_getter_raises_exception']:
        arguments.append('exceptionState')
    return '%s(%s)' % (getter_name, ', '.join(arguments))
开发者ID:smil-in-javascript,项目名称:blink,代码行数:22,代码来源:v8_attributes.py


示例18: setter_expression

def setter_expression(interface, attribute, contents):
    arguments = v8_utilities.call_with_arguments(attribute, attribute.extended_attributes.get('SetterCallWith'))

    this_setter_base_name = setter_base_name(attribute, arguments)
    setter_name = v8_utilities.scoped_name(interface, attribute, this_setter_base_name)

    idl_type = attribute.idl_type
    if idl_type == 'EventHandler':
        # FIXME: move V8EventListenerList.h to INCLUDES_FOR_TYPE
        includes.add('bindings/v8/V8EventListenerList.h')
        # FIXME: pass the isolate instead of the isolated world
        isolated_world = 'isolatedWorldForIsolate(info.GetIsolate())'
        arguments.extend(['V8EventListenerList::getEventListener(jsValue, true, ListenerFindOrCreate)', isolated_world])
        contents['event_handler_getter_expression'] = 'imp->%s(%s)' % (cpp_name(attribute), isolated_world)
    elif v8_types.is_interface_type(idl_type) and not v8_types.array_type(idl_type):
        # FIXME: should be able to eliminate WTF::getPtr in most or all cases
        arguments.append('WTF::getPtr(cppValue)')
    else:
        arguments.append('cppValue')
    if contents['is_setter_raises_exception']:
        arguments.append('es')

    return '%s(%s)' % (setter_name, ', '.join(arguments))
开发者ID:cvsuser-chromium,项目名称:third_party_WebKit,代码行数:23,代码来源:v8_attributes.py



注:本文中的v8_utilities.scoped_name函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python v8_utilities.uncapitalize函数代码示例发布时间:2022-05-26
下一篇:
Python v8_utilities.runtime_enabled_function_name函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap