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" |
11 | 11 |
12 namespace mojo { | 12 namespace mojo { |
13 | 13 |
14 class ApplicationImpl::ShellPtrWatcher : public ErrorHandler { | 14 class ApplicationImpl::ShellPtrWatcher : public ErrorHandler { |
15 public: | 15 public: |
16 ShellPtrWatcher(ApplicationImpl* impl) : impl_(impl) {} | 16 ShellPtrWatcher(ApplicationImpl* impl) : impl_(impl) {} |
17 | 17 |
18 virtual ~ShellPtrWatcher() {} | 18 ~ShellPtrWatcher() override {} |
19 | 19 |
20 virtual void OnConnectionError() override { impl_->OnShellError(); } | 20 void OnConnectionError() override { impl_->OnShellError(); } |
21 | 21 |
22 private: | 22 private: |
23 ApplicationImpl* impl_; | 23 ApplicationImpl* impl_; |
24 MOJO_DISALLOW_COPY_AND_ASSIGN(ShellPtrWatcher); | 24 MOJO_DISALLOW_COPY_AND_ASSIGN(ShellPtrWatcher); |
25 }; | 25 }; |
26 | 26 |
27 ApplicationImpl::ApplicationImpl(ApplicationDelegate* delegate, | 27 ApplicationImpl::ApplicationImpl(ApplicationDelegate* delegate, |
28 ScopedMessagePipeHandle shell_handle) | 28 ScopedMessagePipeHandle shell_handle) |
29 : initialized_(false), delegate_(delegate), shell_watch_(nullptr) { | 29 : initialized_(false), delegate_(delegate), shell_watch_(nullptr) { |
30 BindShell(shell_handle.Pass()); | 30 BindShell(shell_handle.Pass()); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 internal::ServiceRegistry* registry = new internal::ServiceRegistry( | 100 internal::ServiceRegistry* registry = new internal::ServiceRegistry( |
101 this, requestor_url, service_provider.Pass()); | 101 this, requestor_url, service_provider.Pass()); |
102 if (!delegate_->ConfigureIncomingConnection(registry)) { | 102 if (!delegate_->ConfigureIncomingConnection(registry)) { |
103 delete registry; | 103 delete registry; |
104 return; | 104 return; |
105 } | 105 } |
106 incoming_service_registries_.push_back(registry); | 106 incoming_service_registries_.push_back(registry); |
107 } | 107 } |
108 | 108 |
109 } // namespace mojo | 109 } // namespace mojo |
OLD | NEW |