当前位置: 首页>>代码示例>>Python>>正文


Python includes.clear函数代码示例

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


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

示例1: callback_function_context

def callback_function_context(callback_function):
    includes.clear()
    includes.update(CALLBACK_FUNCTION_CPP_INCLUDES)
    idl_type = callback_function.idl_type
    idl_type_str = str(idl_type)
    forward_declarations = []
    for argument in callback_function.arguments:
        if argument.idl_type.is_interface_type:
            forward_declarations.append(argument.idl_type)
        argument.idl_type.add_includes_for_type(callback_function.extended_attributes)

    context = {
        'cpp_class': callback_function.name,
        'cpp_includes': sorted(includes),
        'forward_declarations': sorted(forward_declarations),
        'header_includes': sorted(CALLBACK_FUNCTION_H_INCLUDES),
        'idl_type': idl_type_str,
    }

    if idl_type_str != 'void':
        context.update({
            'return_cpp_type': idl_type.cpp_type + '&',
            'return_value': idl_type.v8_value_to_local_cpp_value(
                callback_function.extended_attributes,
                'v8ReturnValue', 'cppValue',
                isolate='m_scriptState->isolate()',
                bailout_return_value='false'),
        })

    context.update(arguments_context(callback_function.arguments, context.get('return_cpp_type')))
    return context
开发者ID:mirror,项目名称:chromium,代码行数:31,代码来源:v8_callback_function.py

示例2: dictionary_impl_context

def dictionary_impl_context(dictionary, interfaces_info):
    def remove_duplicate_members(members):
        # When [ImplementedAs] is used, cpp_name can conflict. For example,
        # dictionary D { long foo; [ImplementedAs=foo, DeprecateAs=Foo] long oldFoo; };
        # This function removes such duplications, checking they have the same type.
        members_dict = {}
        for member in members:
            cpp_name = member['cpp_name']
            duplicated_member = members_dict.get(cpp_name)
            if duplicated_member and duplicated_member != member:
                raise Exception('Member name conflict: %s' % cpp_name)
            members_dict[cpp_name] = member
        return sorted(members_dict.values(), key=lambda member: member['cpp_name'])

    includes.clear()
    header_includes = set(['platform/heap/Handle.h'])
    members = [member_impl_context(member, interfaces_info, header_includes)
               for member in dictionary.members]
    members = remove_duplicate_members(members)
    context = {
        'header_includes': header_includes,
        'cpp_class': v8_utilities.cpp_name(dictionary),
        'members': members,
    }
    if dictionary.parent:
        context['parent_cpp_class'] = v8_utilities.cpp_name_from_interfaces_info(
            dictionary.parent, interfaces_info)
        parent_interface_info = interfaces_info.get(dictionary.parent)
        if parent_interface_info:
            context['header_includes'].add(
                parent_interface_info['include_path'])
    return context
开发者ID:joone,项目名称:blink-crosswalk,代码行数:32,代码来源:v8_dictionary.py

示例3: callback_function_context

def callback_function_context(callback_function):
    includes.clear()
    includes.update(CALLBACK_FUNCTION_CPP_INCLUDES)
    idl_type = callback_function.idl_type
    idl_type_str = str(idl_type)
    forward_declarations = []
    for argument in callback_function.arguments:
        if argument.idl_type.is_interface_type:
            forward_declarations.append(argument.idl_type)
        argument.idl_type.add_includes_for_type(callback_function.extended_attributes)

    context = {
        "cpp_class": callback_function.name,
        "cpp_includes": sorted(includes),
        "forward_declarations": sorted(forward_declarations),
        "header_includes": sorted(CALLBACK_FUNCTION_H_INCLUDES),
        "idl_type": idl_type_str,
    }

    if idl_type_str != "void":
        context.update(
            {
                "return_cpp_type": idl_type.cpp_type + "&",
                "return_value": idl_type.v8_value_to_local_cpp_value(
                    callback_function.extended_attributes,
                    "v8ReturnValue",
                    "cppValue",
                    isolate="scriptState->isolate()",
                    bailout_return_value="false",
                ),
            }
        )

    context.update(arguments_context(callback_function.arguments, context.get("return_cpp_type")))
    return context
开发者ID:ollie314,项目名称:chromium,代码行数:35,代码来源:v8_callback_function.py

示例4: generate_interface

