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

Unified Diff: mojo/public/bindings/generators/cpp_templates/interface_definition.tmpl

Issue 109103003: Mojo: abstract interface implementation from generated Stub classes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase + fix build Created 6 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 side-by-side diff with in-line comments
Download patch
Index: mojo/public/bindings/generators/cpp_templates/interface_definition.tmpl
diff --git a/mojo/public/bindings/generators/cpp_templates/interface_definition.tmpl b/mojo/public/bindings/generators/cpp_templates/interface_definition.tmpl
index 3ca8b4678dae594c1d42e304170c28ae9fcb75bf..9885a365109ea56d44d5a50e76a48e7984de35c8 100644
--- a/mojo/public/bindings/generators/cpp_templates/interface_definition.tmpl
+++ b/mojo/public/bindings/generators/cpp_templates/interface_definition.tmpl
@@ -55,6 +55,10 @@ void {{proxy_name}}::{{method.name}}({{params_list(method)}}) {
}
{%- endfor %}
+{{class_name}}Stub::{{class_name}}Stub({{class_name}}* sink)
+ : sink_(sink) {
+}
+
{#--- Stub definition #}
{%- macro params(method) %}
{%- for param in method.parameters %}
@@ -79,7 +83,7 @@ bool {{class_name}}Stub::Accept(mojo::Message* message) {
if (!mojo::internal::DecodePointersAndHandles(params, message))
return false;
- {{method.name}}({{params(method)}});
+ sink_->{{method.name}}({{params(method)}});
mojo::internal::CloseHandles(params);
break;
}
« no previous file with comments | « mojo/examples/sample_app/sample_app.cc ('k') | mojo/public/bindings/generators/cpp_templates/interface_stub_declaration.tmpl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698