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 <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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 app_url_ = impl->url(); | 51 app_url_ = impl->url(); |
52 } | 52 } |
53 | 53 |
54 bool ConfigureIncomingConnection( | 54 bool ConfigureIncomingConnection( |
55 mojo::ApplicationConnection* connection) override { | 55 mojo::ApplicationConnection* connection) override { |
56 connection->AddService(this); | 56 connection->AddService(this); |
57 return true; | 57 return true; |
58 } | 58 } |
59 | 59 |
60 // InterfaceFactory<Pingable>: | 60 // InterfaceFactory<Pingable>: |
61 void Create(mojo::ApplicationConnection* connection, | 61 void Create(const mojo::ConnectionContext& connection_context, |
62 mojo::InterfaceRequest<Pingable> request) override { | 62 mojo::InterfaceRequest<Pingable> request) override { |
63 new PingableImpl(request.Pass(), app_url_, connection->GetConnectionURL()); | 63 new PingableImpl(request.Pass(), app_url_, |
| 64 connection_context.connection_url); |
64 } | 65 } |
65 | 66 |
66 std::string app_url_; | 67 std::string app_url_; |
67 }; | 68 }; |
68 | 69 |
69 MojoResult MojoMain(MojoHandle application_request) { | 70 MojoResult MojoMain(MojoHandle application_request) { |
70 mojo::ApplicationRunner runner( | 71 mojo::ApplicationRunner runner( |
71 std::unique_ptr<PingableApp>(new PingableApp())); | 72 std::unique_ptr<PingableApp>(new PingableApp())); |
72 return runner.Run(application_request); | 73 return runner.Run(application_request); |
73 } | 74 } |
OLD | NEW |