def generate_interface(interface):
    includes.clear()
    includes.update(INTERFACE_CPP_INCLUDES)
    v8_class_name = v8_utilities.v8_class_name(interface)

    template_contents = {
        'cpp_class_name': cpp_name(interface),
        'header_includes': INTERFACE_H_INCLUDES,
        'interface_name': interface.name,
        'v8_class_name': v8_class_name,
    }

    template_contents.update({
        'constants': [generate_constant(constant) for constant in interface.constants],
        'do_not_check_constants': 'DoNotCheckConstants' in interface.extended_attributes,
    })

    attributes = [v8_attributes.generate_attribute(interface, attribute)
                  for attribute in interface.attributes]
    template_contents.update({
        'attributes': attributes,
        'has_constructor_attributes': any(attribute['is_constructor'] for attribute in attributes),
        'has_per_context_enabled_attributes': any(attribute['per_context_enabled_function_name'] for attribute in attributes),
        'has_replaceable_attributes': any(attribute['is_replaceable'] for attribute in attributes),
        'has_runtime_enabled_attributes': any(attribute['runtime_enabled_function_name'] for attribute in attributes),
    })

    template_contents['methods'] = [v8_methods.generate_method(method)
                                    for method in interface.operations]

    return template_contents
开发者ID:chunywang,项目名称:blink-crosswalk,代码行数:31,代码来源:v8_interface.py

示例5: dictionary_context

def dictionary_context(dictionary, interfaces_info):
    includes.clear()
    includes.update(DICTIONARY_CPP_INCLUDES)

    members = [member_context(dictionary, member)
               for member in sorted(dictionary.members,
                                    key=operator.attrgetter('name'))]

    for member in members:
        if member['runtime_enabled_function']:
            includes.add('platform/RuntimeEnabledFeatures.h')
            break

    cpp_class = v8_utilities.cpp_name(dictionary)
    context = {
        'cpp_class': cpp_class,
        'header_includes': set(DICTIONARY_H_INCLUDES),
        'members': members,
        'required_member_names': sorted([member.name
                                         for member in dictionary.members
                                         if member.is_required]),
        'use_permissive_dictionary_conversion': 'PermissiveDictionaryConversion' in dictionary.extended_attributes,
        'v8_class': v8_types.v8_type(cpp_class),
        'v8_original_class': v8_types.v8_type(dictionary.name),
    }
    if dictionary.parent:
        IdlType(dictionary.parent).add_includes_for_type()
        parent_cpp_class = v8_utilities.cpp_name_from_interfaces_info(
            dictionary.parent, interfaces_info)
        context.update({
            'parent_cpp_class': parent_cpp_class,
            'parent_v8_class': v8_types.v8_type(parent_cpp_class),
        })
    return context
开发者ID:endlessm,项目名称:chromium-browser,代码行数:34,代码来源:v8_dictionary.py

示例6: callback_function_context

def callback_function_context(callback_function):
    includes.clear()
    includes.update(CALLBACK_FUNCTION_CPP_INCLUDES)
    idl_type = callback_function.idl_type
    idl_type_str = str(idl_type)

    for argument in callback_function.arguments:
        argument.idl_type.add_includes_for_type(
            callback_function.extended_attributes)

    context = {
        # While both |callback_function_name| and |cpp_class| are identical at
        # the moment, the two are being defined because their values may change
        # in the future (e.g. if we support [ImplementedAs=] in callback
        # functions).
        'callback_function_name': callback_function.name,
        'cpp_class': callback_function.name,
        'cpp_includes': sorted(includes),
        'forward_declarations': sorted(forward_declarations(callback_function)),
        'header_includes': sorted(CALLBACK_FUNCTION_H_INCLUDES),
        'idl_type': idl_type_str,
    }

    if idl_type_str != 'void':
        context.update({
            'return_cpp_type': idl_type.cpp_type + '&',
            'return_value': idl_type.v8_value_to_local_cpp_value(
                callback_function.extended_attributes,
                'v8ReturnValue', 'cppValue',
                isolate='script_state_->GetIsolate()',
                bailout_return_value='false'),
        })

    context.update(arguments_context(callback_function.arguments, context.get('return_cpp_type')))
    return context
开发者ID:eval1749,项目名称:evita,代码行数:35,代码来源:v8_callback_function.py

示例7: dictionary_impl_context

def dictionary_impl_context(dictionary, interfaces_info):
    includes.clear()
    header_includes = set(["platform/heap/Handle.h"])
    return {
        "header_includes": header_includes,
        "cpp_class": v8_utilities.cpp_name(dictionary),
        "members": [member_impl_context(member, interfaces_info, header_includes) for member in dictionary.members],
    }
开发者ID:wulala-wuwu,项目名称:Blink,代码行数:8,代码来源:v8_dictionary.py

示例8: dictionary_context

def dictionary_context(dictionary):
    includes.clear()
    includes.update(DICTIONARY_CPP_INCLUDES)
    return {
        "cpp_class": v8_utilities.cpp_name(dictionary),
        "header_includes": set(DICTIONARY_H_INCLUDES),
        "members": [member_context(member) for member in sorted(dictionary.members, key=operator.attrgetter("name"))],
        "v8_class": v8_utilities.v8_class_name(dictionary),
    }
