Chromium Code Reviews| Index: mojo/public/cpp/bindings/associated_interface_ptr_set.h |
| diff --git a/mojo/public/cpp/bindings/interface_ptr_set.h b/mojo/public/cpp/bindings/associated_interface_ptr_set.h |
| similarity index 74% |
| copy from mojo/public/cpp/bindings/interface_ptr_set.h |
| copy to mojo/public/cpp/bindings/associated_interface_ptr_set.h |
| index c5d402d7cfaf51571c418c3460c2ee7d71fc24f6..24ebcdee3e5387a42fae67db7a06665f2fd8a26a 100644 |
| --- a/mojo/public/cpp/bindings/interface_ptr_set.h |
| +++ b/mojo/public/cpp/bindings/associated_interface_ptr_set.h |
| @@ -2,25 +2,25 @@ |
| // 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_INTERFACE_PTR_SET_H_ |
| -#define MOJO_PUBLIC_CPP_BINDINGS_INTERFACE_PTR_SET_H_ |
| +#ifndef MOJO_PUBLIC_CPP_BINDINGS_ASSOCIATED_INTERFACE_PTR_SET_H_ |
| +#define MOJO_PUBLIC_CPP_BINDINGS_ASSOCIATED_INTERFACE_PTR_SET_H_ |
| #include <utility> |
| #include <vector> |
| #include "base/macros.h" |
| #include "base/memory/weak_ptr.h" |
| -#include "mojo/public/cpp/bindings/interface_ptr.h" |
| +#include "mojo/public/cpp/bindings/associated_interface_ptr.h" |
|
sky
2016/04/07 22:02:46
Can you separate this change out and add Yuzhu? I
msw
2016/04/08 21:20:48
Done: https://codereview.chromium.org/1872903003
|
| namespace mojo { |
| template <typename Interface> |
| -class InterfacePtrSet { |
| +class AssociatedInterfacePtrSet { |
| public: |
| - InterfacePtrSet() {} |
| - ~InterfacePtrSet() { CloseAll(); } |
| + AssociatedInterfacePtrSet() {} |
| + ~AssociatedInterfacePtrSet() { CloseAll(); } |
| - void AddInterfacePtr(InterfacePtr<Interface> ptr) { |
| + void AddInterfacePtr(AssociatedInterfacePtr<Interface> ptr) { |
| auto weak_interface_ptr = new Element(std::move(ptr)); |
| ptrs_.push_back(weak_interface_ptr->GetWeakPtr()); |
| ClearNullInterfacePtrs(); |
| @@ -46,7 +46,7 @@ class InterfacePtrSet { |
| private: |
| class Element { |
| public: |
| - explicit Element(InterfacePtr<Interface> ptr) |
| + explicit Element(AssociatedInterfacePtr<Interface> ptr) |
| : ptr_(std::move(ptr)), weak_ptr_factory_(this) { |
| ptr_.set_connection_error_handler([this]() { delete this; }); |
| } |
| @@ -61,7 +61,7 @@ class InterfacePtrSet { |
| } |
| private: |
| - InterfacePtr<Interface> ptr_; |
| + AssociatedInterfacePtr<Interface> ptr_; |
| base::WeakPtrFactory<Element> weak_ptr_factory_; |
| DISALLOW_COPY_AND_ASSIGN(Element); |
| @@ -80,4 +80,4 @@ class InterfacePtrSet { |
| } // namespace mojo |
| -#endif // MOJO_PUBLIC_CPP_BINDINGS_INTERFACE_PTR_SET_H_ |
| +#endif // MOJO_PUBLIC_CPP_BINDINGS_ASSOCIATED_INTERFACE_PTR_SET_H_ |