Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(640)

Side by Side Diff: mojo/public/cpp/bindings/tests/versioning_test_service.cc

Issue 1979723002: ApplicationConnection devolution, part 3. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « mojo/public/cpp/application/lib/application_impl.cc ('k') | mojo/ui/content_viewer_app.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 std::map<uint64_t, EmployeeInfo*> employees_; 90 std::map<uint64_t, EmployeeInfo*> employees_;
91 91
92 StrongBinding<HumanResourceDatabase> strong_binding_; 92 StrongBinding<HumanResourceDatabase> strong_binding_;
93 }; 93 };
94 94
95 class HumanResourceSystemServer : public ApplicationDelegate { 95 class HumanResourceSystemServer : public ApplicationDelegate {
96 public: 96 public:
97 HumanResourceSystemServer() {} 97 HumanResourceSystemServer() {}
98 98
99 // ApplicationDelegate implementation. 99 // ApplicationDelegate implementation.
100 bool ConfigureIncomingConnection(ApplicationConnection* connection) override { 100 bool ConfigureIncomingConnection(
101 connection->GetServiceProviderImpl().AddService<HumanResourceDatabase>( 101 ServiceProviderImpl* service_provider_impl) override {
102 service_provider_impl->AddService<HumanResourceDatabase>(
102 [](const ConnectionContext& connection_context, 103 [](const ConnectionContext& connection_context,
103 InterfaceRequest<HumanResourceDatabase> hr_db_request) { 104 InterfaceRequest<HumanResourceDatabase> hr_db_request) {
104 // It will be deleted automatically when the underlying pipe 105 // It will be deleted automatically when the underlying pipe
105 // encounters a connection error. 106 // encounters a connection error.
106 new HumanResourceDatabaseImpl(hr_db_request.Pass()); 107 new HumanResourceDatabaseImpl(hr_db_request.Pass());
107 }); 108 });
108 return true; 109 return true;
109 } 110 }
110 }; 111 };
111 112
112 } // namespace versioning 113 } // namespace versioning
113 } // namespace test 114 } // namespace test
114 } // namespace mojo 115 } // namespace mojo
115 116
116 MojoResult MojoMain(MojoHandle application_request) { 117 MojoResult MojoMain(MojoHandle application_request) {
117 mojo::ApplicationRunner runner( 118 mojo::ApplicationRunner runner(
118 std::unique_ptr<mojo::test::versioning::HumanResourceSystemServer>( 119 std::unique_ptr<mojo::test::versioning::HumanResourceSystemServer>(
119 new mojo::test::versioning::HumanResourceSystemServer())); 120 new mojo::test::versioning::HumanResourceSystemServer()));
120 121
121 return runner.Run(application_request); 122 return runner.Run(application_request);
122 } 123 }
OLDNEW
« no previous file with comments | « mojo/public/cpp/application/lib/application_impl.cc ('k') | mojo/ui/content_viewer_app.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698