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

Side by Side Diff: shell/test/pingable_app.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 | « shell/application_manager/application_manager_unittest.cc ('k') | no next file » | 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 <memory> 5 #include <memory>
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_delegate.h" 8 #include "mojo/public/cpp/application/application_delegate.h"
9 #include "mojo/public/cpp/application/application_impl.h" 9 #include "mojo/public/cpp/application/application_impl.h"
10 #include "mojo/public/cpp/application/application_runner.h" 10 #include "mojo/public/cpp/application/application_runner.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 PingableApp() {} 43 PingableApp() {}
44 ~PingableApp() override {} 44 ~PingableApp() override {}
45 45
46 private: 46 private:
47 // ApplicationDelegate: 47 // ApplicationDelegate:
48 void Initialize(mojo::ApplicationImpl* impl) override { 48 void Initialize(mojo::ApplicationImpl* impl) override {
49 app_url_ = impl->url(); 49 app_url_ = impl->url();
50 } 50 }
51 51
52 bool ConfigureIncomingConnection( 52 bool ConfigureIncomingConnection(
53 mojo::ApplicationConnection* connection) override { 53 mojo::ServiceProviderImpl* service_provider_impl) override {
54 connection->GetServiceProviderImpl().AddService<Pingable>( 54 service_provider_impl->AddService<Pingable>(
55 [this](const mojo::ConnectionContext& connection_context, 55 [this](const mojo::ConnectionContext& connection_context,
56 mojo::InterfaceRequest<Pingable> pingable_request) { 56 mojo::InterfaceRequest<Pingable> pingable_request) {
57 new PingableImpl(pingable_request.Pass(), app_url_, 57 new PingableImpl(pingable_request.Pass(), app_url_,
58 connection_context.connection_url); 58 connection_context.connection_url);
59 }); 59 });
60 return true; 60 return true;
61 } 61 }
62 62
63 std::string app_url_; 63 std::string app_url_;
64 }; 64 };
65 65
66 MojoResult MojoMain(MojoHandle application_request) { 66 MojoResult MojoMain(MojoHandle application_request) {
67 mojo::ApplicationRunner runner( 67 mojo::ApplicationRunner runner(
68 std::unique_ptr<PingableApp>(new PingableApp())); 68 std::unique_ptr<PingableApp>(new PingableApp()));
69 return runner.Run(application_request); 69 return runner.Run(application_request);
70 } 70 }
OLDNEW
« no previous file with comments | « shell/application_manager/application_manager_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698