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

Unified Diff: mojo/public/cpp/bindings/lib/binding_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
Index: mojo/public/cpp/bindings/lib/binding_state.h
diff --git a/mojo/public/cpp/bindings/lib/binding_state.h b/mojo/public/cpp/bindings/lib/binding_state.h
index 82b1a327b21a13d318f9bf82d3de6e4c473472d0..dea3a6b906724d09d20666dc4e5822a5b00e0580 100644
--- a/mojo/public/cpp/bindings/lib/binding_state.h
+++ b/mojo/public/cpp/bindings/lib/binding_state.h
@@ -37,6 +37,8 @@ class BindingState;
template <typename Interface>
class BindingState<Interface, false> {
public:
+ using GenericInterface = typename Interface::GenericInterface;
+
explicit BindingState(Interface* impl) : impl_(impl) {
stub_.set_sink(impl_);
}
@@ -81,9 +83,9 @@ class BindingState<Interface, false> {
DestroyRouter();
}
- InterfaceRequest<Interface> Unbind() {
- InterfaceRequest<Interface> request =
- MakeRequest<Interface>(router_->PassMessagePipe());
+ InterfaceRequest<GenericInterface> Unbind() {
+ InterfaceRequest<GenericInterface> request =
+ MakeRequest<GenericInterface>(router_->PassMessagePipe());
DestroyRouter();
return request.Pass();
}
@@ -128,6 +130,8 @@ class BindingState<Interface, false> {
template <typename Interface>
class BindingState<Interface, true> {
public:
+ using GenericInterface = typename Interface::GenericInterface;
+
explicit BindingState(Interface* impl) : impl_(impl) {
stub_.set_sink(impl_);
}
@@ -177,10 +181,10 @@ class BindingState<Interface, true> {
router_ = nullptr;
}
- InterfaceRequest<Interface> Unbind() {
+ InterfaceRequest<GenericInterface> Unbind() {
endpoint_client_.reset();
- InterfaceRequest<Interface> request =
- MakeRequest<Interface>(router_->PassMessagePipe());
+ InterfaceRequest<GenericInterface> request =
+ MakeRequest<GenericInterface>(router_->PassMessagePipe());
router_ = nullptr;
return request.Pass();
}
« no previous file with comments | « mojo/public/cpp/bindings/lib/associated_interface_ptr_state.h ('k') | mojo/public/cpp/bindings/lib/interface_ptr_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698