OLD | NEW |
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 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 'long': 'toInt32({arguments})', | 364 'long': 'toInt32({arguments})', |
365 'unsigned long': 'toUInt32({arguments})', | 365 'unsigned long': 'toUInt32({arguments})', |
366 'long long': 'toInt64({arguments})', | 366 'long long': 'toInt64({arguments})', |
367 'unsigned long long': 'toUInt64({arguments})', | 367 'unsigned long long': 'toUInt64({arguments})', |
368 # Interface types | 368 # Interface types |
369 'CompareHow': 'static_cast<Range::CompareHow>({v8_value}->Int32Value())', | 369 'CompareHow': 'static_cast<Range::CompareHow>({v8_value}->Int32Value())', |
370 'Dictionary': 'Dictionary({v8_value}, info.GetIsolate())', | 370 'Dictionary': 'Dictionary({v8_value}, info.GetIsolate())', |
371 'EventTarget': 'V8DOMWrapper::isDOMWrapper({v8_value}) ? toWrapperTypeInfo(v
8::Handle<v8::Object>::Cast({v8_value}))->toEventTarget(v8::Handle<v8::Object>::
Cast({v8_value})) : 0', | 371 'EventTarget': 'V8DOMWrapper::isDOMWrapper({v8_value}) ? toWrapperTypeInfo(v
8::Handle<v8::Object>::Cast({v8_value}))->toEventTarget(v8::Handle<v8::Object>::
Cast({v8_value})) : 0', |
372 'MediaQueryListListener': 'MediaQueryListListener::create(ScriptValue(Script
State::current(info.GetIsolate()), {v8_value}))', | 372 'MediaQueryListListener': 'MediaQueryListListener::create(ScriptValue(Script
State::current(info.GetIsolate()), {v8_value}))', |
373 'NodeFilter': 'toNodeFilter({v8_value}, info.GetIsolate())', | 373 'NodeFilter': 'toNodeFilter({v8_value}, info.GetIsolate())', |
374 'Promise': 'ScriptPromise({v8_value}, info.GetIsolate())', | 374 'Promise': 'ScriptPromise(ScriptState::current(info.GetIsolate()), {v8_value
})', |
375 'SerializedScriptValue': 'SerializedScriptValue::create({v8_value}, info.Get
Isolate())', | 375 'SerializedScriptValue': 'SerializedScriptValue::create({v8_value}, info.Get
Isolate())', |
376 'ScriptValue': 'ScriptValue(ScriptState::current(info.GetIsolate()), {v8_val
ue})', | 376 'ScriptValue': 'ScriptValue(ScriptState::current(info.GetIsolate()), {v8_val
ue})', |
377 'Window': 'toDOMWindow({v8_value}, info.GetIsolate())', | 377 'Window': 'toDOMWindow({v8_value}, info.GetIsolate())', |
378 'XPathNSResolver': 'toXPathNSResolver({v8_value}, info.GetIsolate())', | 378 'XPathNSResolver': 'toXPathNSResolver({v8_value}, info.GetIsolate())', |
379 } | 379 } |
380 | 380 |
381 | 381 |
382 def v8_value_to_cpp_value(idl_type, extended_attributes, v8_value, index): | 382 def v8_value_to_cpp_value(idl_type, extended_attributes, v8_value, index): |
383 # Composite types | 383 # Composite types |
384 array_or_sequence_type = idl_type.array_or_sequence_type | 384 array_or_sequence_type = idl_type.array_or_sequence_type |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
641 def cpp_value_to_v8_value(idl_type, cpp_value, isolate='info.GetIsolate()', crea
tion_context='', extended_attributes=None): | 641 def cpp_value_to_v8_value(idl_type, cpp_value, isolate='info.GetIsolate()', crea
tion_context='', extended_attributes=None): |
642 """Returns an expression that converts a C++ value to a V8 value.""" | 642 """Returns an expression that converts a C++ value to a V8 value.""" |
643 # the isolate parameter is needed for callback interfaces | 643 # the isolate parameter is needed for callback interfaces |
644 idl_type, cpp_value = preprocess_idl_type_and_value(idl_type, cpp_value, ext
ended_attributes) | 644 idl_type, cpp_value = preprocess_idl_type_and_value(idl_type, cpp_value, ext
ended_attributes) |
645 this_v8_conversion_type = idl_type.v8_conversion_type(extended_attributes) | 645 this_v8_conversion_type = idl_type.v8_conversion_type(extended_attributes) |
646 format_string = CPP_VALUE_TO_V8_VALUE[this_v8_conversion_type] | 646 format_string = CPP_VALUE_TO_V8_VALUE[this_v8_conversion_type] |
647 statement = format_string.format(cpp_value=cpp_value, isolate=isolate, creat
ion_context=creation_context) | 647 statement = format_string.format(cpp_value=cpp_value, isolate=isolate, creat
ion_context=creation_context) |
648 return statement | 648 return statement |
649 | 649 |
650 IdlType.cpp_value_to_v8_value = cpp_value_to_v8_value | 650 IdlType.cpp_value_to_v8_value = cpp_value_to_v8_value |
OLD | NEW |