Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(33)

Side by Side Diff: Source/bindings/scripts/unstable/v8_interface.py

Issue 82693003: IDL compiler: [CustomToV8] interface (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased, remove excess files Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/bindings/scripts/code_generator_v8.pm ('k') | Source/bindings/templates/interface.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (C) 2013 Google Inc. All rights reserved. 1 # Copyright (C) 2013 Google Inc. All rights reserved.
2 # 2 #
3 # Redistribution and use in source and binary forms, with or without 3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions are 4 # modification, are permitted provided that the following conditions are
5 # met: 5 # met:
6 # 6 #
7 # * Redistributions of source code must retain the above copyright 7 # * Redistributions of source code must retain the above copyright
8 # notice, this list of conditions and the following disclaimer. 8 # notice, this list of conditions and the following disclaimer.
9 # * Redistributions in binary form must reproduce the above 9 # * Redistributions in binary form must reproduce the above
10 # copyright notice, this list of conditions and the following disclaimer 10 # copyright notice, this list of conditions and the following disclaimer
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 from v8_utilities import conditional_string, cpp_name, has_extended_attribute, r untime_enabled_function_name 43 from v8_utilities import conditional_string, cpp_name, has_extended_attribute, r untime_enabled_function_name
44 44
45 45
46 INTERFACE_H_INCLUDES = set([ 46 INTERFACE_H_INCLUDES = set([
47 'bindings/v8/V8Binding.h', 47 'bindings/v8/V8Binding.h',
48 'bindings/v8/V8DOMWrapper.h', # FIXME: necessary? 48 'bindings/v8/V8DOMWrapper.h', # FIXME: necessary?
49 'bindings/v8/WrapperTypeInfo.h', # FIXME: necessary? 49 'bindings/v8/WrapperTypeInfo.h', # FIXME: necessary?
50 ]) 50 ])
51 INTERFACE_CPP_INCLUDES = set([ 51 INTERFACE_CPP_INCLUDES = set([
52 'RuntimeEnabledFeatures.h', 52 'RuntimeEnabledFeatures.h',
53 'bindings/v8/ScriptController.h',
54 'bindings/v8/V8Binding.h', 53 'bindings/v8/V8Binding.h',
55 'bindings/v8/V8DOMConfiguration.h', # FIXME: necessary? 54 'bindings/v8/V8DOMConfiguration.h', # FIXME: necessary?
56 'bindings/v8/V8DOMWrapper.h', # FIXME: necessary? 55 'bindings/v8/V8DOMWrapper.h', # FIXME: necessary?
57 'core/dom/ContextFeatures.h', 56 'core/dom/ContextFeatures.h',
58 'core/dom/Document.h', 57 'core/dom/Document.h',
59 'platform/TraceEvent.h', 58 'platform/TraceEvent.h',
60 'wtf/UnusedParam.h', 59 'wtf/UnusedParam.h',
61 ]) 60 ])
62 61
63 62
(...skipping 13 matching lines...) Expand all
77 generate_visit_dom_wrapper_function = extended_attributes.get('GenerateVisit DOMWrapper') 76 generate_visit_dom_wrapper_function = extended_attributes.get('GenerateVisit DOMWrapper')
78 if generate_visit_dom_wrapper_function: 77 if generate_visit_dom_wrapper_function:
79 includes.update(['bindings/v8/V8GCController.h', 78 includes.update(['bindings/v8/V8GCController.h',
80 'core/dom/Element.h']) 79 'core/dom/Element.h'])
81 80
82 template_contents = { 81 template_contents = {
83 'conditional_string': conditional_string(interface), # [Conditional] 82 'conditional_string': conditional_string(interface), # [Conditional]
84 'cpp_class': cpp_name(interface), 83 'cpp_class': cpp_name(interface),
85 'generate_visit_dom_wrapper_function': generate_visit_dom_wrapper_functi on, 84 'generate_visit_dom_wrapper_function': generate_visit_dom_wrapper_functi on,
86 'has_custom_legacy_call': 'CustomLegacyCall' in extended_attributes, # [CustomLegacyCall] 85 'has_custom_legacy_call': 'CustomLegacyCall' in extended_attributes, # [CustomLegacyCall]
86 'has_custom_to_v8': 'CustomToV8' in extended_attributes, # [CustomToV8]
87 'has_custom_wrap': 'CustomWrap' in extended_attributes, # [CustomWrap] 87 'has_custom_wrap': 'CustomWrap' in extended_attributes, # [CustomWrap]
88 'has_visit_dom_wrapper': has_extended_attribute(interface, 88 'has_visit_dom_wrapper': has_extended_attribute(interface,
89 ['CustomVisitDOMWrapper', 'GenerateVisitDOMWrapper']), 89 ['CustomVisitDOMWrapper', 'GenerateVisitDOMWrapper']),
90 'header_includes': INTERFACE_H_INCLUDES, 90 'header_includes': INTERFACE_H_INCLUDES,
91 'interface_name': interface.name, 91 'interface_name': interface.name,
92 'is_active_dom_object': 'ActiveDOMObject' in extended_attributes, # [Ac tiveDOMObject] 92 'is_active_dom_object': 'ActiveDOMObject' in extended_attributes, # [Ac tiveDOMObject]
93 'is_check_security': is_check_security, 93 'is_check_security': is_check_security,
94 'is_dependent_lifetime': 'DependentLifetime' in extended_attributes, # [DependentLifetime] 94 'is_dependent_lifetime': 'DependentLifetime' in extended_attributes, # [DependentLifetime]
95 'v8_class': v8_utilities.v8_class_name(interface), 95 'v8_class': v8_utilities.v8_class_name(interface),
96 } 96 }
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 '%s->IsString()' % cpp_value, 251 '%s->IsString()' % cpp_value,
252 '%s->IsObject()' % cpp_value]) 252 '%s->IsObject()' % cpp_value])
253 if v8_types.array_or_sequence_type(idl_type): 253 if v8_types.array_or_sequence_type(idl_type):
254 return '%s->IsArray()' % cpp_value 254 return '%s->IsArray()' % cpp_value
255 if v8_types.is_wrapper_type(idl_type): 255 if v8_types.is_wrapper_type(idl_type):
256 type_check = 'V8{idl_type}::hasInstance({cpp_value}, info.GetIsolate(), worldType(info.GetIsolate()))'.format(idl_type=idl_type, cpp_value=cpp_value) 256 type_check = 'V8{idl_type}::hasInstance({cpp_value}, info.GetIsolate(), worldType(info.GetIsolate()))'.format(idl_type=idl_type, cpp_value=cpp_value)
257 if argument['is_nullable']: 257 if argument['is_nullable']:
258 type_check = ' || '.join(['%s->IsNull()' % cpp_value, type_check]) 258 type_check = ' || '.join(['%s->IsNull()' % cpp_value, type_check])
259 return type_check 259 return type_check
260 return None 260 return None
OLDNEW
« no previous file with comments | « Source/bindings/scripts/code_generator_v8.pm ('k') | Source/bindings/templates/interface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698