summaryrefslogtreecommitdiffstats
path: root/mojo
diff options
context:
space:
mode:
authoryzshen <yzshen@chromium.org>2016-02-24 23:29:27 -0800
committerCommit bot <commit-bot@chromium.org>2016-02-25 07:30:23 +0000
commitd414dc34a7f87a2000e09c58b9ddbb5bd6b61463 (patch)
treea9ec402cbfbef1da3acde6071d992e2ade92ca8b /mojo
parentd910911b407efde31709e3a766a5ee776db4c626 (diff)
downloadchromium_src-d414dc34a7f87a2000e09c58b9ddbb5bd6b61463.zip
chromium_src-d414dc34a7f87a2000e09c58b9ddbb5bd6b61463.tar.gz
chromium_src-d414dc34a7f87a2000e09c58b9ddbb5bd6b61463.tar.bz2
Rename WeakBindingSet/WeakInterfacePtrSet to BindingSet/InterfacePtrSet.
This CL also renames the element type (WeakBinding/WeakInterfacePtr) to Element and hide them in the corresonding *Set class. BUG=None CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_site_isolation Committed: https://crrev.com/632d319842096e6998d174e2f251865979ce2b72 Cr-Commit-Position: refs/heads/master@{#377384} Review URL: https://codereview.chromium.org/1735583002 Cr-Commit-Position: refs/heads/master@{#377528}
Diffstat (limited to 'mojo')
-rw-r--r--mojo/mojo_public.gyp4
-rw-r--r--mojo/public/cpp/bindings/BUILD.gn4
-rw-r--r--mojo/public/cpp/bindings/binding_set.h113
-rw-r--r--mojo/public/cpp/bindings/interface_ptr_set.h83
-rw-r--r--mojo/public/cpp/bindings/tests/pickle_unittest.cc6
-rw-r--r--mojo/public/cpp/bindings/tests/struct_traits_unittest.cc8
-rw-r--r--mojo/public/cpp/bindings/weak_binding_set.h118
-rw-r--r--mojo/public/cpp/bindings/weak_interface_ptr_set.h88
-rw-r--r--mojo/services/package_manager/package_manager.h8
-rw-r--r--mojo/services/tracing/tracing_app.h8
-rw-r--r--mojo/shell/application_instance.h4
-rw-r--r--mojo/shell/application_manager.h8
-rw-r--r--mojo/shell/background/tests/test_service.cc4
-rw-r--r--mojo/shell/runner/child/native_apptest_target.cc4
-rw-r--r--mojo/shell/tests/application_manager_apptest.cc2
-rw-r--r--mojo/shell/tests/application_manager_apptest_driver.cc4
-rw-r--r--mojo/shell/tests/capability_filter_test.cc8
-rw-r--r--mojo/shell/tests/package_test_package.cc8
18 files changed, 236 insertions, 246 deletions
diff --git a/mojo/mojo_public.gyp b/mojo/mojo_public.gyp
index 3017df8..10a0dae 100644
--- a/mojo/mojo_public.gyp
+++ b/mojo/mojo_public.gyp
@@ -104,8 +104,10 @@
'public/cpp/bindings/associated_interface_ptr_info.h',
'public/cpp/bindings/associated_interface_request.h',
'public/cpp/bindings/binding.h',
+ 'public/cpp/bindings/binding_set.h',
'public/cpp/bindings/callback.h',
'public/cpp/bindings/interface_ptr.h',
+ 'public/cpp/bindings/interface_ptr_set.h',
'public/cpp/bindings/interface_request.h',
'public/cpp/bindings/lib/array_internal.cc',
'public/cpp/bindings/lib/array_internal.h',
@@ -177,8 +179,6 @@
'public/cpp/bindings/string.h',
'public/cpp/bindings/strong_binding.h',
'public/cpp/bindings/type_converter.h',
- 'public/cpp/bindings/weak_binding_set.h',
- 'public/cpp/bindings/weak_interface_ptr_set.h',
# This comes from the mojo_interface_bindings_cpp_sources dependency.
'>@(mojom_generated_sources)',
],
diff --git a/mojo/public/cpp/bindings/BUILD.gn b/mojo/public/cpp/bindings/BUILD.gn
index 72079fd..6b7a015 100644
--- a/mojo/public/cpp/bindings/BUILD.gn
+++ b/mojo/public/cpp/bindings/BUILD.gn
@@ -11,8 +11,10 @@ source_set("bindings") {
"associated_interface_ptr_info.h",
"associated_interface_request.h",
"binding.h",
+ "binding_set.h",
"interface_ptr.h",
"interface_ptr_info.h",
+ "interface_ptr_set.h",
"interface_request.h",
"lib/array_internal.cc",
"lib/array_internal.h",
@@ -85,8 +87,6 @@ source_set("bindings") {
"struct_ptr.h",
"struct_traits.h",
"type_converter.h",
- "weak_binding_set.h",
- "weak_interface_ptr_set.h",
]
public_deps = [
diff --git a/mojo/public/cpp/bindings/binding_set.h b/mojo/public/cpp/bindings/binding_set.h
new file mode 100644
index 0000000..82e7cfb
--- /dev/null
+++ b/mojo/public/cpp/bindings/binding_set.h
@@ -0,0 +1,113 @@
+// Copyright 2014 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_BINDING_SET_H_
+#define MOJO_PUBLIC_CPP_BINDINGS_BINDING_SET_H_
+
+#include <algorithm>
+#include <utility>
+#include <vector>
+
+#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
+#include "mojo/public/cpp/bindings/binding.h"
+
+namespace mojo {
+
+// Use this class to manage a set of bindings, which are automatically destroyed
+// and removed from the set when the pipe they bound to is disconnected.
+template <typename Interface>
+class BindingSet {
+ public:
+ using GenericInterface = typename Interface::GenericInterface;
+
+ BindingSet() {}
+ ~BindingSet() { CloseAllBindings(); }
+
+ void set_connection_error_handler(const Closure& error_handler) {
+ error_handler_ = error_handler;
+ }
+
+ void AddBinding(Interface* impl, InterfaceRequest<GenericInterface> request) {
+ auto binding = new Element(impl, std::move(request));
+ binding->set_connection_error_handler([this]() { OnConnectionError(); });
+ bindings_.push_back(binding->GetWeakPtr());
+ }
+
+ // Returns an InterfacePtr bound to one end of a pipe whose other end is
+ // bound to |this|.
+ InterfacePtr<Interface> CreateInterfacePtrAndBind(Interface* impl) {
+ InterfacePtr<Interface> interface_ptr;
+ AddBinding(impl, GetProxy(&interface_ptr));
+ return interface_ptr;
+ }
+
+ void CloseAllBindings() {
+ for (const auto& it : bindings_) {
+ if (it) {
+ it->Close();
+ delete it.get();
+ }
+ }
+ bindings_.clear();
+ }
+
+ bool empty() const { return bindings_.empty(); }
+
+ private:
+ class Element {
+ public:
+ using GenericInterface = typename Interface::GenericInterface;
+
+ Element(Interface* impl, InterfaceRequest<GenericInterface> request)
+ : binding_(impl, std::move(request)), weak_ptr_factory_(this) {
+ binding_.set_connection_error_handler([this]() { OnConnectionError(); });
+ }
+
+ ~Element() {}
+
+ void set_connection_error_handler(const Closure& error_handler) {
+ error_handler_ = error_handler;
+ }
+
+ base::WeakPtr<Element> GetWeakPtr() {
+ return weak_ptr_factory_.GetWeakPtr();
+ }
+
+ void Close() { binding_.Close(); }
+
+ void OnConnectionError() {
+ Closure error_handler = error_handler_;
+ delete this;
+ error_handler.Run();
+ }
+
+ private:
+ Binding<Interface> binding_;
+ Closure error_handler_;
+ base::WeakPtrFactory<Element> weak_ptr_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(Element);
+ };
+
+ void OnConnectionError() {
+ // Clear any deleted bindings.
+ bindings_.erase(std::remove_if(bindings_.begin(), bindings_.end(),
+ [](const base::WeakPtr<Element>& p) {
+ return p.get() == nullptr;
+ }),
+ bindings_.end());
+
+ error_handler_.Run();
+ }
+
+ Closure error_handler_;
+ std::vector<base::WeakPtr<Element>> bindings_;
+
+ DISALLOW_COPY_AND_ASSIGN(BindingSet);
+};
+
+} // namespace mojo
+
+#endif // MOJO_PUBLIC_CPP_BINDINGS_BINDING_SET_H_
diff --git a/mojo/public/cpp/bindings/interface_ptr_set.h b/mojo/public/cpp/bindings/interface_ptr_set.h
new file mode 100644
index 0000000..c5d402d
--- /dev/null
+++ b/mojo/public/cpp/bindings/interface_ptr_set.h
@@ -0,0 +1,83 @@
+// Copyright 2014 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_INTERFACE_PTR_SET_H_
+#define MOJO_PUBLIC_CPP_BINDINGS_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"
+
+namespace mojo {
+
+template <typename Interface>
+class InterfacePtrSet {
+ public:
+ InterfacePtrSet() {}
+ ~InterfacePtrSet() { CloseAll(); }
+
+ void AddInterfacePtr(InterfacePtr<Interface> ptr) {
+ auto weak_interface_ptr = new Element(std::move(ptr));
+ ptrs_.push_back(weak_interface_ptr->GetWeakPtr());
+ ClearNullInterfacePtrs();
+ }
+
+ template <typename FunctionType>
+ void ForAllPtrs(FunctionType function) {
+ for (const auto& it : ptrs_) {
+ if (it)
+ function(it->get());
+ }
+ ClearNullInterfacePtrs();
+ }
+
+ void CloseAll() {
+ for (const auto& it : ptrs_) {
+ if (it)
+ it->Close();
+ }
+ ptrs_.clear();
+ }
+
+ private:
+ class Element {
+ public:
+ explicit Element(InterfacePtr<Interface> ptr)
+ : ptr_(std::move(ptr)), weak_ptr_factory_(this) {
+ ptr_.set_connection_error_handler([this]() { delete this; });
+ }
+ ~Element() {}
+
+ void Close() { ptr_.reset(); }
+
+ Interface* get() { return ptr_.get(); }
+
+ base::WeakPtr<Element> GetWeakPtr() {
+ return weak_ptr_factory_.GetWeakPtr();
+ }
+
+ private:
+ InterfacePtr<Interface> ptr_;
+ base::WeakPtrFactory<Element> weak_ptr_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(Element);
+ };
+
+ void ClearNullInterfacePtrs() {
+ ptrs_.erase(std::remove_if(ptrs_.begin(), ptrs_.end(),
+ [](const base::WeakPtr<Element>& p) {
+ return p.get() == nullptr;
+ }),
+ ptrs_.end());
+ }
+
+ std::vector<base::WeakPtr<Element>> ptrs_;
+};
+
+} // namespace mojo
+
+#endif // MOJO_PUBLIC_CPP_BINDINGS_INTERFACE_PTR_SET_H_
diff --git a/mojo/public/cpp/bindings/tests/pickle_unittest.cc b/mojo/public/cpp/bindings/tests/pickle_unittest.cc
index a0d7a2e..33961b4 100644
--- a/mojo/public/cpp/bindings/tests/pickle_unittest.cc
+++ b/mojo/public/cpp/bindings/tests/pickle_unittest.cc
@@ -9,10 +9,10 @@
#include "base/logging.h"
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
+#include "mojo/public/cpp/bindings/binding_set.h"
#include "mojo/public/cpp/bindings/interface_request.h"
#include "mojo/public/cpp/bindings/tests/pickled_struct_blink.h"
#include "mojo/public/cpp/bindings/tests/pickled_struct_chromium.h"
-#include "mojo/public/cpp/bindings/weak_binding_set.h"
#include "mojo/public/interfaces/bindings/tests/test_native_types.mojom-blink.h"
#include "mojo/public/interfaces/bindings/tests/test_native_types.mojom-chromium.h"
#include "mojo/public/interfaces/bindings/tests/test_native_types.mojom.h"
@@ -134,9 +134,9 @@ class PickleTest : public testing::Test {
private:
base::MessageLoop loop_;
ChromiumPicklePasserImpl chromium_service_;
- mojo::WeakBindingSet<chromium::PicklePasser> chromium_bindings_;
+ mojo::BindingSet<chromium::PicklePasser> chromium_bindings_;
BlinkPicklePasserImpl blink_service_;
- mojo::WeakBindingSet<blink::PicklePasser> blink_bindings_;
+ mojo::BindingSet<blink::PicklePasser> blink_bindings_;
};
} // namespace
diff --git a/mojo/public/cpp/bindings/tests/struct_traits_unittest.cc b/mojo/public/cpp/bindings/tests/struct_traits_unittest.cc
index 02fb53f..b4c3e49 100644
--- a/mojo/public/cpp/bindings/tests/struct_traits_unittest.cc
+++ b/mojo/public/cpp/bindings/tests/struct_traits_unittest.cc
@@ -7,11 +7,11 @@
#include "base/logging.h"
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
+#include "mojo/public/cpp/bindings/binding_set.h"
#include "mojo/public/cpp/bindings/interface_request.h"
#include "mojo/public/cpp/bindings/tests/rect_blink.h"
#include "mojo/public/cpp/bindings/tests/rect_chromium.h"
#include "mojo/public/cpp/bindings/tests/struct_with_traits_impl.h"
-#include "mojo/public/cpp/bindings/weak_binding_set.h"
#include "mojo/public/interfaces/bindings/tests/struct_with_traits.mojom.h"
#include "mojo/public/interfaces/bindings/tests/test_native_types.mojom-blink.h"
#include "mojo/public/interfaces/bindings/tests/test_native_types.mojom-chromium.h"
@@ -126,12 +126,12 @@ class StructTraitsTest : public testing::Test,
base::MessageLoop loop_;
ChromiumRectServiceImpl chromium_service_;
- mojo::WeakBindingSet<chromium::RectService> chromium_bindings_;
+ mojo::BindingSet<chromium::RectService> chromium_bindings_;
BlinkRectServiceImpl blink_service_;
- mojo::WeakBindingSet<blink::RectService> blink_bindings_;
+ mojo::BindingSet<blink::RectService> blink_bindings_;
- mojo::WeakBindingSet<TraitsTestService> traits_test_bindings_;
+ mojo::BindingSet<TraitsTestService> traits_test_bindings_;
};
} // namespace
diff --git a/mojo/public/cpp/bindings/weak_binding_set.h b/mojo/public/cpp/bindings/weak_binding_set.h
deleted file mode 100644
index bf06a28..0000000
--- a/mojo/public/cpp/bindings/weak_binding_set.h
+++ /dev/null
@@ -1,118 +0,0 @@
-// Copyright 2014 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_WEAK_BINDING_SET_H_
-#define MOJO_PUBLIC_CPP_BINDINGS_WEAK_BINDING_SET_H_
-
-#include <algorithm>
-#include <utility>
-#include <vector>
-
-#include "base/macros.h"
-#include "base/memory/weak_ptr.h"
-#include "mojo/public/cpp/bindings/binding.h"
-
-namespace mojo {
-
-template <typename Interface>
-class WeakBinding;
-
-// Use this class to manage a set of weak pointers to bindings each of which is
-// owned by the pipe they are bound to.
-template <typename Interface>
-class WeakBindingSet {
- public:
- using GenericInterface = typename Interface::GenericInterface;
-
- WeakBindingSet() {}
- ~WeakBindingSet() { CloseAllBindings(); }
-
- void set_connection_error_handler(const Closure& error_handler) {
- error_handler_ = error_handler;
- }
-
- void AddBinding(Interface* impl, InterfaceRequest<GenericInterface> request) {
- auto binding = new WeakBinding<Interface>(impl, std::move(request));
- binding->set_connection_error_handler([this]() { OnConnectionError(); });
- bindings_.push_back(binding->GetWeakPtr());
- }
-
- // Returns an InterfacePtr bound to one end of a pipe whose other end is
- // bound to |this|.
- InterfacePtr<Interface> CreateInterfacePtrAndBind(Interface* impl) {
- InterfacePtr<Interface> interface_ptr;
- AddBinding(impl, GetProxy(&interface_ptr));
- return interface_ptr;
- }
-
- void CloseAllBindings() {
- for (const auto& it : bindings_) {
- if (it) {
- it->Close();
- delete it.get();
- }
- }
- bindings_.clear();
- }
-
- bool empty() const { return bindings_.empty(); }
-
- private:
- void OnConnectionError() {
- // Clear any deleted bindings.
- bindings_.erase(
- std::remove_if(bindings_.begin(), bindings_.end(),
- [](const base::WeakPtr<WeakBinding<Interface>>& p) {
- return p.get() == nullptr;
- }),
- bindings_.end());
-
- error_handler_.Run();
- }
-
- Closure error_handler_;
- std::vector<base::WeakPtr<WeakBinding<Interface>>> bindings_;
-
- DISALLOW_COPY_AND_ASSIGN(WeakBindingSet);
-};
-
-template <typename Interface>
-class WeakBinding {
- public:
- using GenericInterface = typename Interface::GenericInterface;
-
- WeakBinding(Interface* impl, InterfaceRequest<GenericInterface> request)
- : binding_(impl, std::move(request)), weak_ptr_factory_(this) {
- binding_.set_connection_error_handler([this]() { OnConnectionError(); });
- }
-
- ~WeakBinding() {}
-
- void set_connection_error_handler(const Closure& error_handler) {
- error_handler_ = error_handler;
- }
-
- base::WeakPtr<WeakBinding> GetWeakPtr() {
- return weak_ptr_factory_.GetWeakPtr();
- }
-
- void Close() { binding_.Close(); }
-
- void OnConnectionError() {
- Closure error_handler = error_handler_;
- delete this;
- error_handler.Run();
- }
-
- private:
- Binding<Interface> binding_;
- Closure error_handler_;
- base::WeakPtrFactory<WeakBinding> weak_ptr_factory_;
-
- DISALLOW_COPY_AND_ASSIGN(WeakBinding);
-};
-
-} // namespace mojo
-
-#endif // MOJO_PUBLIC_CPP_BINDINGS_WEAK_BINDING_SET_H_
diff --git a/mojo/public/cpp/bindings/weak_interface_ptr_set.h b/mojo/public/cpp/bindings/weak_interface_ptr_set.h
deleted file mode 100644
index f92a5ed..0000000
--- a/mojo/public/cpp/bindings/weak_interface_ptr_set.h
+++ /dev/null
@@ -1,88 +0,0 @@
-// Copyright 2014 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_WEAK_INTERFACE_PTR_SET_H_
-#define MOJO_PUBLIC_CPP_BINDINGS_WEAK_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"
-
-namespace mojo {
-
-template <typename Interface>
-class WeakInterfacePtr;
-
-template <typename Interface>
-class WeakInterfacePtrSet {
- public:
- WeakInterfacePtrSet() {}
- ~WeakInterfacePtrSet() { CloseAll(); }
-
- void AddInterfacePtr(InterfacePtr<Interface> ptr) {
- auto weak_interface_ptr = new WeakInterfacePtr<Interface>(std::move(ptr));
- ptrs_.push_back(weak_interface_ptr->GetWeakPtr());
- ClearNullInterfacePtrs();
- }
-
- template <typename FunctionType>
- void ForAllPtrs(FunctionType function) {
- for (const auto& it : ptrs_) {
- if (it)
- function(it->get());
- }
- ClearNullInterfacePtrs();
- }
-
- void CloseAll() {
- for (const auto& it : ptrs_) {
- if (it)
- it->Close();
- }
- ptrs_.clear();
- }
-
- private:
- using WPWIPI = base::WeakPtr<WeakInterfacePtr<Interface>>;
-
- void ClearNullInterfacePtrs() {
- ptrs_.erase(
- std::remove_if(ptrs_.begin(), ptrs_.end(),
- [](const WPWIPI& p) { return p.get() == nullptr; }),
- ptrs_.end());
- }
-
- std::vector<WPWIPI> ptrs_;
-};
-
-template <typename Interface>
-class WeakInterfacePtr {
- public:
- explicit WeakInterfacePtr(InterfacePtr<Interface> ptr)
- : ptr_(std::move(ptr)), weak_ptr_factory_(this) {
- ptr_.set_connection_error_handler([this]() { delete this; });
- }
- ~WeakInterfacePtr() {}
-
- void Close() { ptr_.reset(); }
-
- Interface* get() { return ptr_.get(); }
-
- base::WeakPtr<WeakInterfacePtr> GetWeakPtr() {
- return weak_ptr_factory_.GetWeakPtr();
- }
-
- private:
- InterfacePtr<Interface> ptr_;
- base::WeakPtrFactory<WeakInterfacePtr> weak_ptr_factory_;
-
- DISALLOW_COPY_AND_ASSIGN(WeakInterfacePtr);
-};
-
-} // namespace mojo
-
-#endif // MOJO_PUBLIC_CPP_BINDINGS_WEAK_INTERFACE_PTR_SET_H_
diff --git a/mojo/services/package_manager/package_manager.h b/mojo/services/package_manager/package_manager.h
index 1259724..e587cc6 100644
--- a/mojo/services/package_manager/package_manager.h
+++ b/mojo/services/package_manager/package_manager.h
@@ -9,7 +9,7 @@
#include "base/memory/weak_ptr.h"
#include "base/path_service.h"
#include "base/values.h"
-#include "mojo/public/cpp/bindings/weak_binding_set.h"
+#include "mojo/public/cpp/bindings/binding_set.h"
#include "mojo/services/package_manager/public/interfaces/catalog.mojom.h"
#include "mojo/services/package_manager/public/interfaces/resolver.mojom.h"
#include "mojo/services/package_manager/public/interfaces/shell_resolver.mojom.h"
@@ -157,9 +157,9 @@ class PackageManager : public mojo::ShellClient,
base::TaskRunner* blocking_pool_;
GURL system_package_dir_;
- mojo::WeakBindingSet<mojom::Resolver> resolver_bindings_;
- mojo::WeakBindingSet<mojom::ShellResolver> shell_resolver_bindings_;
- mojo::WeakBindingSet<mojom::Catalog> catalog_bindings_;
+ mojo::BindingSet<mojom::Resolver> resolver_bindings_;
+ mojo::BindingSet<mojom::ShellResolver> shell_resolver_bindings_;
+ mojo::BindingSet<mojom::Catalog> catalog_bindings_;
scoped_ptr<ApplicationCatalogStore> catalog_store_;
std::map<GURL, ApplicationInfo> catalog_;
diff --git a/mojo/services/tracing/tracing_app.h b/mojo/services/tracing/tracing_app.h
index edb189e..f409887 100644
--- a/mojo/services/tracing/tracing_app.h
+++ b/mojo/services/tracing/tracing_app.h
@@ -10,9 +10,9 @@
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/scoped_vector.h"
+#include "mojo/public/cpp/bindings/binding_set.h"
+#include "mojo/public/cpp/bindings/interface_ptr_set.h"
#include "mojo/public/cpp/bindings/strong_binding.h"
-#include "mojo/public/cpp/bindings/weak_binding_set.h"
-#include "mojo/public/cpp/bindings/weak_interface_ptr_set.h"
#include "mojo/services/tracing/public/interfaces/tracing.mojom.h"
#include "mojo/services/tracing/trace_data_sink.h"
#include "mojo/services/tracing/trace_recorder_impl.h"
@@ -64,9 +64,9 @@ class TracingApp
scoped_ptr<TraceDataSink> sink_;
ScopedVector<TraceRecorderImpl> recorder_impls_;
- mojo::WeakInterfacePtrSet<TraceProvider> provider_ptrs_;
+ mojo::InterfacePtrSet<TraceProvider> provider_ptrs_;
mojo::Binding<TraceCollector> collector_binding_;
- mojo::WeakBindingSet<StartupPerformanceDataCollector>
+ mojo::BindingSet<StartupPerformanceDataCollector>
startup_performance_data_collector_bindings_;
StartupPerformanceTimes startup_performance_times_;
bool tracing_active_;
diff --git a/mojo/shell/application_instance.h b/mojo/shell/application_instance.h
index d5654dc..4599137 100644
--- a/mojo/shell/application_instance.h
+++ b/mojo/shell/application_instance.h
@@ -14,7 +14,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/process/process_handle.h"
#include "mojo/public/cpp/bindings/binding.h"
-#include "mojo/public/cpp/bindings/weak_binding_set.h"
+#include "mojo/public/cpp/bindings/binding_set.h"
#include "mojo/shell/connect_params.h"
#include "mojo/shell/identity.h"
#include "mojo/shell/public/interfaces/application_manager.mojom.h"
@@ -91,7 +91,7 @@ class ApplicationInstance : public mojom::Shell,
mojom::ShellClientPtr shell_client_;
Binding<mojom::Shell> binding_;
Binding<mojom::PIDReceiver> pid_receiver_binding_;
- WeakBindingSet<mojom::Connector> connectors_;
+ BindingSet<mojom::Connector> connectors_;
bool queue_requests_;
std::vector<ConnectParams*> queued_client_requests_;
NativeRunner* native_runner_;
diff --git a/mojo/shell/application_manager.h b/mojo/shell/application_manager.h
index 2757d92..fb1763b 100644
--- a/mojo/shell/application_manager.h
+++ b/mojo/shell/application_manager.h
@@ -11,8 +11,8 @@
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
-#include "mojo/public/cpp/bindings/weak_binding_set.h"
-#include "mojo/public/cpp/bindings/weak_interface_ptr_set.h"
+#include "mojo/public/cpp/bindings/binding_set.h"
+#include "mojo/public/cpp/bindings/interface_ptr_set.h"
#include "mojo/services/package_manager/package_manager.h"
#include "mojo/services/package_manager/public/interfaces/shell_resolver.mojom.h"
#include "mojo/shell/application_loader.h"
@@ -186,14 +186,14 @@ class ApplicationManager : public ShellClient,
// Counter used to assign ids to content handlers.
uint32_t shell_client_factory_id_counter_;
- WeakInterfacePtrSet<mojom::ApplicationManagerListener> listeners_;
+ InterfacePtrSet<mojom::ApplicationManagerListener> listeners_;
base::Callback<void(const Identity&)> instance_quit_callback_;
base::TaskRunner* file_task_runner_;
scoped_ptr<NativeRunnerFactory> native_runner_factory_;
std::vector<scoped_ptr<NativeRunner>> native_runners_;
scoped_ptr<ShellConnection> shell_connection_;
- WeakBindingSet<mojom::ApplicationManager> bindings_;
+ BindingSet<mojom::ApplicationManager> bindings_;
base::WeakPtrFactory<ApplicationManager> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(ApplicationManager);
diff --git a/mojo/shell/background/tests/test_service.cc b/mojo/shell/background/tests/test_service.cc
index 3c9dbbd..4d001af 100644
--- a/mojo/shell/background/tests/test_service.cc
+++ b/mojo/shell/background/tests/test_service.cc
@@ -3,7 +3,7 @@
// found in the LICENSE file.
#include "mojo/public/c/system/main.h"
-#include "mojo/public/cpp/bindings/weak_binding_set.h"
+#include "mojo/public/cpp/bindings/binding_set.h"
#include "mojo/shell/background/tests/test.mojom.h"
#include "mojo/shell/public/cpp/application_runner.h"
#include "mojo/shell/public/cpp/connection.h"
@@ -39,7 +39,7 @@ class TestClient : public ShellClient,
// mojom::TestService
void Test(const TestCallback& callback) override { callback.Run(); }
- WeakBindingSet<mojom::TestService> bindings_;
+ BindingSet<mojom::TestService> bindings_;
DISALLOW_COPY_AND_ASSIGN(TestClient);
};
diff --git a/mojo/shell/runner/child/native_apptest_target.cc b/mojo/shell/runner/child/native_apptest_target.cc
index d2747c5..04ebdbb 100644
--- a/mojo/shell/runner/child/native_apptest_target.cc
+++ b/mojo/shell/runner/child/native_apptest_target.cc
@@ -7,7 +7,7 @@
#include "base/at_exit.h"
#include "base/command_line.h"
#include "base/macros.h"
-#include "mojo/public/cpp/bindings/weak_binding_set.h"
+#include "mojo/public/cpp/bindings/binding_set.h"
#include "mojo/shell/public/cpp/connection.h"
#include "mojo/shell/public/cpp/interface_factory.h"
#include "mojo/shell/public/cpp/shell.h"
@@ -47,7 +47,7 @@ class TargetApplicationDelegate
bindings_.AddBinding(this, std::move(request));
}
- mojo::WeakBindingSet<mojo::shell::test::TestNativeService> bindings_;
+ mojo::BindingSet<mojo::shell::test::TestNativeService> bindings_;
DISALLOW_COPY_AND_ASSIGN(TargetApplicationDelegate);
};
diff --git a/mojo/shell/tests/application_manager_apptest.cc b/mojo/shell/tests/application_manager_apptest.cc
index 9ebc076..82fa8bc 100644
--- a/mojo/shell/tests/application_manager_apptest.cc
+++ b/mojo/shell/tests/application_manager_apptest.cc
@@ -11,7 +11,7 @@
#include "base/macros.h"
#include "base/message_loop/message_loop.h"
#include "base/process/process_handle.h"
-#include "mojo/public/cpp/bindings/weak_binding_set.h"
+#include "mojo/public/cpp/bindings/binding_set.h"
#include "mojo/shell/public/cpp/application_test_base.h"
#include "mojo/shell/public/cpp/interface_factory.h"
#include "mojo/shell/public/cpp/shell.h"
diff --git a/mojo/shell/tests/application_manager_apptest_driver.cc b/mojo/shell/tests/application_manager_apptest_driver.cc
index aad9660..2a820fe 100644
--- a/mojo/shell/tests/application_manager_apptest_driver.cc
+++ b/mojo/shell/tests/application_manager_apptest_driver.cc
@@ -21,7 +21,7 @@
#include "mojo/edk/embedder/embedder.h"
#include "mojo/edk/embedder/platform_channel_pair.h"
#include "mojo/edk/embedder/scoped_platform_handle.h"
-#include "mojo/public/cpp/bindings/weak_binding_set.h"
+#include "mojo/public/cpp/bindings/binding_set.h"
#include "mojo/shell/public/cpp/connection.h"
#include "mojo/shell/public/cpp/interface_factory.h"
#include "mojo/shell/public/cpp/shell.h"
@@ -136,7 +136,7 @@ class TargetApplicationDelegate : public mojo::ShellClient,
mojo::Shell* shell_;
base::Process target_;
- mojo::WeakBindingSet<Driver> bindings_;
+ mojo::BindingSet<Driver> bindings_;
base::WeakPtrFactory<TargetApplicationDelegate> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(TargetApplicationDelegate);
diff --git a/mojo/shell/tests/capability_filter_test.cc b/mojo/shell/tests/capability_filter_test.cc
index 32257ee..3fac67c 100644
--- a/mojo/shell/tests/capability_filter_test.cc
+++ b/mojo/shell/tests/capability_filter_test.cc
@@ -9,8 +9,8 @@
#include "base/macros.h"
#include "base/stl_util.h"
#include "base/strings/stringprintf.h"
+#include "mojo/public/cpp/bindings/binding_set.h"
#include "mojo/public/cpp/bindings/strong_binding.h"
-#include "mojo/public/cpp/bindings/weak_binding_set.h"
#include "mojo/services/package_manager/package_manager.h"
#include "mojo/shell/application_loader.h"
#include "mojo/shell/public/cpp/connection.h"
@@ -98,7 +98,7 @@ class ConnectionValidator : public ApplicationLoader,
std::set<std::string> expectations_;
std::set<std::string> unexpected_;
base::MessageLoop* loop_;
- WeakBindingSet<Validator> validator_bindings_;
+ BindingSet<Validator> validator_bindings_;
DISALLOW_COPY_AND_ASSIGN(ConnectionValidator);
};
@@ -151,8 +151,8 @@ class ServiceApplication : public ShellClient,
Shell* shell_;
ValidatorPtr validator_;
- WeakBindingSet<Safe> safe_bindings_;
- WeakBindingSet<Unsafe> unsafe_bindings_;
+ BindingSet<Safe> safe_bindings_;
+ BindingSet<Unsafe> unsafe_bindings_;
DISALLOW_COPY_AND_ASSIGN(ServiceApplication);
};
diff --git a/mojo/shell/tests/package_test_package.cc b/mojo/shell/tests/package_test_package.cc
index a9defe4..ee8ff5b 100644
--- a/mojo/shell/tests/package_test_package.cc
+++ b/mojo/shell/tests/package_test_package.cc
@@ -12,7 +12,7 @@
#include "base/run_loop.h"
#include "base/threading/simple_thread.h"
#include "mojo/public/c/system/main.h"
-#include "mojo/public/cpp/bindings/weak_binding_set.h"
+#include "mojo/public/cpp/bindings/binding_set.h"
#include "mojo/shell/public/cpp/application_runner.h"
#include "mojo/shell/public/cpp/interface_factory.h"
#include "mojo/shell/public/cpp/shell.h"
@@ -88,7 +88,7 @@ class ProvidedShellClient
const std::string name_;
mojom::ShellClientRequest request_;
Shell* shell_;
- WeakBindingSet<test::mojom::PackageTestService> bindings_;
+ BindingSet<test::mojom::PackageTestService> bindings_;
DISALLOW_COPY_AND_ASSIGN(ProvidedShellClient);
};
@@ -151,8 +151,8 @@ class PackageTestShellClient
Shell* shell_;
std::vector<scoped_ptr<ShellClient>> delegates_;
- WeakBindingSet<mojom::ShellClientFactory> shell_client_factory_bindings_;
- WeakBindingSet<test::mojom::PackageTestService> bindings_;
+ BindingSet<mojom::ShellClientFactory> shell_client_factory_bindings_;
+ BindingSet<test::mojom::PackageTestService> bindings_;
DISALLOW_COPY_AND_ASSIGN(PackageTestShellClient);
};