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

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

Issue 13493010: Fix the build with WEB_AUDIO disabled. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 months 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 | Annotate | Revision Log
« no previous file with comments | « tools/dom/scripts/systemhtml.py ('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 the systems to generate 6 """This module provides shared functionality for the systems to generate
7 native binding from the IDL database.""" 7 native binding from the IDL database."""
8 8
9 import emitter 9 import emitter
10 import os 10 import os
11 from generator import * 11 from generator import *
12 from htmldartgenerator import * 12 from htmldartgenerator import *
13 from systemhtml import js_support_checks, GetCallbackInfo 13 from systemhtml import js_support_checks, GetCallbackInfo, HTML_LIBRARY_NAMES
14 14
15 class DartiumBackend(HtmlDartGenerator): 15 class DartiumBackend(HtmlDartGenerator):
16 """Generates Dart implementation for one DOM IDL interface.""" 16 """Generates Dart implementation for one DOM IDL interface."""
17 17
18 def __init__(self, interface, cpp_library_emitter, options): 18 def __init__(self, interface, cpp_library_emitter, options):
19 super(DartiumBackend, self).__init__(interface, options) 19 super(DartiumBackend, self).__init__(interface, options)
20 20
21 self._interface = interface 21 self._interface = interface
22 self._cpp_library_emitter = cpp_library_emitter 22 self._cpp_library_emitter = cpp_library_emitter
23 self._database = options.database 23 self._database = options.database
(...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after
868 return self._type_registry.TypeInfo(type_name) 868 return self._type_registry.TypeInfo(type_name)
869 869
870 def _DartType(self, type_name): 870 def _DartType(self, type_name):
871 return self._type_registry.DartType(type_name) 871 return self._type_registry.DartType(type_name)
872 872
873 873
874 class CPPLibraryEmitter(): 874 class CPPLibraryEmitter():
875 def __init__(self, emitters, cpp_sources_dir): 875 def __init__(self, emitters, cpp_sources_dir):
876 self._emitters = emitters 876 self._emitters = emitters
877 self._cpp_sources_dir = cpp_sources_dir 877 self._cpp_sources_dir = cpp_sources_dir
878 self._library_headers = {} 878 self._library_headers = dict((lib, []) for lib in HTML_LIBRARY_NAMES)
879 self._sources_list = [] 879 self._sources_list = []
880 880
881 def CreateHeaderEmitter(self, interface_name, library_name, is_callback=False) : 881 def CreateHeaderEmitter(self, interface_name, library_name, is_callback=False) :
882 path = os.path.join(self._cpp_sources_dir, 'Dart%s.h' % interface_name) 882 path = os.path.join(self._cpp_sources_dir, 'Dart%s.h' % interface_name)
883 if not is_callback: 883 if not is_callback:
884 if not library_name in self._library_headers: 884 if not library_name in self._library_headers:
Anton Muhin 2013/04/08 15:51:35 this probably should be simplified now.
podivilov 2013/04/09 12:09:23 Done.
885 self._library_headers[library_name] = [] 885 self._library_headers[library_name] = []
886 self._library_headers[library_name].append(path) 886 self._library_headers[library_name].append(path)
887 return self._emitters.FileEmitter(path) 887 return self._emitters.FileEmitter(path)
888 888
889 def CreateSourceEmitter(self, interface_name): 889 def CreateSourceEmitter(self, interface_name):
890 path = os.path.join(self._cpp_sources_dir, 'Dart%s.cpp' % interface_name) 890 path = os.path.join(self._cpp_sources_dir, 'Dart%s.cpp' % interface_name)
891 self._sources_list.append(path) 891 self._sources_list.append(path)
892 return self._emitters.FileEmitter(path) 892 return self._emitters.FileEmitter(path)
893 893
894 def EmitDerivedSources(self, template, output_dir): 894 def EmitDerivedSources(self, template, output_dir):
(...skipping 21 matching lines...) Expand all
916 ' if (Dart_NativeFunction func = $CLASS_NAME::resolver(name, argu mentCount))\n' 916 ' if (Dart_NativeFunction func = $CLASS_NAME::resolver(name, argu mentCount))\n'
917 ' return func;\n', 917 ' return func;\n',
918 CLASS_NAME=os.path.splitext(os.path.basename(path))[0]) 918 CLASS_NAME=os.path.splitext(os.path.basename(path))[0])
919 919
920 def _IsOptionalStringArgumentInInitEventMethod(interface, operation, argument): 920 def _IsOptionalStringArgumentInInitEventMethod(interface, operation, argument):
921 return ( 921 return (
922 interface.id.endswith('Event') and 922 interface.id.endswith('Event') and
923 operation.id.startswith('init') and 923 operation.id.startswith('init') and
924 argument.ext_attrs.get('Optional') == 'DefaultIsUndefined' and 924 argument.ext_attrs.get('Optional') == 'DefaultIsUndefined' and
925 argument.type.id == 'DOMString') 925 argument.type.id == 'DOMString')
OLDNEW
« no previous file with comments | « tools/dom/scripts/systemhtml.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698