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

Side by Side Diff: tools/dom/scripts/generator.py

Issue 1490763005: Add the right type conversions for various postMessage methods (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 704 matching lines...) Expand 10 before | Expand all | Expand 10 after
715 'sequence<DOMString> set': 715 'sequence<DOMString> set':
716 Conversion('convertDartToNative_StringArray', 'List<String>', 'List'), 716 Conversion('convertDartToNative_StringArray', 'List<String>', 'List'),
717 717
718 'any set IDBObjectStore.add': _serialize_SSV, 718 'any set IDBObjectStore.add': _serialize_SSV,
719 'any set IDBObjectStore.put': _serialize_SSV, 719 'any set IDBObjectStore.put': _serialize_SSV,
720 'any set IDBCursor.update': _serialize_SSV, 720 'any set IDBCursor.update': _serialize_SSV,
721 721
722 # postMessage 722 # postMessage
723 'any set MessagePort.postMessage': _serialize_SSV, 723 'any set MessagePort.postMessage': _serialize_SSV,
724 'SerializedScriptValue set Window.postMessage': _serialize_SSV, 724 'SerializedScriptValue set Window.postMessage': _serialize_SSV,
725 'SerializedScriptValue set Worker.postMessage': _serialize_SSV,
726 'any set DedicatedWorkerGlobalScope.postMessage' : _serialize_SSV,
727 'SerializedScriptValue set ServiceWorkerClient.postMessage': _serialize_SSV,
725 728
726 '* get CustomEvent.detail': 729 '* get CustomEvent.detail':
727 Conversion('convertNativeToDart_SerializedScriptValue', 730 Conversion('convertNativeToDart_SerializedScriptValue',
728 'dynamic', 'dynamic'), 731 'dynamic', 'dynamic'),
729 732
730 # receiving message via MessageEvent 733 # receiving message via MessageEvent
731 '* get MessageEvent.data': 734 '* get MessageEvent.data':
732 Conversion('convertNativeToDart_SerializedScriptValue', 735 Conversion('convertNativeToDart_SerializedScriptValue',
733 'dynamic', 'dynamic'), 736 'dynamic', 'dynamic'),
734 737
(...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after
1463 return_type == 'Rectangle') 1466 return_type == 'Rectangle')
1464 1467
1465 def wrap_return_type_blink(return_type, type_name, type_registry): 1468 def wrap_return_type_blink(return_type, type_name, type_registry):
1466 """Returns True if we should wrap the returned value. This checks 1469 """Returns True if we should wrap the returned value. This checks
1467 a number of different variations, calling the more basic functions 1470 a number of different variations, calling the more basic functions
1468 above.""" 1471 above."""
1469 return (wrap_unwrap_type_blink(return_type, type_registry) or 1472 return (wrap_unwrap_type_blink(return_type, type_registry) or
1470 wrap_unwrap_type_blink(type_name, type_registry) or 1473 wrap_unwrap_type_blink(type_name, type_registry) or
1471 wrap_type_blink(return_type, type_registry) or 1474 wrap_type_blink(return_type, type_registry) or
1472 wrap_unwrap_list_blink(return_type, type_registry)) 1475 wrap_unwrap_list_blink(return_type, type_registry))
OLDNEW
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698