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

Unified Diff: mojo/public/cpp/bindings/lib/associated_interface_ptr_state.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/interface_request.h ('k') | mojo/public/cpp/bindings/lib/binding_state.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/bindings/lib/associated_interface_ptr_state.h
diff --git a/mojo/public/cpp/bindings/lib/associated_interface_ptr_state.h b/mojo/public/cpp/bindings/lib/associated_interface_ptr_state.h
index 2a111eaf190e4e7927b9978c126f5353d2feb930..00f2de5fb5846742f5c86c7c2d808ff61a57fcff 100644
--- a/mojo/public/cpp/bindings/lib/associated_interface_ptr_state.h
+++ b/mojo/public/cpp/bindings/lib/associated_interface_ptr_state.h
@@ -24,6 +24,8 @@ namespace internal {
template <typename Interface>
class AssociatedInterfacePtrState {
public:
+ using GenericInterface = typename Interface::GenericInterface;
+
AssociatedInterfacePtrState() : version_(0u) {}
~AssociatedInterfacePtrState() {
@@ -69,7 +71,7 @@ class AssociatedInterfacePtrState {
swap(other->version_, version_);
}
- void Bind(AssociatedInterfacePtrInfo<Interface> info) {
+ void Bind(AssociatedInterfacePtrInfo<GenericInterface> info) {
DCHECK(!endpoint_client_);
DCHECK(!proxy_);
DCHECK_EQ(0u, version_);
@@ -85,12 +87,12 @@ class AssociatedInterfacePtrState {
// After this method is called, the object is in an invalid state and
// shouldn't be reused.
- AssociatedInterfacePtrInfo<Interface> PassInterface() {
+ AssociatedInterfacePtrInfo<GenericInterface> PassInterface() {
ScopedInterfaceEndpointHandle handle = endpoint_client_->PassHandle();
endpoint_client_.reset();
proxy_.reset();
- AssociatedInterfacePtrInfo<Interface> result;
+ AssociatedInterfacePtrInfo<GenericInterface> result;
result.set_version(version_);
AssociatedInterfacePtrInfoHelper::SetHandle(&result, handle.Pass());
return result.Pass();
« no previous file with comments | « mojo/public/cpp/bindings/interface_request.h ('k') | mojo/public/cpp/bindings/lib/binding_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698