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 | 6 |
7 #include "mojo/public/c/system/main.h" | 7 #include "mojo/public/c/system/main.h" |
8 #include "mojo/public/cpp/application/application_connection.h" | 8 #include "mojo/public/cpp/application/application_connection.h" |
9 #include "mojo/public/cpp/application/application_delegate.h" | 9 #include "mojo/public/cpp/application/application_delegate.h" |
10 #include "mojo/public/cpp/application/application_runner.h" | 10 #include "mojo/public/cpp/application/application_runner.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 public: | 32 public: |
33 explicit HumanResourceDatabaseImpl( | 33 explicit HumanResourceDatabaseImpl( |
34 InterfaceRequest<HumanResourceDatabase> request) | 34 InterfaceRequest<HumanResourceDatabase> request) |
35 : strong_binding_(this, request.Pass()) { | 35 : strong_binding_(this, request.Pass()) { |
36 // Pretend that there is already some data in the system. | 36 // Pretend that there is already some data in the system. |
37 EmployeeInfo* info = new EmployeeInfo(); | 37 EmployeeInfo* info = new EmployeeInfo(); |
38 employees_[1] = info; | 38 employees_[1] = info; |
39 info->employee = Employee::New(); | 39 info->employee = Employee::New(); |
40 info->employee->employee_id = 1; | 40 info->employee->employee_id = 1; |
41 info->employee->name = "Homer Simpson"; | 41 info->employee->name = "Homer Simpson"; |
42 info->employee->department = DEPARTMENT_DEV; | 42 info->employee->department = Department::DEV; |
43 info->employee->birthday = Date::New(); | 43 info->employee->birthday = Date::New(); |
44 info->employee->birthday->year = 1955; | 44 info->employee->birthday->year = 1955; |
45 info->employee->birthday->month = 5; | 45 info->employee->birthday->month = 5; |
46 info->employee->birthday->day = 12; | 46 info->employee->birthday->day = 12; |
47 info->finger_print.resize(1024); | 47 info->finger_print.resize(1024); |
48 for (uint32_t i = 0; i < 1024; ++i) | 48 for (uint32_t i = 0; i < 1024; ++i) |
49 info->finger_print[i] = i; | 49 info->finger_print[i] = i; |
50 } | 50 } |
51 | 51 |
52 ~HumanResourceDatabaseImpl() override { | 52 ~HumanResourceDatabaseImpl() override { |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 } // namespace versioning | 116 } // namespace versioning |
117 } // namespace test | 117 } // namespace test |
118 } // namespace mojo | 118 } // namespace mojo |
119 | 119 |
120 MojoResult MojoMain(MojoHandle application_request) { | 120 MojoResult MojoMain(MojoHandle application_request) { |
121 mojo::ApplicationRunner runner( | 121 mojo::ApplicationRunner runner( |
122 new mojo::test::versioning::HumanResourceSystemServer()); | 122 new mojo::test::versioning::HumanResourceSystemServer()); |
123 | 123 |
124 return runner.Run(application_request); | 124 return runner.Run(application_request); |
125 } | 125 } |
OLD | NEW |