| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 2 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 3 # for details. All rights reserved. Use of this source code is governed by a | 3 # for details. All rights reserved. Use of this source code is governed by a |
| 4 # BSD-style license that can be found in the LICENSE file. | 4 # BSD-style license that can be found in the LICENSE file. |
| 5 | 5 |
| 6 """This module provides shared functionality for systems to generate | 6 """This module provides shared functionality for systems to generate |
| 7 Dart APIs from the IDL database.""" | 7 Dart APIs from the IDL database.""" |
| 8 | 8 |
| 9 import copy | 9 import copy |
| 10 import json | 10 import json |
| (...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 484 'DOMWindow get': | 484 'DOMWindow get': |
| 485 Conversion('_convertNativeToDart_Window', 'dynamic', 'WindowBase'), | 485 Conversion('_convertNativeToDart_Window', 'dynamic', 'WindowBase'), |
| 486 'EventTarget get': | 486 'EventTarget get': |
| 487 Conversion('_convertNativeToDart_EventTarget', 'dynamic', | 487 Conversion('_convertNativeToDart_EventTarget', 'dynamic', |
| 488 'EventTarget'), | 488 'EventTarget'), |
| 489 'EventTarget set': | 489 'EventTarget set': |
| 490 Conversion('_convertDartToNative_EventTarget', 'EventTarget', | 490 Conversion('_convertDartToNative_EventTarget', 'EventTarget', |
| 491 'dynamic'), | 491 'dynamic'), |
| 492 | 492 |
| 493 'ImageData get': | 493 'ImageData get': |
| 494 Conversion('_convertNativeToDart_ImageData', 'dynamic', 'ImageData'), | 494 Conversion('convertNativeToDart_ImageData', 'dynamic', 'ImageData'), |
| 495 'ImageData set': | 495 'ImageData set': |
| 496 Conversion('_convertDartToNative_ImageData', 'ImageData', 'dynamic'), | 496 Conversion('convertDartToNative_ImageData', 'ImageData', 'dynamic'), |
| 497 | 497 |
| 498 'Dictionary get': | 498 'Dictionary get': |
| 499 Conversion('convertNativeToDart_Dictionary', 'dynamic', 'Map'), | 499 Conversion('convertNativeToDart_Dictionary', 'dynamic', 'Map'), |
| 500 'Dictionary set': | 500 'Dictionary set': |
| 501 Conversion('convertDartToNative_Dictionary', 'Map', 'dynamic'), | 501 Conversion('convertDartToNative_Dictionary', 'Map', 'dynamic'), |
| 502 | 502 |
| 503 'sequence<DOMString> set': | 503 'sequence<DOMString> set': |
| 504 Conversion('convertDartToNative_StringArray', 'List<String>', 'List'), | 504 Conversion('convertDartToNative_StringArray', 'List<String>', 'List'), |
| 505 | 505 |
| 506 'any set IDBObjectStore.add': _serialize_SSV, | 506 'any set IDBObjectStore.add': _serialize_SSV, |
| 507 'any set IDBObjectStore.put': _serialize_SSV, | 507 'any set IDBObjectStore.put': _serialize_SSV, |
| 508 'any set IDBCursor.update': _serialize_SSV, | 508 'any set IDBCursor.update': _serialize_SSV, |
| 509 | 509 |
| 510 # postMessage | 510 # postMessage |
| 511 'any set MessagePort.postMessage': _serialize_SSV, | 511 'any set MessagePort.postMessage': _serialize_SSV, |
| 512 'SerializedScriptValue set DOMWindow.postMessage': _serialize_SSV, | 512 'SerializedScriptValue set DOMWindow.postMessage': _serialize_SSV, |
| 513 | 513 |
| 514 # receiving message via MessageEvent | 514 # receiving message via MessageEvent |
| 515 '* get MessageEvent.data': | 515 '* get MessageEvent.data': |
| 516 Conversion('convertNativeToDart_SerializedScriptValue', | 516 Conversion('convertNativeToDart_SerializedScriptValue', |
| 517 'dynamic', 'dynamic'), | 517 'dynamic', 'dynamic'), |
| 518 | 518 |
| 519 '* get History.state': | 519 '* get History.state': |
| 520 Conversion('_convertNativeToDart_SerializedScriptValue', | 520 Conversion('convertNativeToDart_SerializedScriptValue', |
| 521 'dynamic', 'dynamic'), | 521 'dynamic', 'dynamic'), |
| 522 | 522 |
| 523 '* get PopStateEvent.state': | 523 '* get PopStateEvent.state': |
| 524 Conversion('convertNativeToDart_SerializedScriptValue', | 524 Conversion('convertNativeToDart_SerializedScriptValue', |
| 525 'dynamic', 'dynamic'), | 525 'dynamic', 'dynamic'), |
| 526 | 526 |
| 527 # IDBAny is problematic. Some uses are just a union of other IDB types, | 527 # IDBAny is problematic. Some uses are just a union of other IDB types, |
| 528 # which need no conversion.. Others include data values which require | 528 # which need no conversion.. Others include data values which require |
| 529 # serialized script value processing. | 529 # serialized script value processing. |
| 530 '* get IDBCursorWithValue.value': | 530 '* get IDBCursorWithValue.value': |
| (...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1141 type_name, type_data, dart_interface_name, self) | 1141 type_name, type_data, dart_interface_name, self) |
| 1142 | 1142 |
| 1143 if type_data.clazz == 'BasicTypedList': | 1143 if type_data.clazz == 'BasicTypedList': |
| 1144 dart_interface_name = self._renamer.RenameInterface( | 1144 dart_interface_name = self._renamer.RenameInterface( |
| 1145 self._database.GetInterface(type_name)) | 1145 self._database.GetInterface(type_name)) |
| 1146 return BasicTypedListIDLTypeInfo( | 1146 return BasicTypedListIDLTypeInfo( |
| 1147 type_name, type_data, dart_interface_name, self) | 1147 type_name, type_data, dart_interface_name, self) |
| 1148 | 1148 |
| 1149 class_name = '%sIDLTypeInfo' % type_data.clazz | 1149 class_name = '%sIDLTypeInfo' % type_data.clazz |
| 1150 return globals()[class_name](type_name, type_data) | 1150 return globals()[class_name](type_name, type_data) |
| OLD | NEW |