summaryrefslogtreecommitdiffstats
path: root/mojo/common
diff options
context:
space:
mode:
authorrockot <rockot@chromium.org>2015-12-16 19:21:58 -0800
committerCommit bot <commit-bot@chromium.org>2015-12-17 03:24:04 +0000
commit54b524949599a2045114039133eb25b304e20359 (patch)
tree26e0291135113831a42f86ed6bb4cc138f502d2b /mojo/common
parentf83a08c9c9156960d505472108a5c96ee2972820 (diff)
downloadchromium_src-54b524949599a2045114039133eb25b304e20359.zip
chromium_src-54b524949599a2045114039133eb25b304e20359.tar.gz
chromium_src-54b524949599a2045114039133eb25b304e20359.tar.bz2
[mojo] Add GenericInterface_ to interface class variants
This is used to identify pure non-variant interface definitions for uses relevant to InterfaceRequest. e.g. one could do variant1::FooPtr foo; GetProxy(&foo) and GetProxy will return an InterfaceRequest<generic::Foo>. Part of a series of changes to support custom mojom serialization: 1. https://codereview.chromium.org/1515423002 2. https://codereview.chromium.org/1517043004 3. This CL 4. https://codereview.chromium.org/1520153002 5. https://codereview.chromium.org/1524613002 6. https://codereview.chromium.org/1526533002 7. https://codereview.chromium.org/1524703002 BUG=569669 TBR=sky@chromium.org for mojo/common TBR=piman@chromium.org for content/gpu Review URL: https://codereview.chromium.org/1524693002 Cr-Commit-Position: refs/heads/master@{#365708}
Diffstat (limited to 'mojo/common')
-rw-r--r--mojo/common/weak_binding_set.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/mojo/common/weak_binding_set.h b/mojo/common/weak_binding_set.h
index 85c8031..c3736ff 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(); });