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

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

Issue 70453002: Don't write generated C++ bindings twice, only once. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 1 month 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/logging.conf ('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
(...skipping 1213 matching lines...) Expand 10 before | Expand all | Expand 10 after
1224 e.Emit(' bool is_node;\n'); 1224 e.Emit(' bool is_node;\n');
1225 e.Emit(' bool is_active;\n'); 1225 e.Emit(' bool is_active;\n');
1226 e.Emit(' bool is_event;\n'); 1226 e.Emit(' bool is_event;\n');
1227 e.Emit('} _Classinfo;\n'); 1227 e.Emit('} _Classinfo;\n');
1228 e.Emit('typedef _Classinfo _DartWebkitClassInfo[NumWebkitClassIds];\n'); 1228 e.Emit('typedef _Classinfo _DartWebkitClassInfo[NumWebkitClassIds];\n');
1229 e.Emit('\n'); 1229 e.Emit('\n');
1230 e.Emit('extern _DartWebkitClassInfo DartWebkitClassInfo;\n'); 1230 e.Emit('extern _DartWebkitClassInfo DartWebkitClassInfo;\n');
1231 e.Emit('\n'); 1231 e.Emit('\n');
1232 e.Emit('} // namespace WebCore\n'); 1232 e.Emit('} // namespace WebCore\n');
1233 e.Emit('#endif // DartWebkitClassIds_h\n'); 1233 e.Emit('#endif // DartWebkitClassIds_h\n');
1234 self._emitters.Flush()
1235 1234
1236 path = os.path.join(output_dir, 'DartWebkitClassIds.cpp') 1235 path = os.path.join(output_dir, 'DartWebkitClassIds.cpp')
1237 e = self._emitters.FileEmitter(path) 1236 e = self._emitters.FileEmitter(path)
1238 e.Emit('// Copyright (c) 2013, the Dart project authors. Please see the AUT HORS file\n'); 1237 e.Emit('// Copyright (c) 2013, the Dart project authors. Please see the AUT HORS file\n');
1239 e.Emit('// for details. All rights reserved. Use of this source code is gove rned by a\n'); 1238 e.Emit('// for details. All rights reserved. Use of this source code is gove rned by a\n');
1240 e.Emit('// BSD-style license that can be found in the LICENSE file.\n'); 1239 e.Emit('// BSD-style license that can be found in the LICENSE file.\n');
1241 e.Emit('// WARNING: Do not edit - generated code.\n'); 1240 e.Emit('// WARNING: Do not edit - generated code.\n');
1242 e.Emit('// See dart/tools/dom/scripts/systemnative.py\n'); 1241 e.Emit('// See dart/tools/dom/scripts/systemnative.py\n');
1243 e.Emit('\n'); 1242 e.Emit('\n');
1244 e.Emit('#include "DartWebkitClassIds.h"\n'); 1243 e.Emit('#include "DartWebkitClassIds.h"\n');
(...skipping 29 matching lines...) Expand all
1274 e.Emit(' %sClassId,\n' % supertype) 1273 e.Emit(' %sClassId,\n' % supertype)
1275 else: 1274 else:
1276 e.Emit(' -1,') 1275 e.Emit(' -1,')
1277 e.Emit(" %s," % TypeCheckHelper(is_node_test)) 1276 e.Emit(" %s," % TypeCheckHelper(is_node_test))
1278 e.Emit(" %s," % TypeCheckHelper(is_active_test)) 1277 e.Emit(" %s," % TypeCheckHelper(is_active_test))
1279 e.Emit(" %s," % TypeCheckHelper(is_event_target_test)) 1278 e.Emit(" %s," % TypeCheckHelper(is_event_target_test))
1280 e.Emit(" },\n") 1279 e.Emit(" },\n")
1281 e.Emit("};\n"); 1280 e.Emit("};\n");
1282 e.Emit('\n'); 1281 e.Emit('\n');
1283 e.Emit('} // namespace WebCore\n'); 1282 e.Emit('} // namespace WebCore\n');
1284 self._emitters.Flush()
1285 1283
1286 def _IsOptionalStringArgumentInInitEventMethod(interface, operation, argument): 1284 def _IsOptionalStringArgumentInInitEventMethod(interface, operation, argument):
1287 return ( 1285 return (
1288 interface.id.endswith('Event') and 1286 interface.id.endswith('Event') and
1289 operation.id.startswith('init') and 1287 operation.id.startswith('init') and
1290 argument.ext_attrs.get('Default') == 'Undefined' and 1288 argument.ext_attrs.get('Default') == 'Undefined' and
1291 argument.type.id == 'DOMString') 1289 argument.type.id == 'DOMString')
OLDNEW
« no previous file with comments | « tools/dom/scripts/logging.conf ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698