blob: f6bcd5259c07eb31db7cc4314f691a7f8d469158 [file] [log] [blame]
alokp363e6ab2017-02-15 07:53:041// 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
11namespace 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.
18template <typename Interface, typename ContextType = void>
19using 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_