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

Unified Diff: mojo/common/weak_binding_set.h

Issue 1518293002: [mojo] Add Mojo bindings support for IPC::ParamTraits (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@pickle4
Patch Set: 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 | « no previous file | mojo/public/cpp/bindings/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/common/weak_binding_set.h
diff --git a/mojo/common/weak_binding_set.h b/mojo/common/weak_binding_set.h
index 85c8031464db6ad073a799d225e9da10258df828..35d9c9e49da02ae1d718b1f15493c181ba1cdc89 100644
--- a/mojo/common/weak_binding_set.h
+++ b/mojo/common/weak_binding_set.h
@@ -21,6 +21,8 @@ class WeakBinding;
template <typename Interface>
class WeakBindingSet {
public:
+ using GenericInterface_ = typename Interface::GenericInterface_;
+
WeakBindingSet() {}
~WeakBindingSet() { CloseAllBindings(); }
@@ -28,7 +30,8 @@ class WeakBindingSet {
error_handler_ = error_handler;
}
- void AddBinding(Interface* impl, InterfaceRequest<Interface> request) {
+ void AddBinding(Interface* impl,
+ InterfaceRequest<GenericInterface_> request) {
auto binding = new WeakBinding<Interface>(impl, request.Pass());
binding->set_connection_error_handler([this]() { OnConnectionError(); });
bindings_.push_back(binding->GetWeakPtr());
@@ -68,7 +71,9 @@ class WeakBindingSet {
template <typename Interface>
class WeakBinding {
public:
- WeakBinding(Interface* impl, InterfaceRequest<Interface> request)
+ using GenericInterface_ = typename Interface::GenericInterface_;
+
+ WeakBinding(Interface* impl, InterfaceRequest<GenericInterface_> request)
: binding_(impl, request.Pass()),
weak_ptr_factory_(this) {
binding_.set_connection_error_handler([this]() { OnConnectionError(); });
« no previous file with comments | « no previous file | mojo/public/cpp/bindings/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698