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 <map> | 5 #include <map> |
6 #include <memory> | 6 #include <memory> |
7 | 7 |
8 #include "mojo/public/c/system/main.h" | 8 #include "mojo/public/c/system/main.h" |
9 #include "mojo/public/cpp/application/application_connection.h" | 9 #include "mojo/public/cpp/application/application_connection.h" |
10 #include "mojo/public/cpp/application/application_delegate.h" | 10 #include "mojo/public/cpp/application/application_delegate.h" |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 public: | 99 public: |
100 HumanResourceSystemServer() {} | 100 HumanResourceSystemServer() {} |
101 | 101 |
102 // ApplicationDelegate implementation. | 102 // ApplicationDelegate implementation. |
103 bool ConfigureIncomingConnection(ApplicationConnection* connection) override { | 103 bool ConfigureIncomingConnection(ApplicationConnection* connection) override { |
104 connection->AddService<HumanResourceDatabase>(this); | 104 connection->AddService<HumanResourceDatabase>(this); |
105 return true; | 105 return true; |
106 } | 106 } |
107 | 107 |
108 // InterfaceFactory<HumanResourceDatabase> implementation. | 108 // InterfaceFactory<HumanResourceDatabase> implementation. |
109 void Create(ApplicationConnection* connection, | 109 void Create(const ConnectionContext& connection_context, |
110 InterfaceRequest<HumanResourceDatabase> request) override { | 110 InterfaceRequest<HumanResourceDatabase> request) override { |
111 // It will be deleted automatically when the underlying pipe encounters a | 111 // It will be deleted automatically when the underlying pipe encounters a |
112 // connection error. | 112 // connection error. |
113 new HumanResourceDatabaseImpl(request.Pass()); | 113 new HumanResourceDatabaseImpl(request.Pass()); |
114 } | 114 } |
115 }; | 115 }; |
116 | 116 |
117 } // namespace versioning | 117 } // namespace versioning |
118 } // namespace test | 118 } // namespace test |
119 } // namespace mojo | 119 } // namespace mojo |
120 | 120 |
121 MojoResult MojoMain(MojoHandle application_request) { | 121 MojoResult MojoMain(MojoHandle application_request) { |
122 mojo::ApplicationRunner runner( | 122 mojo::ApplicationRunner runner( |
123 std::unique_ptr<mojo::test::versioning::HumanResourceSystemServer>( | 123 std::unique_ptr<mojo::test::versioning::HumanResourceSystemServer>( |
124 new mojo::test::versioning::HumanResourceSystemServer())); | 124 new mojo::test::versioning::HumanResourceSystemServer())); |
125 | 125 |
126 return runner.Run(application_request); | 126 return runner.Run(application_request); |
127 } | 127 } |
OLD | NEW |