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

Unified Diff: mojo/public/cpp/bindings/associated_interface_ptr.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_group.h ('k') | mojo/public/cpp/bindings/binding.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/bindings/associated_interface_ptr.h
diff --git a/mojo/public/cpp/bindings/associated_interface_ptr.h b/mojo/public/cpp/bindings/associated_interface_ptr.h
index 15c12ce7ec9a38d55992dfd95606d1823dd298ff..9122688a7cbe4a6e1f7cc29db078d2e40aebd628 100644
--- a/mojo/public/cpp/bindings/associated_interface_ptr.h
+++ b/mojo/public/cpp/bindings/associated_interface_ptr.h
@@ -22,6 +22,8 @@ class AssociatedInterfacePtr {
DISALLOW_COPY_AND_ASSIGN_WITH_MOVE_FOR_BIND(AssociatedInterfacePtr)
public:
+ using GenericInterface = typename Interface::GenericInterface;
+
// Constructs an unbound AssociatedInterfacePtr.
AssociatedInterfacePtr() {}
AssociatedInterfacePtr(decltype(nullptr)) {}
@@ -52,7 +54,7 @@ class AssociatedInterfacePtr {
// NOTE: Please see the comments of
// AssociatedGroup.CreateAssociatedInterface() about when you can use this
// object to make calls.
- void Bind(AssociatedInterfacePtrInfo<Interface> info) {
+ void Bind(AssociatedInterfacePtrInfo<GenericInterface> info) {
reset();
bool is_local =
@@ -120,7 +122,7 @@ class AssociatedInterfacePtr {
// It is an error to call PassInterface() while there are pending responses.
// TODO: fix this restriction, it's not always obvious when there is a
// pending response.
- AssociatedInterfacePtrInfo<Interface> PassInterface() {
+ AssociatedInterfacePtrInfo<GenericInterface> PassInterface() {
DCHECK(!internal_state_.has_pending_callbacks());
State state;
internal_state_.Swap(&state);
@@ -173,11 +175,11 @@ class AssociatedInterfacePtr {
// as soon as the request is sent, |ptr| is usable. There is no need to wait
// until the request is bound to an implementation at the remote side.
template <typename Interface>
-AssociatedInterfaceRequest<Interface> GetProxy(
+AssociatedInterfaceRequest<typename Interface::GenericInterface> GetProxy(
AssociatedInterfacePtr<Interface>* ptr,
AssociatedGroup* group) {
- AssociatedInterfaceRequest<Interface> request;
- AssociatedInterfacePtrInfo<Interface> ptr_info;
+ AssociatedInterfaceRequest<typename Interface::GenericInterface> request;
+ AssociatedInterfacePtrInfo<typename Interface::GenericInterface> ptr_info;
group->CreateAssociatedInterface(AssociatedGroup::WILL_PASS_REQUEST,
&ptr_info, &request);
« no previous file with comments | « mojo/public/cpp/bindings/associated_group.h ('k') | mojo/public/cpp/bindings/binding.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698