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

Unified Diff: mojo/public/cpp/bindings/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/binding.h ('k') | mojo/public/cpp/bindings/interface_request.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/bindings/interface_ptr.h
diff --git a/mojo/public/cpp/bindings/interface_ptr.h b/mojo/public/cpp/bindings/interface_ptr.h
index dbd52e6ada56a6d52ad53978d99aa85dbfebb379..51cfc352898e27edc102d4637a6fad34f007576d 100644
--- a/mojo/public/cpp/bindings/interface_ptr.h
+++ b/mojo/public/cpp/bindings/interface_ptr.h
@@ -32,6 +32,8 @@ class InterfacePtr {
DISALLOW_COPY_AND_ASSIGN_WITH_MOVE_FOR_BIND(InterfacePtr)
public:
+ using GenericInterface = typename Interface::GenericInterface;
+
// Constructs an unbound InterfacePtr.
InterfacePtr() {}
InterfacePtr(decltype(nullptr)) {}
@@ -68,7 +70,7 @@ class InterfacePtr {
// has the same effect as reset(). In this case, the InterfacePtr is not
// considered as bound.
void Bind(
- InterfacePtrInfo<Interface> info,
+ InterfacePtrInfo<GenericInterface> info,
const MojoAsyncWaiter* waiter = Environment::GetDefaultAsyncWaiter()) {
reset();
if (info.is_valid())
@@ -157,7 +159,7 @@ class InterfacePtr {
// 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.
- InterfacePtrInfo<Interface> PassInterface() {
+ InterfacePtrInfo<GenericInterface> PassInterface() {
CHECK(!HasAssociatedInterfaces());
CHECK(!internal_state_.has_pending_callbacks());
State state;
« no previous file with comments | « mojo/public/cpp/bindings/binding.h ('k') | mojo/public/cpp/bindings/interface_request.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698