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

Unified Diff: services/shell/tests/lifecycle/parent.cc

Issue 2179023004: Make Service own ServiceContext. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 5 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
« no previous file with comments | « services/shell/tests/lifecycle/lifecycle_unittest.cc ('k') | services/shell/tests/shell/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/shell/tests/lifecycle/parent.cc
diff --git a/services/shell/tests/lifecycle/parent.cc b/services/shell/tests/lifecycle/parent.cc
index da22f5a0ceffee9b2cc2d164f7e8e566b6e88844..0fd49334c83181def930153481baf7e17da400cd 100644
--- a/services/shell/tests/lifecycle/parent.cc
+++ b/services/shell/tests/lifecycle/parent.cc
@@ -26,18 +26,12 @@ class Parent : public shell::Service,
public:
Parent() {}
~Parent() override {
- connector_ = nullptr;
child_connection_.reset();
parent_bindings_.CloseAllBindings();
}
private:
// Service:
- void OnStart(shell::Connector* connector,
- const shell::Identity& identity,
- uint32_t id) override {
- connector_ = connector;
- }
bool OnConnect(shell::Connection* connection) override {
connection->AddInterface<shell::test::mojom::Parent>(this);
return true;
@@ -51,7 +45,7 @@ class Parent : public shell::Service,
// Parent:
void ConnectToChild(const ConnectToChildCallback& callback) override {
- child_connection_ = connector_->Connect("mojo:lifecycle_unittest_app");
+ child_connection_ = connector()->Connect("mojo:lifecycle_unittest_app");
shell::test::mojom::LifecycleControlPtr lifecycle;
child_connection_->GetInterface(&lifecycle);
{
@@ -67,7 +61,6 @@ class Parent : public shell::Service,
base::MessageLoop::current()->QuitWhenIdle();
}
- shell::Connector* connector_;
std::unique_ptr<shell::Connection> child_connection_;
mojo::BindingSet<shell::test::mojom::Parent> parent_bindings_;
« no previous file with comments | « services/shell/tests/lifecycle/lifecycle_unittest.cc ('k') | services/shell/tests/shell/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698