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

Unified Diff: sky/engine/bindings/scripts/code_generator_dart.py

Issue 1171743002: Change the way we provide custom dart code for IDL bindings. (Closed) Base URL: git@github.com:/domokit/mojo.git@master
Patch Set: Created 5 years, 6 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
Index: sky/engine/bindings/scripts/code_generator_dart.py
diff --git a/sky/engine/bindings/scripts/code_generator_dart.py b/sky/engine/bindings/scripts/code_generator_dart.py
index 9ebc3c78e6f3839a2b0c33bed660d272014fadfc..c666d0b756c83eece5692d822f04fd8bedf77bed 100644
--- a/sky/engine/bindings/scripts/code_generator_dart.py
+++ b/sky/engine/bindings/scripts/code_generator_dart.py
@@ -149,14 +149,10 @@ class CodeGeneratorDart(object):
template_contents['cpp_includes'] = sorted(includes)
- # If CustomDart is set, read the custom dart file and add it to our
+ # If PrivateDart is set, read the custom dart file and add it to our
# template parameters.
- if 'CustomDart' in interface.extended_attributes:
- dart_filename = os.path.join(os.path.dirname(idl_filename),
- interface.name + ".dart")
- with open(dart_filename) as dart_file:
- custom_dartcode = dart_file.read()
- template_contents['custom_dartcode'] = custom_dartcode
+ if 'PrivateDart' in interface.extended_attributes:
+ template_contents['private_dart'] = True
idl_world = {'interface': None, 'callback': None}
@@ -201,7 +197,7 @@ class CodeGeneratorDart(object):
# Special case: any .dart files in the list should be added
# to dart_sky.dart directly, but don't need to be processed.
interface_name = os.path.splitext(os.path.basename(filename))[0]
- world['interfaces'].append({'name': interface_name})
+ world['interfaces'].append({'name': "Custom" + interface_name})
continue
interface_name = idl_filename_to_interface_name(filename)
idl_pickle_filename = interface_name + "_globals.pickle"

Powered by Google App Engine
This is Rietveld 408576698