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

Unified Diff: mojo/common/weak_binding_set.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 | « content/gpu/gpu_child_thread.h ('k') | mojo/public/cpp/bindings/associated_binding.h » ('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..c3736ff901787f2879dfe1696f7559b080ee1f39 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 | « content/gpu/gpu_child_thread.h ('k') | mojo/public/cpp/bindings/associated_binding.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698