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

Side by Side Diff: services/shell/tests/lifecycle/parent.cc

Issue 2182643003: Remove shell::Connection* parameter to InterfaceFactory<T>::Create() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 4 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 unified diff | Download patch
« no previous file with comments | « services/shell/tests/lifecycle/package.cc ('k') | services/shell/tests/shell/driver.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <memory> 5 #include <memory>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "mojo/public/c/system/main.h" 10 #include "mojo/public/c/system/main.h"
(...skipping 26 matching lines...) Expand all
37 const shell::Identity& identity, 37 const shell::Identity& identity,
38 uint32_t id) override { 38 uint32_t id) override {
39 connector_ = connector; 39 connector_ = connector;
40 } 40 }
41 bool OnConnect(shell::Connection* connection) override { 41 bool OnConnect(shell::Connection* connection) override {
42 connection->AddInterface<shell::test::mojom::Parent>(this); 42 connection->AddInterface<shell::test::mojom::Parent>(this);
43 return true; 43 return true;
44 } 44 }
45 45
46 // InterfaceFactory<shell::test::mojom::Parent>: 46 // InterfaceFactory<shell::test::mojom::Parent>:
47 void Create(shell::Connection* connection, 47 void Create(const shell::Identity& remote_identity,
48 shell::test::mojom::ParentRequest request) override { 48 shell::test::mojom::ParentRequest request) override {
49 parent_bindings_.AddBinding(this, std::move(request)); 49 parent_bindings_.AddBinding(this, std::move(request));
50 } 50 }
51 51
52 // Parent: 52 // Parent:
53 void ConnectToChild(const ConnectToChildCallback& callback) override { 53 void ConnectToChild(const ConnectToChildCallback& callback) override {
54 child_connection_ = connector_->Connect("mojo:lifecycle_unittest_app"); 54 child_connection_ = connector_->Connect("mojo:lifecycle_unittest_app");
55 shell::test::mojom::LifecycleControlPtr lifecycle; 55 shell::test::mojom::LifecycleControlPtr lifecycle;
56 child_connection_->GetInterface(&lifecycle); 56 child_connection_->GetInterface(&lifecycle);
57 { 57 {
(...skipping 15 matching lines...) Expand all
73 73
74 DISALLOW_COPY_AND_ASSIGN(Parent); 74 DISALLOW_COPY_AND_ASSIGN(Parent);
75 }; 75 };
76 76
77 } // namespace 77 } // namespace
78 78
79 MojoResult MojoMain(MojoHandle shell_handle) { 79 MojoResult MojoMain(MojoHandle shell_handle) {
80 Parent* parent = new Parent; 80 Parent* parent = new Parent;
81 return shell::ServiceRunner(parent).Run(shell_handle); 81 return shell::ServiceRunner(parent).Run(shell_handle);
82 } 82 }
OLDNEW
« no previous file with comments | « services/shell/tests/lifecycle/package.cc ('k') | services/shell/tests/shell/driver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698