Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Unified Diff: mojo/public/cpp/bindings/associated_interface_ptr_set.h

Issue 1839223003: Add basic Chrome interaction with the mash shelf. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use associated interfaces for observers and item delegates. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« ash/mus/shelf_delegate_mus.cc ('K') | « mojo/public/cpp/bindings/BUILD.gn ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_
« ash/mus/shelf_delegate_mus.cc ('K') | « mojo/public/cpp/bindings/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698