本文整理汇总了Python中v8_globals.includes.clear函数的典型用法代码示例。如果您正苦于以下问题:Python clear函数的具体用法?Python clear怎么用?Python clear使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了clear函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: generate_callback_interface
def generate_callback_interface(callback_interface):
includes.clear()
includes.update(CALLBACK_INTERFACE_CPP_INCLUDES)
name = callback_interface.name
methods = [generate_method(operation)
for operation in callback_interface.operations]
template_contents = {
'cpp_class': name,
'dart_class': dart_types.dart_type(callback_interface.name),
'header_includes': set(CALLBACK_INTERFACE_H_INCLUDES),
'methods': methods,
}
return template_contents
开发者ID:rafaelw,项目名称:mojo,代码行数:14,代码来源:dart_callback_interface.py
示例17: dictionary_context
def dictionary_context(dictionary, interfaces_info):
includes.clear()
includes.update(DICTIONARY_CPP_INCLUDES)
cpp_class = v8_utilities.cpp_name(dictionary)
context = {
"cpp_class": cpp_class,
"header_includes": set(DICTIONARY_H_INCLUDES),
"members": [
member_context(dictionary, member) for member in sorted(dictionary.members, key=operator.attrgetter("name"))
],
"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:kingysu,项目名称:blink-crosswalk,代码行数:19,代码来源:v8_dictionary.py
示例18: dictionary_context
def dictionary_context(dictionary, interfaces_info):
includes.clear()
includes.update(DICTIONARY_CPP_INCLUDES)
cpp_class = v8_utilities.cpp_name(dictionary)
context = {
'cpp_class': cpp_class,
'header_includes': set(DICTIONARY_H_INCLUDES),
'members': [member_context(dictionary, member)
for member in sorted(dictionary.members,
key=operator.attrgetter('name'))],
'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:joone,项目名称:blink-crosswalk,代码行数:23,代码来源:v8_dictionary.py
示例19: interface_context
def interface_context(interface):
includes.clear()
includes.update(INTERFACE_CPP_INCLUDES)
header_includes = set(INTERFACE_H_INCLUDES)
parent_interface = interface.parent
if parent_interface:
header_includes.update(v8_types.includes_for_interface(parent_interface))
extended_attributes = interface.extended_attributes
# [ActiveDOMObject]
is_active_dom_object = 'ActiveDOMObject' in extended_attributes
# [CheckSecurity]
is_check_security = 'CheckSecurity' in extended_attributes
if is_check_security:
includes.add('bindings/core/v8/BindingSecurity.h')
# [DependentLifetime]
is_dependent_lifetime = 'DependentLifetime' in extended_attributes
# [Iterable]
iterator_method = None
if 'Iterable' in extended_attributes:
iterator_operation = IdlOperation(interface.idl_name)
iterator_operation.name = 'iterator'
iterator_operation.idl_type = IdlType('Iterator')
iterator_operation.extended_attributes['RaisesException'] = None
iterator_operation.extended_attributes['CallWith'] = 'ScriptState'
iterator_method = v8_methods.method_context(interface,
iterator_operation)
# [MeasureAs]
is_measure_as = 'MeasureAs' in extended_attributes
if is_measure_as:
includes.add('core/frame/UseCounter.h')
# [SetWrapperReferenceFrom]
reachable_node_function = extended_attributes.get('SetWrapperReferenceFrom')
if reachable_node_function:
includes.update(['bindings/core/v8/V8GCController.h',
'core/dom/Element.h'])
# [SetWrapperReferenceTo]
set_wrapper_reference_to_list = [{
'name': argument.name,
# FIXME: properly should be:
# 'cpp_type': argument.idl_type.cpp_type_args(raw_type=True),
# (if type is non-wrapper type like NodeFilter, normally RefPtr)
# Raw pointers faster though, and NodeFilter hacky anyway.
'cpp_type': argument.idl_type.implemented_as + '*',
'idl_type': argument.idl_type,
'v8_type': v8_types.v8_type(argument.idl_type.name),
} for argument in extended_attributes.get('SetWrapperReferenceTo', [])]
for set_wrapper_reference_to in set_wrapper_reference_to_list:
set_wrapper_reference_to['idl_type'].add_includes_for_type()
# [NotScriptWrappable]
is_script_wrappable = 'NotScriptWrappable' not in extended_attributes
# [Custom=Wrap], [SetWrapperReferenceFrom]
has_visit_dom_wrapper = (
has_extended_attribute_value(interface, 'Custom', 'VisitDOMWrapper') or
reachable_node_function or
set_wrapper_reference_to_list)
this_gc_type = gc_type(interface)
wrapper_class_id = ('NodeClassId' if inherits_interface(interface.name, 'Node') else 'ObjectClassId')
context = {
'conditional_string': conditional_string(interface), # [Conditional]
'cpp_class': cpp_name(interface),
'gc_type': this_gc_type,
# FIXME: Remove 'EventTarget' special handling, http://crbug.com/383699
'has_access_check_callbacks': (is_check_security and
interface.name != 'Window' and
interface.name != 'EventTarget'),
'has_custom_legacy_call_as_function': has_extended_attribute_value(interface, 'Custom', 'LegacyCallAsFunction'), # [Custom=LegacyCallAsFunction]
'has_custom_to_v8': has_extended_attribute_value(interface, 'Custom', 'ToV8'), # [Custom=ToV8]
'has_custom_wrap': has_extended_attribute_value(interface, 'Custom', 'Wrap'), # [Custom=Wrap]
'has_visit_dom_wrapper': has_visit_dom_wrapper,
'header_includes': header_includes,
'interface_name': interface.name,
'is_active_dom_object': is_active_dom_object,
'is_check_security': is_check_security,
'is_dependent_lifetime': is_dependent_lifetime,
'is_event_target': inherits_interface(interface.name, 'EventTarget'),
'is_exception': interface.is_exception,
'is_node': inherits_interface(interface.name, 'Node'),
'is_script_wrappable': is_script_wrappable,
'iterator_method': iterator_method,
'lifetime': 'Dependent'
if (has_visit_dom_wrapper or
is_active_dom_object or
is_dependent_lifetime)
else 'Independent',
'measure_as': v8_utilities.measure_as(interface), # [MeasureAs]
'parent_interface': parent_interface,
'pass_cpp_type': cpp_template_type(
#.........这里部分代码省略.........
开发者ID:335969568,项目名称:Blink-1,代码行数:101,代码来源:v8_interface.py
示例20: interface_context
def interface_context(interface):
context = v8_interface.interface_context(interface)
includes.clear()
includes.update(INTERFACE_CPP_INCLUDES)
header_includes = set(INTERFACE_H_INCLUDES)
parent_interface = interface.parent
if parent_interface:
header_includes.update(dart_types.includes_for_interface(parent_interface))
extended_attributes = interface.extended_attributes
if inherits_interface(interface.name, "EventTarget"):
includes.update(["bindings/dart_event_listener.h"])
# [SetWrapperReferenceTo]
set_wrapper_reference_to_list = [
{
"name": argument.name,
# FIXME: properly should be:
# 'cpp_type': argument.idl_type.cpp_type_args(used_as_rvalue_type=True),
# (if type is non-wrapper type like NodeFilter, normally RefPtr)
# Raw pointers faster though, and NodeFilter hacky anyway.
"cpp_type": argument.idl_type.implemented_as + "*",
"idl_type": argument.idl_type,
}
for argument in extended_attributes.get("SetWrapperReferenceTo", [])
]
for set_wrapper_reference_to in set_wrapper_reference_to_list:
set_wrapper_reference_to["idl_type"].add_includes_for_type()
context.update(
{
"cpp_class": DartUtilities.cpp_name(interface),
"header_includes": header_includes,
"set_wrapper_reference_to_list": set_wrapper_reference_to_list,
"dart_class": dart_types.dart_type(interface.name),
}
)
# Constructors
constructors = [
constructor_context(interface, constructor)
for constructor in interface.constructors
# FIXME: shouldn't put named constructors with constructors
# (currently needed for Perl compatibility)
# Handle named constructors separately
if constructor.name == "Constructor"
]
if len(constructors) > 1:
context.update({"constructor_overloads": overloads_context(constructors)})
# [CustomConstructor]
custom_constructors = [
custom_constructor_context(interface, constructor) for constructor in interface.custom_constructors
]
# [NamedConstructor]
named_constructor = generate_named_constructor(interface)
generate_method_native_entries(interface, constructors, "Constructor")
generate_method_native_entries(interface, custom_constructors, "Constructor")
if named_constructor:
generate_method_native_entries(interface, [named_constructor], "Constructor")
event_constructor = None
if context["has_event_constructor"]:
event_constructor = {
"native_entries": [DartUtilities.generate_native_entry(interface.name, None, "Constructor", False, 2)]
}
context.update(
{
"constructors": constructors,
"custom_constructors": custom_constructors,
"event_constructor": event_constructor,
"has_custom_constructor": bool(custom_constructors),
"interface_length": v8_interface.interface_length(interface, constructors + custom_constructors),
"is_constructor_call_with_execution_context": DartUtilities.has_extended_attribute_value(
interface, "ConstructorCallWith", "ExecutionContext"
), # [ConstructorCallWith=ExeuctionContext]
"named_constructor": named_constructor,
}
)
# Attributes
attributes = [
dart_attributes.attribute_context(interface, attribute)
for attribute in interface.attributes
if not v8_attributes.is_constructor_attribute(attribute)
]
context.update(
{
"attributes": attributes,
"has_constructor_attributes": any(attribute["constructor_type"] for attribute in attributes),
"has_replaceable_attributes": any(attribute["is_replaceable"] for attribute in attributes),
}
)
# Methods
#.........这里部分代码省略.........
开发者ID:MitchRudominer,项目名称:engine,代码行数:101,代码来源:dart_interface.py
注:本文中的v8_globals.includes.clear函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论