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

Unified Diff: sky/engine/bindings2/scripts/templates/methods_cpp.template

Issue 918333002: Add the c++ code part of bindings2/ (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Updated per earlier reviews Created 5 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 | « sky/engine/bindings2/scripts/templates/attributes_cpp.template ('k') | sky/engine/bindings2/snapshot.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/bindings2/scripts/templates/methods_cpp.template
diff --git a/sky/engine/bindings2/scripts/templates/methods_cpp.template b/sky/engine/bindings2/scripts/templates/methods_cpp.template
index 4946eb906ba16bc9f9bc88a09ff82f609af073f4..aac59cd3b93159251450096d09fee9866e659823 100644
--- a/sky/engine/bindings2/scripts/templates/methods_cpp.template
+++ b/sky/engine/bindings2/scripts/templates/methods_cpp.template
@@ -94,14 +94,14 @@ static void {{static_method_name(method.name, overload_index)}}(Dart_NativeArgum
{% if method.is_call_with_script_state %}
ScriptState* state = DartUtilities::currentScriptState();
if (!state) {
- exception = Dart_NewStringFromCString("Failed to retrieve a script state");
+ exception = ToDart("Failed to retrieve a script state");
goto fail;
}
{% endif %}
{% if method.is_call_with_execution_context %}
ExecutionContext* context = DOMDartState::CurrentDocument();
if (!context) {
- exception = Dart_NewStringFromCString("Failed to retrieve a context");
+ exception = ToDart("Failed to retrieve a context");
goto fail;
}
{% endif %}
@@ -318,14 +318,14 @@ static void {{static_method_name(constructor.name, overload_index)}}(Dart_Native
{% if is_constructor_call_with_execution_context %}
ExecutionContext* context = DOMDartState::CurrentDocument();
if (!context) {
- exception = Dart_NewStringFromCString("Failed to retrieve a context");
+ exception = ToDart("Failed to retrieve a context");
goto fail;
}
{% endif %}
{% if is_constructor_call_with_document or (constructor == named_constructor) %}
LocalDOMWindow* domWindow = DOMDartState::CurrentWindow();
if (!domWindow) {
- exception = Dart_NewStringFromCString("Failed to fetch domWindow");
+ exception = ToDart("Failed to fetch domWindow");
goto fail;
}
Document& document = *domWindow->document();
« no previous file with comments | « sky/engine/bindings2/scripts/templates/attributes_cpp.template ('k') | sky/engine/bindings2/snapshot.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698