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

Unified Diff: mojo/public/cpp/bindings/binding.h

Issue 1524693002: [mojo] Add GenericInterface_ to interface class variants (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bindings-2-typemaps
Patch Set: merge Created 5 years 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 | « mojo/public/cpp/bindings/associated_interface_ptr.h ('k') | mojo/public/cpp/bindings/interface_ptr.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/bindings/binding.h
diff --git a/mojo/public/cpp/bindings/binding.h b/mojo/public/cpp/bindings/binding.h
index 09cdb88e77b4ebb4b6d3063b95df0a4b2d6ba7ff..a15536c56a84689ee4c7e2450976afb4f1c682a0 100644
--- a/mojo/public/cpp/bindings/binding.h
+++ b/mojo/public/cpp/bindings/binding.h
@@ -59,6 +59,8 @@ class AssociatedGroup;
template <typename Interface>
class Binding {
public:
+ using GenericInterface = typename Interface::GenericInterface;
+
// Constructs an incomplete binding that will use the implementation |impl|.
// The binding may be completed with a subsequent call to the |Bind| method.
// Does not take ownership of |impl|, which must outlive the binding.
@@ -92,7 +94,7 @@ class Binding {
// |impl|, which must outlive the binding. See class comment for definition of
// |waiter|.
Binding(Interface* impl,
- InterfaceRequest<Interface> request,
+ InterfaceRequest<GenericInterface> request,
const MojoAsyncWaiter* waiter = Environment::GetDefaultAsyncWaiter())
: Binding(impl) {
Bind(request.PassMessagePipe(), waiter);
@@ -132,7 +134,7 @@ class Binding {
// binding it to the previously specified implementation. See class comment
// for definition of |waiter|.
void Bind(
- InterfaceRequest<Interface> request,
+ InterfaceRequest<GenericInterface> request,
const MojoAsyncWaiter* waiter = Environment::GetDefaultAsyncWaiter()) {
Bind(request.PassMessagePipe(), waiter);
}
@@ -186,7 +188,7 @@ class Binding {
// on to associated interface endpoint handles at both sides of the
// message pipe in order to call this method. We need a way to forcefully
// invalidate associated interface endpoint handles.
- InterfaceRequest<Interface> Unbind() {
+ InterfaceRequest<GenericInterface> Unbind() {
CHECK(!HasAssociatedInterfaces());
return internal_state_.Unbind();
}
« no previous file with comments | « mojo/public/cpp/bindings/associated_interface_ptr.h ('k') | mojo/public/cpp/bindings/interface_ptr.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698