| 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 <stdint.h> | 5 #include <stdint.h> |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 callback.Run(true); | 88 callback.Run(true); |
| 89 } | 89 } |
| 90 | 90 |
| 91 private: | 91 private: |
| 92 std::map<uint64_t, EmployeeInfo*> employees_; | 92 std::map<uint64_t, EmployeeInfo*> employees_; |
| 93 | 93 |
| 94 StrongBinding<HumanResourceDatabase> strong_binding_; | 94 StrongBinding<HumanResourceDatabase> strong_binding_; |
| 95 }; | 95 }; |
| 96 | 96 |
| 97 class HumanResourceSystemServer | 97 class HumanResourceSystemServer |
| 98 : public shell::Service, | 98 : public service_manager::Service, |
| 99 public InterfaceFactory<HumanResourceDatabase> { | 99 public InterfaceFactory<HumanResourceDatabase> { |
| 100 public: | 100 public: |
| 101 HumanResourceSystemServer() {} | 101 HumanResourceSystemServer() {} |
| 102 | 102 |
| 103 // shell::Service implementation. | 103 // service_manager::Service implementation. |
| 104 bool OnConnect(Connection* connection) override { | 104 bool OnConnect(Connection* connection) override { |
| 105 connection->AddInterface<HumanResourceDatabase>(this); | 105 connection->AddInterface<HumanResourceDatabase>(this); |
| 106 return true; | 106 return true; |
| 107 } | 107 } |
| 108 | 108 |
| 109 // InterfaceFactory<HumanResourceDatabase> implementation. | 109 // InterfaceFactory<HumanResourceDatabase> implementation. |
| 110 void Create(Connection* connection, | 110 void Create(Connection* connection, |
| 111 InterfaceRequest<HumanResourceDatabase> request) override { | 111 InterfaceRequest<HumanResourceDatabase> request) override { |
| 112 // It will be deleted automatically when the underlying pipe encounters a | 112 // It will be deleted automatically when the underlying pipe encounters a |
| 113 // connection error. | 113 // connection error. |
| 114 new HumanResourceDatabaseImpl(std::move(request)); | 114 new HumanResourceDatabaseImpl(std::move(request)); |
| 115 } | 115 } |
| 116 }; | 116 }; |
| 117 | 117 |
| 118 } // namespace versioning | 118 } // namespace versioning |
| 119 } // namespace test | 119 } // namespace test |
| 120 } // namespace mojo | 120 } // namespace mojo |
| 121 | 121 |
| 122 MojoResult ServiceMain(MojoHandle request) { | 122 MojoResult ServiceMain(MojoHandle request) { |
| 123 mojo::ServiceRunner runner( | 123 mojo::ServiceRunner runner( |
| 124 new mojo::test::versioning::HumanResourceSystemServer()); | 124 new mojo::test::versioning::HumanResourceSystemServer()); |
| 125 | 125 |
| 126 return runner.Run(request); | 126 return runner.Run(request); |
| 127 } | 127 } |
| OLD | NEW |