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 "mojo/public/cpp/application/application_delegate.h" | 7 #include "mojo/public/cpp/application/application_delegate.h" |
8 #include "mojo/public/cpp/application/lib/service_registry.h" | 8 #include "mojo/public/cpp/application/lib/service_registry.h" |
9 #include "mojo/public/cpp/bindings/interface_ptr.h" | 9 #include "mojo/public/cpp/bindings/interface_ptr.h" |
10 #include "mojo/public/cpp/environment/logging.h" | 10 #include "mojo/public/cpp/environment/logging.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 | 85 |
86 void ApplicationImpl::WaitForInitialize() { | 86 void ApplicationImpl::WaitForInitialize() { |
87 if (!shell_) | 87 if (!shell_) |
88 binding_.WaitForIncomingMethodCall(); | 88 binding_.WaitForIncomingMethodCall(); |
89 } | 89 } |
90 | 90 |
91 void ApplicationImpl::UnbindConnections( | 91 void ApplicationImpl::UnbindConnections( |
92 InterfaceRequest<Application>* application_request, | 92 InterfaceRequest<Application>* application_request, |
93 ShellPtr* shell) { | 93 ShellPtr* shell) { |
94 *application_request = binding_.Unbind(); | 94 *application_request = binding_.Unbind(); |
95 shell->Bind(shell_.PassMessagePipe()); | 95 shell->Bind(shell_.PassInterface()); |
96 } | 96 } |
97 | 97 |
98 void ApplicationImpl::AcceptConnection( | 98 void ApplicationImpl::AcceptConnection( |
99 const String& requestor_url, | 99 const String& requestor_url, |
100 InterfaceRequest<ServiceProvider> services, | 100 InterfaceRequest<ServiceProvider> services, |
101 ServiceProviderPtr exposed_services, | 101 ServiceProviderPtr exposed_services, |
102 const String& url) { | 102 const String& url) { |
103 internal::ServiceRegistry* registry = new internal::ServiceRegistry( | 103 internal::ServiceRegistry* registry = new internal::ServiceRegistry( |
104 this, url, requestor_url, exposed_services.Pass(), services.Pass()); | 104 this, url, requestor_url, exposed_services.Pass(), services.Pass()); |
105 if (!delegate_->ConfigureIncomingConnection(registry)) { | 105 if (!delegate_->ConfigureIncomingConnection(registry)) { |
106 delete registry; | 106 delete registry; |
107 return; | 107 return; |
108 } | 108 } |
109 incoming_service_registries_.push_back(registry); | 109 incoming_service_registries_.push_back(registry); |
110 } | 110 } |
111 | 111 |
112 void ApplicationImpl::RequestQuit() { | 112 void ApplicationImpl::RequestQuit() { |
113 delegate_->Quit(); | 113 delegate_->Quit(); |
114 Terminate(); | 114 Terminate(); |
115 } | 115 } |
116 | 116 |
117 } // namespace mojo | 117 } // namespace mojo |
OLD | NEW |