Chromium Code Reviews| Index: mojo/public/cpp/bindings/strong_binding_set.h |
| diff --git a/mojo/public/cpp/bindings/strong_binding_set.h b/mojo/public/cpp/bindings/strong_binding_set.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..f6bcd5259c07eb31db7cc4314f691a7f8d469158 |
| --- /dev/null |
| +++ b/mojo/public/cpp/bindings/strong_binding_set.h |
| @@ -0,0 +1,26 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef MOJO_PUBLIC_CPP_BINDINGS_STRONG_BINDING_SET_H_ |
| +#define MOJO_PUBLIC_CPP_BINDINGS_STRONG_BINDING_SET_H_ |
| + |
| +#include "mojo/public/cpp/bindings/binding_set.h" |
| +#include "mojo/public/cpp/bindings/unique_ptr_impl_ref_traits.h" |
| + |
| +namespace mojo { |
| + |
| +// This class manages a set of bindings. When the pipe a binding is bound to is |
| +// disconnected, the binding is automatically destroyed and removed from the |
| +// set, and the interface implementation is deleted. When the StrongBindingSet |
| +// is destructed, all outstanding bindings in the set are destroyed and all the |
| +// bound interface implementations are automatically deleted. |
| +template <typename Interface, typename ContextType = void> |
|
xhwang
2017/02/16 03:54:49
The comment above is copied from media::StrongBind
xhwang
2017/02/16 04:03:07
Nevermind, I guess user of this class has to look
|
| +using StrongBindingSet = |
| + BindingSetBase<Interface, |
| + Binding<Interface, UniquePtrImplRefTraits<Interface>>, |
| + ContextType>; |
| + |
| +} // namespace mojo |
| + |
| +#endif // MOJO_PUBLIC_CPP_BINDINGS_STRONG_BINDING_SET_H_ |