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

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

Issue 10810055: WebKit recently has been changed to pass context as 1st argument. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 5 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 | « no previous file | 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 921 matching lines...) Expand 10 before | Expand all | Expand 10 after
932 invocation_template = emitter.Format( 932 invocation_template = emitter.Format(
933 ' ExceptionCode ec = 0;\n' 933 ' ExceptionCode ec = 0;\n'
934 '$INVOCATION' 934 '$INVOCATION'
935 ' if (UNLIKELY(ec)) {\n' 935 ' if (UNLIKELY(ec)) {\n'
936 ' exception = DartDOMWrapper::exceptionCodeToDartException( ec);\n' 936 ' exception = DartDOMWrapper::exceptionCodeToDartException( ec);\n'
937 ' goto fail;\n' 937 ' goto fail;\n'
938 ' }\n', 938 ' }\n',
939 INVOCATION=invocation_template) 939 INVOCATION=invocation_template)
940 940
941 if 'ImplementedBy' in attributes: 941 if 'ImplementedBy' in attributes:
942 arguments.insert(0, 'receiver') 942 # FIXME: rather ugly way to solve the problem.
943 index = 1 if 'ScriptExecutionContext' == attributes.get('CallWith') else 0
944 arguments.insert(index, 'receiver')
943 self._cpp_impl_includes.add('"%s.h"' % attributes['ImplementedBy']) 945 self._cpp_impl_includes.add('"%s.h"' % attributes['ImplementedBy'])
944 946
945 return emitter.Format(invocation_template, 947 return emitter.Format(invocation_template,
946 FUNCTION_CALL='%s(%s)' % (function_expression, ', '.join(arguments))) 948 FUNCTION_CALL='%s(%s)' % (function_expression, ', '.join(arguments)))
947 949
948 def _TypeInfo(self, type_name): 950 def _TypeInfo(self, type_name):
949 return self._system._type_registry.TypeInfo(type_name) 951 return self._system._type_registry.TypeInfo(type_name)
950 952
951 953
952 def _GenerateCPPIncludes(includes): 954 def _GenerateCPPIncludes(includes):
(...skipping 13 matching lines...) Expand all
966 968
967 def _IsArgumentOptionalInWebCore(argument): 969 def _IsArgumentOptionalInWebCore(argument):
968 return IsOptional(argument) and not 'Callback' in argument.ext_attrs 970 return IsOptional(argument) and not 'Callback' in argument.ext_attrs
969 971
970 def _ToWebKitName(name): 972 def _ToWebKitName(name):
971 name = name[0].lower() + name[1:] 973 name = name[0].lower() + name[1:]
972 name = re.sub(r'^(hTML|uRL|jS|xML|xSLT)', lambda s: s.group(1).lower(), 974 name = re.sub(r'^(hTML|uRL|jS|xML|xSLT)', lambda s: s.group(1).lower(),
973 name) 975 name)
974 return re.sub(r'^(create|exclusive)', lambda s: 'is' + s.group(1).capitalize() , 976 return re.sub(r'^(create|exclusive)', lambda s: 'is' + s.group(1).capitalize() ,
975 name) 977 name)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698