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

Unified Diff: mojo/public/tools/bindings/generators/cpp_templates/interface_declaration.tmpl

Issue 265793015: Mojo: Replace RemotePtr with InterfacePtr and InterfaceImpl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 7 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/tools/bindings/generators/cpp_templates/interface_declaration.tmpl
diff --git a/mojo/public/tools/bindings/generators/cpp_templates/interface_declaration.tmpl b/mojo/public/tools/bindings/generators/cpp_templates/interface_declaration.tmpl
index 60fbfc52c7ea2ccec2278e1b09302cd8b053e083..d1c7e53b6b00e5ef3a91db7ff4745971fa609bad 100644
--- a/mojo/public/tools/bindings/generators/cpp_templates/interface_declaration.tmpl
+++ b/mojo/public/tools/bindings/generators/cpp_templates/interface_declaration.tmpl
@@ -1,18 +1,18 @@
{%- import "interface_macros.tmpl" as interface_macros %}
class {{interface.name}}Proxy;
class {{interface.name}}Stub;
-{% if interface.peer %}
-class {{interface.peer}};
+{% if interface.client %}
+class {{interface.client}};
{% endif %}
class {{interface.name}} {
public:
- typedef {{interface.name}}Proxy _Proxy;
- typedef {{interface.name}}Stub _Stub;
-{% if interface.peer %}
- typedef {{interface.peer}} _Peer;
+ typedef {{interface.name}}Proxy Proxy_;
+ typedef {{interface.name}}Stub Stub_;
+{% if interface.client %}
+ typedef {{interface.client}} Client_;
{% else %}
- typedef mojo::NoInterface _Peer;
+ typedef mojo::NoInterface Client_;
{% endif %}
{#--- Enums #}
@@ -22,6 +22,13 @@ class {{interface.name}} {
{%- endfor %}
{#--- Methods #}
+ virtual ~{{interface.name}}() {}
+{%- if interface.client %}
+ // Called once before any other method.
+ virtual void SetClient({{interface.client}}* client) = 0;
+{%- else %}
+ virtual void SetClient(mojo::NoInterface* client) {}
+{%- endif %}
{%- for method in interface.methods %}
virtual void {{method.name}}({{interface_macros.declare_request_params("", method)}}) = 0;
{%- endfor %}

Powered by Google App Engine
This is Rietveld 408576698