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

Unified Diff: mojo/public/cpp/bindings/tests/handle_passing_unittest.cc

Issue 2326913003: Privatize StrongBinding lifetime management (Closed)
Patch Set: rebase Created 4 years, 3 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
Index: mojo/public/cpp/bindings/tests/handle_passing_unittest.cc
diff --git a/mojo/public/cpp/bindings/tests/handle_passing_unittest.cc b/mojo/public/cpp/bindings/tests/handle_passing_unittest.cc
index 0bd9b283b66dd6756e0329dd9938ea184789f620..feeeef2803568ec0dbb726d35bf9478baa0a6ce4 100644
--- a/mojo/public/cpp/bindings/tests/handle_passing_unittest.cc
+++ b/mojo/public/cpp/bindings/tests/handle_passing_unittest.cc
@@ -56,8 +56,8 @@ int ImportedInterfaceImpl::do_something_count_ = 0;
class SampleNamedObjectImpl : public sample::NamedObject {
public:
- explicit SampleNamedObjectImpl(InterfaceRequest<sample::NamedObject> request)
- : binding_(this, std::move(request)) {}
+ SampleNamedObjectImpl() {}
+
void SetName(const std::string& name) override { name_ = name; }
void GetName(const GetNameCallback& callback) override {
@@ -66,7 +66,6 @@ class SampleNamedObjectImpl : public sample::NamedObject {
private:
std::string name_;
- StrongBinding<sample::NamedObject> binding_;
};
class SampleFactoryImpl : public sample::Factory {
@@ -133,7 +132,8 @@ class SampleFactoryImpl : public sample::Factory {
void CreateNamedObject(
InterfaceRequest<sample::NamedObject> object_request) override {
EXPECT_TRUE(object_request.is_pending());
- new SampleNamedObjectImpl(std::move(object_request));
+ MakeStrongBinding(base::MakeUnique<SampleNamedObjectImpl>(),
+ std::move(object_request));
}
// These aren't called or implemented, but exist here to test that the
« no previous file with comments | « mojo/public/cpp/bindings/tests/e2e_perftest.cc ('k') | mojo/public/cpp/bindings/tests/interface_ptr_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698