| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "services/service_manager/public/c/main.h" | |
| 10 #include "services/service_manager/public/cpp/connection.h" | 9 #include "services/service_manager/public/cpp/connection.h" |
| 11 #include "services/service_manager/public/cpp/connector.h" | 10 #include "services/service_manager/public/cpp/connector.h" |
| 12 #include "services/service_manager/public/cpp/service.h" | 11 #include "services/service_manager/public/cpp/service.h" |
| 13 #include "services/service_manager/public/cpp/service_context.h" | 12 #include "services/service_manager/public/cpp/service_context.h" |
| 14 #include "services/service_manager/public/cpp/service_runner.h" | 13 #include "services/service_manager/runner/child/test_native_main.h" |
| 14 #include "services/service_manager/runner/init.h" |
| 15 #include "services/service_manager/tests/service_manager/service_manager_unittes
t.mojom.h" | 15 #include "services/service_manager/tests/service_manager/service_manager_unittes
t.mojom.h" |
| 16 | 16 |
| 17 using service_manager::test::mojom::CreateInstanceTestPtr; | 17 using service_manager::test::mojom::CreateInstanceTestPtr; |
| 18 | 18 |
| 19 namespace { | 19 namespace { |
| 20 | 20 |
| 21 class Target : public service_manager::Service { | 21 class Target : public service_manager::Service { |
| 22 public: | 22 public: |
| 23 Target() {} | 23 Target() {} |
| 24 ~Target() override {} | 24 ~Target() override {} |
| (...skipping 10 matching lines...) Expand all Loading... |
| 35 bool OnConnect(const service_manager::ServiceInfo& remote_info, | 35 bool OnConnect(const service_manager::ServiceInfo& remote_info, |
| 36 service_manager::InterfaceRegistry* registry) override { | 36 service_manager::InterfaceRegistry* registry) override { |
| 37 return false; | 37 return false; |
| 38 } | 38 } |
| 39 | 39 |
| 40 DISALLOW_COPY_AND_ASSIGN(Target); | 40 DISALLOW_COPY_AND_ASSIGN(Target); |
| 41 }; | 41 }; |
| 42 | 42 |
| 43 } // namespace | 43 } // namespace |
| 44 | 44 |
| 45 MojoResult ServiceMain(MojoHandle service_request_handle) { | 45 int main(int argc, char** argv) { |
| 46 service_manager::ServiceRunner runner(new Target); | 46 base::AtExitManager at_exit; |
| 47 return runner.Run(service_request_handle); | 47 base::CommandLine::Init(argc, argv); |
| 48 |
| 49 service_manager::InitializeLogging(); |
| 50 return service_manager::TestNativeMain(base::MakeUnique<Target>()); |
| 48 } | 51 } |
| OLD | NEW |