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

Side by Side Diff: examples/bank_app/bank.cc

Issue 1975993002: Change InterfaceFactory<I>::Create() to take a ConnectionContext instead of an ApplicationConnectio… (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
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 <memory> 5 #include <memory>
6 6
7 #include "examples/bank_app/bank.mojom.h" 7 #include "examples/bank_app/bank.mojom.h"
8 #include "mojo/common/binding_set.h" 8 #include "mojo/common/binding_set.h"
9 #include "mojo/public/c/system/main.h" 9 #include "mojo/public/c/system/main.h"
10 #include "mojo/public/cpp/application/application_connection.h" 10 #include "mojo/public/cpp/application/application_connection.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 if (user.empty()) { 75 if (user.empty()) {
76 MOJO_LOG(INFO) << "Rejecting customer without a user identity"; 76 MOJO_LOG(INFO) << "Rejecting customer without a user identity";
77 return false; 77 return false;
78 } 78 }
79 MOJO_LOG(INFO) << "Customer " << user << " accessing bank"; 79 MOJO_LOG(INFO) << "Customer " << user << " accessing bank";
80 } 80 }
81 connection->AddService(this); 81 connection->AddService(this);
82 return true; 82 return true;
83 } 83 }
84 84
85 void Create(mojo::ApplicationConnection* connection, 85 void Create(const mojo::ConnectionContext& connection_context,
86 mojo::InterfaceRequest<Bank> request) override { 86 mojo::InterfaceRequest<Bank> request) override {
87 bindings_.AddBinding(&bank_impl_, request.Pass()); 87 bindings_.AddBinding(&bank_impl_, request.Pass());
88 } 88 }
89 89
90 private: 90 private:
91 BankImpl bank_impl_; 91 BankImpl bank_impl_;
92 mojo::BindingSet<Bank> bindings_; 92 mojo::BindingSet<Bank> bindings_;
93 vanadium::PrincipalServicePtr login_service_; 93 vanadium::PrincipalServicePtr login_service_;
94 }; 94 };
95 95
96 } // namespace examples 96 } // namespace examples
97 97
98 MojoResult MojoMain(MojoHandle application_request) { 98 MojoResult MojoMain(MojoHandle application_request) {
99 mojo::ApplicationRunner runner( 99 mojo::ApplicationRunner runner(
100 std::unique_ptr<examples::BankApp>(new examples::BankApp())); 100 std::unique_ptr<examples::BankApp>(new examples::BankApp()));
101 return runner.Run(application_request); 101 return runner.Run(application_request);
102 } 102 }
OLDNEW
« no previous file with comments | « examples/apptest/example_service_application.cc ('k') | examples/content_handler_demo/content_handler_demo.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698