| 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/lib/service_registry.h" | 10 #include "mojo/public/cpp/application/lib/service_registry.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 | 51 |
| 52 void ApplicationImpl::WaitForInitialize() { | 52 void ApplicationImpl::WaitForInitialize() { |
| 53 if (!shell_) | 53 if (!shell_) |
| 54 binding_.WaitForIncomingMethodCall(); | 54 binding_.WaitForIncomingMethodCall(); |
| 55 } | 55 } |
| 56 | 56 |
| 57 void ApplicationImpl::UnbindConnections( | 57 void ApplicationImpl::UnbindConnections( |
| 58 InterfaceRequest<Application>* application_request, | 58 InterfaceRequest<Application>* application_request, |
| 59 ShellPtr* shell) { | 59 ShellPtr* shell) { |
| 60 *application_request = binding_.Unbind(); | 60 *application_request = binding_.Unbind(); |
| 61 shell->Bind(shell_.PassInterface()); | 61 shell->Bind(shell_.PassInterfaceHandle()); |
| 62 } | 62 } |
| 63 | 63 |
| 64 void ApplicationImpl::Initialize(ShellPtr shell, | 64 void ApplicationImpl::Initialize(ShellPtr shell, |
| 65 Array<String> args, | 65 Array<String> args, |
| 66 const mojo::String& url) { | 66 const mojo::String& url) { |
| 67 shell_ = shell.Pass(); | 67 shell_ = shell.Pass(); |
| 68 shell_.set_connection_error_handler([this]() { | 68 shell_.set_connection_error_handler([this]() { |
| 69 delegate_->Quit(); | 69 delegate_->Quit(); |
| 70 incoming_service_registries_.clear(); | 70 incoming_service_registries_.clear(); |
| 71 outgoing_service_registries_.clear(); | 71 outgoing_service_registries_.clear(); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 88 return; | 88 return; |
| 89 incoming_service_registries_.push_back(std::move(registry)); | 89 incoming_service_registries_.push_back(std::move(registry)); |
| 90 } | 90 } |
| 91 | 91 |
| 92 void ApplicationImpl::RequestQuit() { | 92 void ApplicationImpl::RequestQuit() { |
| 93 delegate_->Quit(); | 93 delegate_->Quit(); |
| 94 Terminate(); | 94 Terminate(); |
| 95 } | 95 } |
| 96 | 96 |
| 97 } // namespace mojo | 97 } // namespace mojo |
| OLD | NEW |