Index: mojo/public/cpp/bindings/lib/interface_ptr_state.h |
diff --git a/mojo/public/cpp/bindings/lib/interface_ptr_state.h b/mojo/public/cpp/bindings/lib/interface_ptr_state.h |
index 8b8d6706fd47560848d3da0be0715c7cf886e389..d203031819b2a96fd6ce6724529d78b8788e4ce3 100644 |
--- a/mojo/public/cpp/bindings/lib/interface_ptr_state.h |
+++ b/mojo/public/cpp/bindings/lib/interface_ptr_state.h |
@@ -38,6 +38,8 @@ class InterfacePtrState; |
template <typename Interface> |
class InterfacePtrState<Interface, false> { |
public: |
+ using GenericInterface = typename Interface::GenericInterface; |
+ |
InterfacePtrState() |
: proxy_(nullptr), router_(nullptr), waiter_(nullptr), version_(0u) {} |
@@ -94,7 +96,8 @@ class InterfacePtrState<Interface, false> { |
swap(other->version_, version_); |
} |
- void Bind(InterfacePtrInfo<Interface> info, const MojoAsyncWaiter* waiter) { |
+ void Bind(InterfacePtrInfo<GenericInterface> info, |
+ const MojoAsyncWaiter* waiter) { |
DCHECK(!proxy_); |
DCHECK(!router_); |
DCHECK(!handle_.is_valid()); |
@@ -118,8 +121,8 @@ class InterfacePtrState<Interface, false> { |
// After this method is called, the object is in an invalid state and |
// shouldn't be reused. |
- InterfacePtrInfo<Interface> PassInterface() { |
- return InterfacePtrInfo<Interface>( |
+ InterfacePtrInfo<GenericInterface> PassInterface() { |
+ return InterfacePtrInfo<GenericInterface>( |
router_ ? router_->PassMessagePipe() : handle_.Pass(), version_); |
} |
@@ -192,6 +195,8 @@ class InterfacePtrState<Interface, false> { |
template <typename Interface> |
class InterfacePtrState<Interface, true> { |
public: |
+ using GenericInterface = typename Interface::GenericInterface; |
+ |
InterfacePtrState() : waiter_(nullptr), version_(0u) {} |
~InterfacePtrState() { |
@@ -248,7 +253,8 @@ class InterfacePtrState<Interface, true> { |
swap(other->version_, version_); |
} |
- void Bind(InterfacePtrInfo<Interface> info, const MojoAsyncWaiter* waiter) { |
+ void Bind(InterfacePtrInfo<GenericInterface> info, |
+ const MojoAsyncWaiter* waiter) { |
DCHECK(!router_); |
DCHECK(!endpoint_client_); |
DCHECK(!proxy_); |
@@ -275,10 +281,10 @@ class InterfacePtrState<Interface, true> { |
// After this method is called, the object is in an invalid state and |
// shouldn't be reused. |
- InterfacePtrInfo<Interface> PassInterface() { |
+ InterfacePtrInfo<GenericInterface> PassInterface() { |
endpoint_client_.reset(); |
proxy_.reset(); |
- return InterfacePtrInfo<Interface>( |
+ return InterfacePtrInfo<GenericInterface>( |
router_ ? router_->PassMessagePipe() : handle_.Pass(), version_); |
} |