Home | History | Annotate | Download | only in scripts

Lines Matching refs:data_type

116 def cpp_value_to_js_value(data_type, cpp_value, isolate, creation_context=''):
118 if data_type == 'boolean':
120 if data_type in ['long long', 'unsigned long long', 'DOMTimeStamp']:
123 if primitive_type(data_type):
124 if data_type not in ['float', 'double']:
125 raise Exception('unexpected data_type %s' % data_type)
127 if data_type == 'DOMString':
129 if array_or_sequence_type(data_type):
146 def includes_for_type(data_type):
147 if primitive_type(data_type) or data_type == 'DOMString':
149 if array_or_sequence_type(data_type):
150 return includes_for_type(array_or_sequence_type(data_type))
151 return set(['V8%s.h' % data_type])
159 includes = includes_for_type(operation.data_type)
161 includes |= includes_for_type(parameter.data_type)
165 def primitive_type(data_type):
166 return data_type in PRIMITIVE_TYPES
169 def sequence_type(data_type):
170 matched = re.match(r'sequence<([\w\d_\s]+)>', data_type)
176 def array_type(data_type):
177 matched = re.match(r'([\w\d_\s]+)\[\]', data_type)
183 def array_or_sequence_type(data_type):
184 return array_type(data_type) or sequence_type(data_type)
186 def cpp_type(data_type, pointer_type):
195 if data_type in CPP_TYPE_SPECIAL_CONVERSION_RULES:
196 return CPP_TYPE_SPECIAL_CONVERSION_RULES[data_type]
197 if array_or_sequence_type(data_type):
198 return 'const Vector<%s >&' % cpp_type(array_or_sequence_type(data_type), 'RefPtr')
200 return data_type + '*'
202 return '%s<%s>' % (pointer_type, data_type)
206 def v8_type(data_type):
207 return 'V8' + data_type
239 def generate_cpp_to_js_conversion(self, data_type, cpp_value, format_string, isolate, creation_context=''):
244 self.cpp_includes |= includes_for_type(data_type)
245 js_value = cpp_value_to_js_value(data_type, cpp_value, isolate, creation_context)
291 self.cpp_includes |= includes_for_type(attribute.data_type)
296 'cpp_type': cpp_type(attribute.data_type, pointer_type='RefPtr'),
297 'v8_type': v8_type(attribute.data_type),
326 cpp_to_js_conversion = self.generate_cpp_to_js_conversion(argument.data_type, argument.name, receiver, 'isolate', creation_context='v8::Handle<v8::Object>()')
334 return '%s %s' % (cpp_type(argument.data_type, 'raw'), argument.name)
340 if operation.data_type != 'boolean':
344 'return_cpp_type': cpp_type(operation.data_type, 'RefPtr'),