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

Unified Diff: client/dom/scripts/systemnative.py

Issue 9455090: Support optional callbacks. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressing Pavel's comments Created 8 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | client/dom/scripts/systemwrapping.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/dom/scripts/systemnative.py
diff --git a/client/dom/scripts/systemnative.py b/client/dom/scripts/systemnative.py
index 7e8116719f029427e71b41d2701330fb6224162c..29ff17875879f55e02a90c06eb982b85e2f02140 100644
--- a/client/dom/scripts/systemnative.py
+++ b/client/dom/scripts/systemnative.py
@@ -532,16 +532,6 @@ class NativeImplementationGenerator(systemwrapping.WrappingInterfaceGenerator):
if 'ImplementedBy' in operation.ext_attrs:
return
- for op in self._interface.operations:
- if op.id != operation.id or len(op.arguments) <= len(operation.arguments):
- continue
- next_argument = op.arguments[len(operation.arguments)]
- if next_argument.is_optional and 'Callback' in next_argument.ext_attrs:
- # FIXME: '[Optional, Callback]' arguments could be non-optional in
- # webcore. We need to fix overloads handling to generate native
- # callbacks properly.
- return
-
self._native_version += 1
native_name = info.name
if self._native_version > 1:
@@ -736,8 +726,9 @@ class NativeImplementationGenerator(systemwrapping.WrappingInterfaceGenerator):
if include_name:
self._cpp_impl_includes[include_name] = 1
flags = ''
- if idl_argument.ext_attrs.get('Optionial') == 'DefaultIsNullString':
- flags = ', DartUtilities::ConvertNullToEmptyString'
+ if (idl_argument.ext_attrs.get('Optionial') == 'DefaultIsNullString' or
+ ('Optional' in idl_argument.ext_attrs and 'Callback' in idl_argument.ext_attrs)):
+ flags = ', DartUtilities::ConvertNullToDefaultValue'
emitter.Emit(
'\n'
' const $ADAPTER_TYPE $NAME(Dart_GetNativeArgument(args, $INDEX)$FLAGS);\n'
« no previous file with comments | « no previous file | client/dom/scripts/systemwrapping.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698