| 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 internal::ServiceRegistry* registry = new internal::ServiceRegistry( | 64 internal::ServiceRegistry* registry = new internal::ServiceRegistry( |
| 65 this, application_url, remote_services.Pass(), local_request.Pass()); | 65 this, application_url, remote_services.Pass(), local_request.Pass()); |
| 66 if (!delegate_->ConfigureOutgoingConnection(registry)) { | 66 if (!delegate_->ConfigureOutgoingConnection(registry)) { |
| 67 delete registry; | 67 delete registry; |
| 68 return nullptr; | 68 return nullptr; |
| 69 } | 69 } |
| 70 outgoing_service_registries_.push_back(registry); | 70 outgoing_service_registries_.push_back(registry); |
| 71 return registry; | 71 return registry; |
| 72 } | 72 } |
| 73 | 73 |
| 74 void ApplicationImpl::Initialize(ShellPtr shell, Array<String> args) { | 74 void ApplicationImpl::Initialize(ShellPtr shell, |
| 75 Array<String> args, |
| 76 const mojo::String& url) { |
| 75 shell_ = shell.Pass(); | 77 shell_ = shell.Pass(); |
| 76 shell_watch_ = new ShellPtrWatcher(this); | 78 shell_watch_ = new ShellPtrWatcher(this); |
| 77 shell_.set_error_handler(shell_watch_); | 79 shell_.set_error_handler(shell_watch_); |
| 80 url_ = url; |
| 78 args_ = args.To<std::vector<std::string>>(); | 81 args_ = args.To<std::vector<std::string>>(); |
| 79 delegate_->Initialize(this); | 82 delegate_->Initialize(this); |
| 80 } | 83 } |
| 81 | 84 |
| 82 void ApplicationImpl::WaitForInitialize() { | 85 void ApplicationImpl::WaitForInitialize() { |
| 83 if (!shell_) | 86 if (!shell_) |
| 84 binding_.WaitForIncomingMethodCall(); | 87 binding_.WaitForIncomingMethodCall(); |
| 85 } | 88 } |
| 86 | 89 |
| 87 void ApplicationImpl::UnbindConnections( | 90 void ApplicationImpl::UnbindConnections( |
| (...skipping 14 matching lines...) Expand all Loading... |
| 102 return; | 105 return; |
| 103 } | 106 } |
| 104 incoming_service_registries_.push_back(registry); | 107 incoming_service_registries_.push_back(registry); |
| 105 } | 108 } |
| 106 | 109 |
| 107 void ApplicationImpl::RequestQuit() { | 110 void ApplicationImpl::RequestQuit() { |
| 108 Terminate(); | 111 Terminate(); |
| 109 } | 112 } |
| 110 | 113 |
| 111 } // namespace mojo | 114 } // namespace mojo |
| OLD | NEW |