OLD | NEW |
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 "base/at_exit.h" | 5 #include "base/at_exit.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "base/process/process.h" | 8 #include "base/process/process.h" |
9 #include "mojo/public/cpp/bindings/binding_set.h" | 9 #include "mojo/public/cpp/bindings/binding_set.h" |
10 #include "mojo/shell/public/cpp/connection.h" | 10 #include "mojo/shell/public/cpp/connection.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 private: | 30 private: |
31 // mojo::ShellClient: | 31 // mojo::ShellClient: |
32 void Initialize(mojo::Connector* connector, const mojo::Identity& identity, | 32 void Initialize(mojo::Connector* connector, const mojo::Identity& identity, |
33 uint32_t id) override { | 33 uint32_t id) override { |
34 connector_ = connector; | 34 connector_ = connector; |
35 } | 35 } |
36 bool AcceptConnection(mojo::Connection* connection) override { | 36 bool AcceptConnection(mojo::Connection* connection) override { |
37 connection->AddInterface<ClientProcessTest>(this); | 37 connection->AddInterface<ClientProcessTest>(this); |
38 return true; | 38 return true; |
39 } | 39 } |
40 bool ShellConnectionLost() override { | 40 void ShellConnectionLost() override { |
41 // TODO(rockot): http://crbug.com/596621. Should be able to remove this | 41 // TODO: This should exit cleanly. |
42 // override entirely. | |
43 _exit(1); | 42 _exit(1); |
44 } | 43 } |
45 | 44 |
46 // mojo::InterfaceFactory<ConnectTestService>: | 45 // mojo::InterfaceFactory<ConnectTestService>: |
47 void Create(mojo::Connection* connection, | 46 void Create(mojo::Connection* connection, |
48 ClientProcessTestRequest request) override { | 47 ClientProcessTestRequest request) override { |
49 bindings_.AddBinding(this, std::move(request)); | 48 bindings_.AddBinding(this, std::move(request)); |
50 } | 49 } |
51 | 50 |
52 // test::mojom::ClientProcessTest: | 51 // test::mojom::ClientProcessTest: |
(...skipping 26 matching lines...) Expand all Loading... |
79 | 78 |
80 int main(int argc, char** argv) { | 79 int main(int argc, char** argv) { |
81 base::AtExitManager at_exit; | 80 base::AtExitManager at_exit; |
82 base::CommandLine::Init(argc, argv); | 81 base::CommandLine::Init(argc, argv); |
83 | 82 |
84 mojo::shell::InitializeLogging(); | 83 mojo::shell::InitializeLogging(); |
85 | 84 |
86 Driver driver; | 85 Driver driver; |
87 return mojo::shell::TestNativeMain(&driver); | 86 return mojo::shell::TestNativeMain(&driver); |
88 } | 87 } |
OLD | NEW |