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

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

Issue 12036013: Initial work on ImageData.data. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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
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 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 IS_EVENT_TARGET=TypeCheckHelper(is_event_target_test), 273 IS_EVENT_TARGET=TypeCheckHelper(is_event_target_test),
274 TO_NATIVE=to_native_emitter.Fragments(), 274 TO_NATIVE=to_native_emitter.Fragments(),
275 TO_DART=to_dart_emitter.Fragments()) 275 TO_DART=to_dart_emitter.Fragments())
276 276
277 def EmitAttribute(self, attribute, html_name, read_only): 277 def EmitAttribute(self, attribute, html_name, read_only):
278 self._AddGetter(attribute, html_name) 278 self._AddGetter(attribute, html_name)
279 if not read_only: 279 if not read_only:
280 self._AddSetter(attribute, html_name) 280 self._AddSetter(attribute, html_name)
281 281
282 def _AddGetter(self, attr, html_name): 282 def _AddGetter(self, attr, html_name):
283 if self._interface.id == 'ImageData' and html_name == 'data':
blois 2013/01/22 17:10:44 Add a comment for this?
Anton Muhin 2013/01/23 08:38:21 Done.
284 html_name = '_data'
283 type_info = self._TypeInfo(attr.type.id) 285 type_info = self._TypeInfo(attr.type.id)
284 dart_declaration = '%s get %s' % ( 286 dart_declaration = '%s get %s' % (
285 self.SecureOutputType(attr.type.id), html_name) 287 self.SecureOutputType(attr.type.id), html_name)
286 is_custom = 'Custom' in attr.ext_attrs or 'CustomGetter' in attr.ext_attrs 288 is_custom = 'Custom' in attr.ext_attrs or 'CustomGetter' in attr.ext_attrs
287 cpp_callback_name = self._GenerateNativeBinding(attr.id, 1, 289 cpp_callback_name = self._GenerateNativeBinding(attr.id, 1,
288 dart_declaration, 'Getter', is_custom) 290 dart_declaration, 'Getter', is_custom)
289 if is_custom: 291 if is_custom:
290 return 292 return
291 293
292 if 'Reflect' in attr.ext_attrs: 294 if 'Reflect' in attr.ext_attrs:
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after
868 LIBRARY_NAME=library_name) 870 LIBRARY_NAME=library_name)
869 871
870 headers = self._library_headers[library_name] 872 headers = self._library_headers[library_name]
871 for header_file in headers: 873 for header_file in headers:
872 path = os.path.relpath(header_file, output_dir) 874 path = os.path.relpath(header_file, output_dir)
873 includes_emitter.Emit('#include "$PATH"\n', PATH=path) 875 includes_emitter.Emit('#include "$PATH"\n', PATH=path)
874 body_emitter.Emit( 876 body_emitter.Emit(
875 ' if (Dart_NativeFunction func = $CLASS_NAME::resolver(name, argu mentCount))\n' 877 ' if (Dart_NativeFunction func = $CLASS_NAME::resolver(name, argu mentCount))\n'
876 ' return func;\n', 878 ' return func;\n',
877 CLASS_NAME=os.path.splitext(os.path.basename(path))[0]) 879 CLASS_NAME=os.path.splitext(os.path.basename(path))[0])
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698