| 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/application/public/cpp/application_impl.h" | 5 #include "mojo/application/public/cpp/application_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| 11 #include "mojo/application/public/cpp/application_delegate.h" | 11 #include "mojo/application/public/cpp/application_delegate.h" |
| 12 #include "mojo/application/public/cpp/lib/service_registry.h" | 12 #include "mojo/application/public/cpp/lib/service_registry.h" |
| 13 #include "mojo/public/cpp/bindings/interface_ptr.h" | 13 #include "mojo/public/cpp/bindings/interface_ptr.h" |
| 14 #include "mojo/public/cpp/environment/logging.h" | 14 #include "mojo/public/cpp/environment/logging.h" |
| 15 | 15 |
| 16 namespace mojo { | 16 namespace mojo { |
| 17 | 17 |
| 18 namespace { | 18 namespace { |
| 19 | 19 |
| 20 void DefaultTerminationClosure() { | 20 void DefaultTerminationClosure() { |
| 21 if (base::MessageLoop::current() && | 21 if (base::MessageLoop::current() && |
| 22 base::MessageLoop::current()->is_running()) | 22 base::MessageLoop::current()->is_running()) |
| 23 base::MessageLoop::current()->Quit(); | 23 base::MessageLoop::current()->QuitWhenIdle(); |
| 24 } | 24 } |
| 25 | 25 |
| 26 } // namespace | 26 } // namespace |
| 27 | 27 |
| 28 ApplicationImpl::ApplicationImpl(ApplicationDelegate* delegate, | 28 ApplicationImpl::ApplicationImpl(ApplicationDelegate* delegate, |
| 29 InterfaceRequest<Application> request) | 29 InterfaceRequest<Application> request) |
| 30 : ApplicationImpl(delegate, request.Pass(), | 30 : ApplicationImpl(delegate, request.Pass(), |
| 31 base::Bind(&DefaultTerminationClosure)) { | 31 base::Bind(&DefaultTerminationClosure)) { |
| 32 } | 32 } |
| 33 | 33 |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 } | 147 } |
| 148 | 148 |
| 149 void ApplicationImpl::UnbindConnections( | 149 void ApplicationImpl::UnbindConnections( |
| 150 InterfaceRequest<Application>* application_request, | 150 InterfaceRequest<Application>* application_request, |
| 151 ShellPtr* shell) { | 151 ShellPtr* shell) { |
| 152 *application_request = binding_.Unbind(); | 152 *application_request = binding_.Unbind(); |
| 153 shell->Bind(shell_.PassInterface()); | 153 shell->Bind(shell_.PassInterface()); |
| 154 } | 154 } |
| 155 | 155 |
| 156 } // namespace mojo | 156 } // namespace mojo |
| OLD | NEW |