OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "mojo/public/cpp/application/application_impl.h" | 5 #include "mojo/public/cpp/application/application_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "mojo/public/cpp/application/application_delegate.h" | 9 #include "mojo/public/cpp/application/application_delegate.h" |
| 10 #include "mojo/public/cpp/application/connection_context.h" |
10 #include "mojo/public/cpp/application/lib/service_registry.h" | 11 #include "mojo/public/cpp/application/lib/service_registry.h" |
11 #include "mojo/public/cpp/bindings/interface_ptr.h" | 12 #include "mojo/public/cpp/bindings/interface_ptr.h" |
12 #include "mojo/public/cpp/bindings/interface_request.h" | 13 #include "mojo/public/cpp/bindings/interface_request.h" |
13 #include "mojo/public/cpp/environment/logging.h" | 14 #include "mojo/public/cpp/environment/logging.h" |
14 #include "mojo/public/cpp/system/message_pipe.h" | 15 #include "mojo/public/cpp/system/message_pipe.h" |
15 | 16 |
16 namespace mojo { | 17 namespace mojo { |
17 | 18 |
18 ApplicationImpl::ApplicationImpl(ApplicationDelegate* delegate, | 19 ApplicationImpl::ApplicationImpl(ApplicationDelegate* delegate, |
19 InterfaceRequest<Application> request) | 20 InterfaceRequest<Application> request) |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 const String& requestor_url, | 64 const String& requestor_url, |
64 InterfaceRequest<ServiceProvider> services, | 65 InterfaceRequest<ServiceProvider> services, |
65 InterfaceHandle<ServiceProvider> exposed_services, | 66 InterfaceHandle<ServiceProvider> exposed_services, |
66 const String& url) { | 67 const String& url) { |
67 // Note: The shell no longer actually connects |exposed_services|, so a) we | 68 // Note: The shell no longer actually connects |exposed_services|, so a) we |
68 // never actually get valid |exposed_services| here, b) it should be OK to | 69 // never actually get valid |exposed_services| here, b) it should be OK to |
69 // drop it on the floor. | 70 // drop it on the floor. |
70 MOJO_LOG_IF(ERROR, exposed_services) | 71 MOJO_LOG_IF(ERROR, exposed_services) |
71 << "DEPRECATED: exposed_services is going away"; | 72 << "DEPRECATED: exposed_services is going away"; |
72 std::unique_ptr<internal::ServiceRegistry> registry( | 73 std::unique_ptr<internal::ServiceRegistry> registry( |
73 new internal::ServiceRegistry(url, requestor_url, services.Pass())); | 74 new internal::ServiceRegistry( |
| 75 ConnectionContext(ConnectionContext::Type::INCOMING, requestor_url, |
| 76 url), |
| 77 services.Pass())); |
74 if (!delegate_->ConfigureIncomingConnection(registry.get())) | 78 if (!delegate_->ConfigureIncomingConnection(registry.get())) |
75 return; | 79 return; |
76 incoming_service_registries_.push_back(std::move(registry)); | 80 incoming_service_registries_.push_back(std::move(registry)); |
77 } | 81 } |
78 | 82 |
79 void ApplicationImpl::RequestQuit() { | 83 void ApplicationImpl::RequestQuit() { |
80 delegate_->Quit(); | 84 delegate_->Quit(); |
81 Terminate(); | 85 Terminate(); |
82 } | 86 } |
83 | 87 |
84 } // namespace mojo | 88 } // namespace mojo |
OLD | NEW |