| 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 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 'short': 'toInt16({arguments})', | 366 'short': 'toInt16({arguments})', |
| 367 'unsigned short': 'toUInt16({arguments})', | 367 'unsigned short': 'toUInt16({arguments})', |
| 368 'long': 'toInt32({arguments})', | 368 'long': 'toInt32({arguments})', |
| 369 'unsigned long': 'toUInt32({arguments})', | 369 'unsigned long': 'toUInt32({arguments})', |
| 370 'long long': 'toInt64({arguments})', | 370 'long long': 'toInt64({arguments})', |
| 371 'unsigned long long': 'toUInt64({arguments})', | 371 'unsigned long long': 'toUInt64({arguments})', |
| 372 # Interface types | 372 # Interface types |
| 373 'CompareHow': 'static_cast<Range::CompareHow>({v8_value}->Int32Value())', | 373 'CompareHow': 'static_cast<Range::CompareHow>({v8_value}->Int32Value())', |
| 374 'Dictionary': 'Dictionary({v8_value}, info.GetIsolate())', | 374 'Dictionary': 'Dictionary({v8_value}, info.GetIsolate())', |
| 375 'EventTarget': 'V8DOMWrapper::isDOMWrapper({v8_value}) ? toWrapperTypeInfo(v
8::Handle<v8::Object>::Cast({v8_value}))->toEventTarget(v8::Handle<v8::Object>::
Cast({v8_value})) : 0', | 375 'EventTarget': 'V8DOMWrapper::isDOMWrapper({v8_value}) ? toWrapperTypeInfo(v
8::Handle<v8::Object>::Cast({v8_value}))->toEventTarget(v8::Handle<v8::Object>::
Cast({v8_value})) : 0', |
| 376 'MediaQueryListListener': 'MediaQueryListListener::create(ScriptValue(Script
State::current(info.GetIsolate()), {v8_value}))', | 376 'MediaQueryListListener': 'MediaQueryListListener::create(ScriptState::curre
nt(info.GetIsolate()), ScriptValue(ScriptState::current(info.GetIsolate()), {v8_
value}))', |
| 377 'NodeFilter': 'toNodeFilter({v8_value}, info.Holder(), info.GetIsolate())', | 377 'NodeFilter': 'toNodeFilter({v8_value}, info.Holder(), ScriptState::current(
info.GetIsolate()))', |
| 378 'Promise': 'ScriptPromise(ScriptState::current(info.GetIsolate()), {v8_value
})', | 378 'Promise': 'ScriptPromise(ScriptState::current(info.GetIsolate()), {v8_value
})', |
| 379 'SerializedScriptValue': 'SerializedScriptValue::create({v8_value}, info.Get
Isolate())', | 379 'SerializedScriptValue': 'SerializedScriptValue::create({v8_value}, info.Get
Isolate())', |
| 380 'ScriptValue': 'ScriptValue(ScriptState::current(info.GetIsolate()), {v8_val
ue})', | 380 'ScriptValue': 'ScriptValue(ScriptState::current(info.GetIsolate()), {v8_val
ue})', |
| 381 'Window': 'toDOMWindow({v8_value}, info.GetIsolate())', | 381 'Window': 'toDOMWindow({v8_value}, info.GetIsolate())', |
| 382 'XPathNSResolver': 'toXPathNSResolver({v8_value}, info.GetIsolate())', | 382 'XPathNSResolver': 'toXPathNSResolver({v8_value}, info.GetIsolate())', |
| 383 } | 383 } |
| 384 | 384 |
| 385 | 385 |
| 386 def v8_value_to_cpp_value(idl_type, extended_attributes, v8_value, index): | 386 def v8_value_to_cpp_value(idl_type, extended_attributes, v8_value, index): |
| 387 # Composite types | 387 # Composite types |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 659 def cpp_value_to_v8_value(idl_type, cpp_value, isolate='info.GetIsolate()', crea
tion_context='', extended_attributes=None): | 659 def cpp_value_to_v8_value(idl_type, cpp_value, isolate='info.GetIsolate()', crea
tion_context='', extended_attributes=None): |
| 660 """Returns an expression that converts a C++ value to a V8 value.""" | 660 """Returns an expression that converts a C++ value to a V8 value.""" |
| 661 # the isolate parameter is needed for callback interfaces | 661 # the isolate parameter is needed for callback interfaces |
| 662 idl_type, cpp_value = preprocess_idl_type_and_value(idl_type, cpp_value, ext
ended_attributes) | 662 idl_type, cpp_value = preprocess_idl_type_and_value(idl_type, cpp_value, ext
ended_attributes) |
| 663 this_v8_conversion_type = idl_type.v8_conversion_type(extended_attributes) | 663 this_v8_conversion_type = idl_type.v8_conversion_type(extended_attributes) |
| 664 format_string = CPP_VALUE_TO_V8_VALUE[this_v8_conversion_type] | 664 format_string = CPP_VALUE_TO_V8_VALUE[this_v8_conversion_type] |
| 665 statement = format_string.format(cpp_value=cpp_value, isolate=isolate, creat
ion_context=creation_context) | 665 statement = format_string.format(cpp_value=cpp_value, isolate=isolate, creat
ion_context=creation_context) |
| 666 return statement | 666 return statement |
| 667 | 667 |
| 668 IdlType.cpp_value_to_v8_value = cpp_value_to_v8_value | 668 IdlType.cpp_value_to_v8_value = cpp_value_to_v8_value |
| OLD | NEW |