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) | 16 ShellPtrWatcher(ApplicationImpl* impl) |
17 : impl_(impl) {} | 17 : impl_(impl) {} |
18 | 18 |
19 virtual ~ShellPtrWatcher() {} | 19 virtual ~ShellPtrWatcher() {} |
20 | 20 |
21 virtual void OnConnectionError() MOJO_OVERRIDE { | 21 virtual void OnConnectionError() override { impl_->OnShellError(); } |
22 impl_->OnShellError(); | |
23 } | |
24 | 22 |
25 private: | 23 private: |
26 ApplicationImpl* impl_; | 24 ApplicationImpl* impl_; |
27 MOJO_DISALLOW_COPY_AND_ASSIGN(ShellPtrWatcher); | 25 MOJO_DISALLOW_COPY_AND_ASSIGN(ShellPtrWatcher); |
28 }; | 26 }; |
29 | 27 |
30 ApplicationImpl::ApplicationImpl(ApplicationDelegate* delegate, | 28 ApplicationImpl::ApplicationImpl(ApplicationDelegate* delegate, |
31 ScopedMessagePipeHandle shell_handle) | 29 ScopedMessagePipeHandle shell_handle) |
32 : initialized_(false), delegate_(delegate), shell_watch_(NULL) { | 30 : initialized_(false), delegate_(delegate), shell_watch_(NULL) { |
33 BindShell(shell_handle.Pass()); | 31 BindShell(shell_handle.Pass()); |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 internal::ServiceRegistry* registry = new internal::ServiceRegistry( | 89 internal::ServiceRegistry* registry = new internal::ServiceRegistry( |
92 this, requestor_url, service_provider.Pass()); | 90 this, requestor_url, service_provider.Pass()); |
93 if (!delegate_->ConfigureIncomingConnection(registry)) { | 91 if (!delegate_->ConfigureIncomingConnection(registry)) { |
94 delete registry; | 92 delete registry; |
95 return; | 93 return; |
96 } | 94 } |
97 incoming_service_registries_.push_back(registry); | 95 incoming_service_registries_.push_back(registry); |
98 } | 96 } |
99 | 97 |
100 } // namespace mojo | 98 } // namespace mojo |
OLD | NEW |