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 <utility> |
| 6 |
5 #include "base/at_exit.h" | 7 #include "base/at_exit.h" |
6 #include "base/command_line.h" | 8 #include "base/command_line.h" |
7 #include "mojo/application/public/cpp/application_connection.h" | 9 #include "mojo/application/public/cpp/application_connection.h" |
8 #include "mojo/application/public/cpp/application_delegate.h" | 10 #include "mojo/application/public/cpp/application_delegate.h" |
9 #include "mojo/application/public/cpp/application_impl.h" | 11 #include "mojo/application/public/cpp/application_impl.h" |
10 #include "mojo/application/public/cpp/interface_factory.h" | 12 #include "mojo/application/public/cpp/interface_factory.h" |
11 #include "mojo/common/weak_binding_set.h" | 13 #include "mojo/common/weak_binding_set.h" |
12 #include "mojo/runner/child/test_native_main.h" | 14 #include "mojo/runner/child/test_native_main.h" |
13 #include "mojo/runner/child/test_native_service.mojom.h" | 15 #include "mojo/runner/child/test_native_service.mojom.h" |
14 #include "mojo/runner/init.h" | 16 #include "mojo/runner/init.h" |
(...skipping 19 matching lines...) Expand all Loading... |
34 | 36 |
35 // mojo::runner::test::TestNativeService: | 37 // mojo::runner::test::TestNativeService: |
36 void Invert(bool from_driver, const InvertCallback& callback) override { | 38 void Invert(bool from_driver, const InvertCallback& callback) override { |
37 callback.Run(!from_driver); | 39 callback.Run(!from_driver); |
38 } | 40 } |
39 | 41 |
40 // mojo::InterfaceFactory<mojo::runner::test::TestNativeService>: | 42 // mojo::InterfaceFactory<mojo::runner::test::TestNativeService>: |
41 void Create(mojo::ApplicationConnection* connection, | 43 void Create(mojo::ApplicationConnection* connection, |
42 mojo::InterfaceRequest<mojo::runner::test::TestNativeService> | 44 mojo::InterfaceRequest<mojo::runner::test::TestNativeService> |
43 request) override { | 45 request) override { |
44 bindings_.AddBinding(this, request.Pass()); | 46 bindings_.AddBinding(this, std::move(request)); |
45 } | 47 } |
46 | 48 |
47 mojo::WeakBindingSet<mojo::runner::test::TestNativeService> bindings_; | 49 mojo::WeakBindingSet<mojo::runner::test::TestNativeService> bindings_; |
48 | 50 |
49 DISALLOW_COPY_AND_ASSIGN(TargetApplicationDelegate); | 51 DISALLOW_COPY_AND_ASSIGN(TargetApplicationDelegate); |
50 }; | 52 }; |
51 | 53 |
52 } // namespace | 54 } // namespace |
53 | 55 |
54 int main(int argc, char** argv) { | 56 int main(int argc, char** argv) { |
55 base::AtExitManager at_exit; | 57 base::AtExitManager at_exit; |
56 base::CommandLine::Init(argc, argv); | 58 base::CommandLine::Init(argc, argv); |
57 | 59 |
58 mojo::runner::InitializeLogging(); | 60 mojo::runner::InitializeLogging(); |
59 | 61 |
60 TargetApplicationDelegate delegate; | 62 TargetApplicationDelegate delegate; |
61 return mojo::runner::TestNativeMain(&delegate); | 63 return mojo::runner::TestNativeMain(&delegate); |
62 } | 64 } |
OLD | NEW |