| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 MOJO_CHECK(!initialized_); | 57 MOJO_CHECK(!initialized_); |
| 58 initialized_ = true; | 58 initialized_ = true; |
| 59 args_ = args.Pass(); | 59 args_ = args.Pass(); |
| 60 delegate_->Initialize(this); | 60 delegate_->Initialize(this); |
| 61 } | 61 } |
| 62 | 62 |
| 63 ApplicationConnection* ApplicationImpl::ConnectToApplication( | 63 ApplicationConnection* ApplicationImpl::ConnectToApplication( |
| 64 const String& application_url) { | 64 const String& application_url) { |
| 65 MOJO_CHECK(initialized_); | 65 MOJO_CHECK(initialized_); |
| 66 ServiceProviderPtr out_service_provider; | 66 ServiceProviderPtr out_service_provider; |
| 67 shell_->ConnectToApplication(application_url, Get(&out_service_provider)); | 67 shell_->ConnectToApplication(application_url, |
| 68 GetProxy(&out_service_provider)); |
| 68 internal::ServiceRegistry* registry = new internal::ServiceRegistry( | 69 internal::ServiceRegistry* registry = new internal::ServiceRegistry( |
| 69 this, | 70 this, |
| 70 application_url, | 71 application_url, |
| 71 out_service_provider.Pass()); | 72 out_service_provider.Pass()); |
| 72 if (!delegate_->ConfigureOutgoingConnection(registry)) { | 73 if (!delegate_->ConfigureOutgoingConnection(registry)) { |
| 73 delete registry; | 74 delete registry; |
| 74 return nullptr; | 75 return nullptr; |
| 75 } | 76 } |
| 76 outgoing_service_registries_.push_back(registry); | 77 outgoing_service_registries_.push_back(registry); |
| 77 return registry; | 78 return registry; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 89 internal::ServiceRegistry* registry = new internal::ServiceRegistry( | 90 internal::ServiceRegistry* registry = new internal::ServiceRegistry( |
| 90 this, requestor_url, service_provider.Pass()); | 91 this, requestor_url, service_provider.Pass()); |
| 91 if (!delegate_->ConfigureIncomingConnection(registry)) { | 92 if (!delegate_->ConfigureIncomingConnection(registry)) { |
| 92 delete registry; | 93 delete registry; |
| 93 return; | 94 return; |
| 94 } | 95 } |
| 95 incoming_service_registries_.push_back(registry); | 96 incoming_service_registries_.push_back(registry); |
| 96 } | 97 } |
| 97 | 98 |
| 98 } // namespace mojo | 99 } // namespace mojo |
| OLD | NEW |