alokp | 363e6ab | 2017-02-15 07:53:04 | [diff] [blame] | 1 | // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef MOJO_PUBLIC_CPP_BINDINGS_STRONG_BINDING_SET_H_ |
| 6 | #define MOJO_PUBLIC_CPP_BINDINGS_STRONG_BINDING_SET_H_ |
| 7 | |
| 8 | #include "mojo/public/cpp/bindings/binding_set.h" |
| 9 | #include "mojo/public/cpp/bindings/unique_ptr_impl_ref_traits.h" |
| 10 | |
| 11 | namespace mojo { |
| 12 | |
| 13 | // This class manages a set of bindings. When the pipe a binding is bound to is |
| 14 | // disconnected, the binding is automatically destroyed and removed from the |
| 15 | // set, and the interface implementation is deleted. When the StrongBindingSet |
| 16 | // is destructed, all outstanding bindings in the set are destroyed and all the |
| 17 | // bound interface implementations are automatically deleted. |
| 18 | template <typename Interface, typename ContextType = void> |
| 19 | using StrongBindingSet = |
| 20 | BindingSetBase<Interface, |
| 21 | Binding<Interface, UniquePtrImplRefTraits<Interface>>, |
| 22 | ContextType>; |
| 23 | |
| 24 | } // namespace mojo |
| 25 | |
| 26 | #endif // MOJO_PUBLIC_CPP_BINDINGS_STRONG_BINDING_SET_H_ |