开发者ID:wulala-wuwu,项目名称:Blink,代码行数:9,代码来源:v8_dictionary.py

示例9: callback_interface_context

def callback_interface_context(callback_interface):
    includes.clear()
    includes.update(CALLBACK_INTERFACE_CPP_INCLUDES)
    return {
        "cpp_class": callback_interface.name,
        "v8_class": v8_utilities.v8_class_name(callback_interface),
        "header_includes": set(CALLBACK_INTERFACE_H_INCLUDES),
        "methods": [method_context(operation) for operation in callback_interface.operations],
    }
开发者ID:astojilj,项目名称:chromium-crosswalk,代码行数:9,代码来源:v8_callback_interface.py

示例10: dictionary_impl_context

def dictionary_impl_context(dictionary, interfaces_info):
    includes.clear()
    header_includes = set(['platform/heap/Handle.h'])
    return {
        'header_includes': header_includes,
        'cpp_class': v8_utilities.cpp_name(dictionary),
        'members': [member_impl_context(member, interfaces_info,
                                        header_includes)
                    for member in dictionary.members],
    }
开发者ID:syncfusion,项目名称:SfQtWebKit,代码行数:10,代码来源:v8_dictionary.py

示例11: generate_callback_interface

def generate_callback_interface(callback_interface):
    includes.clear()
    includes.update(CALLBACK_INTERFACE_CPP_INCLUDES)
    return {
        'conditional_string': v8_utilities.conditional_string(callback_interface),
        'cpp_class': callback_interface.name,
        'v8_class': v8_utilities.v8_class_name(callback_interface),
        'header_includes': set(CALLBACK_INTERFACE_H_INCLUDES),
        'methods': [generate_method(operation)
                    for operation in callback_interface.operations],
    }
开发者ID:junmin-zhu,项目名称:blink,代码行数:11,代码来源:v8_callback_interface.py

示例12: dictionary_context

def dictionary_context(dictionary):
    includes.clear()
    includes.update(DICTIONARY_CPP_INCLUDES)
    return {
        'cpp_class': v8_utilities.cpp_name(dictionary),
        'header_includes': set(DICTIONARY_H_INCLUDES),
        'members': [member_context(member)
                    for member in sorted(dictionary.members,
                                         key=operator.attrgetter('name'))],
        'v8_class': v8_utilities.v8_class_name(dictionary),
    }
开发者ID:syncfusion,项目名称:SfQtWebKit,代码行数:11,代码来源:v8_dictionary.py

示例13: private_script_interface_context

def private_script_interface_context(private_script_interface):
    includes.clear()
    includes.update(BLINK_IN_JS_INTERFACE_CPP_INCLUDES)
    return {
        'cpp_class': private_script_interface.name,
        'forward_declarations': forward_declarations(private_script_interface),
        'header_includes': set(BLINK_IN_JS_INTERFACE_H_INCLUDES),
        'methods': [method_context(operation)
                    for operation in private_script_interface.operations],
        'v8_class': v8_utilities.v8_class_name(private_script_interface),
    }
开发者ID:ewilligers,项目名称:blink,代码行数:11,代码来源:v8_private_script_interface.py

示例14: legacy_callback_interface_context

def legacy_callback_interface_context(callback_interface, _):
    includes.clear()
    includes.update(LEGACY_CALLBACK_INTERFACE_CPP_INCLUDES)
    return {
        # TODO(bashi): Fix crbug.com/630986, and add 'methods'.
        'constants': [constant_context(constant, callback_interface)
                      for constant in callback_interface.constants],
        'cpp_class': callback_interface.name,
        'header_includes': set(CALLBACK_INTERFACE_H_INCLUDES),
        'interface_name': callback_interface.name,
        'v8_class': v8_utilities.v8_class_name(callback_interface),
    }
开发者ID:eval1749,项目名称:evita,代码行数:12,代码来源:v8_callback_interface.py

示例15: generate_callback_interface

def generate_callback_interface(callback_interface):
    includes.clear()
    includes.update(CALLBACK_INTERFACE_CPP_INCLUDES)

    methods = [generate_method(operation) for operation in callback_interface.operations]
    template_contents = {
        'cpp_class_name': callback_interface.name,
        'v8_class_name': v8_class_name(callback_interface),
        'header_includes': CALLBACK_INTERFACE_H_INCLUDES,
        'methods': methods,
    }
    return template_contents
开发者ID:chunywang,项目名称:blink-crosswalk,代码行数:12,代码来源:v8_callback_interface.py


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