OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef MOJO_SHELL_APP_CHILD_PROCESS_HOST_H_ | |
6 #define MOJO_SHELL_APP_CHILD_PROCESS_HOST_H_ | |
7 | |
8 #include "base/macros.h" | |
9 #include "mojo/edk/embedder/channel_info_forward.h" | |
10 #include "mojo/shell/app_child_process.mojom.h" | |
11 #include "mojo/shell/child_process_host.h" | |
12 | |
13 namespace mojo { | |
14 namespace shell { | |
15 | |
16 // A subclass of |ChildProcessHost| to host a |TYPE_APP| child process, which | |
17 // runs a single app (loaded from the file system). | |
18 // | |
19 // Note: After |Start()|, this object must remain alive until the controller | |
20 // client's |AppCompleted()| is called. | |
21 class AppChildProcessHost : public ChildProcessHost, | |
22 public ChildProcessHost::Delegate { | |
23 public: | |
24 AppChildProcessHost(Context* context, | |
25 AppChildControllerClient* controller_client); | |
26 ~AppChildProcessHost() override; | |
27 | |
28 AppChildController* controller() { | |
29 return controller_.get(); | |
30 } | |
31 | |
32 private: | |
33 // |ChildProcessHost::Delegate| methods: | |
34 void WillStart() override; | |
35 void DidStart(bool success) override; | |
36 | |
37 // Callback for |embedder::CreateChannel()|. | |
38 void DidCreateChannel(embedder::ChannelInfo* channel_info); | |
39 | |
40 AppChildControllerClient* const controller_client_; | |
41 | |
42 AppChildControllerPtr controller_; | |
43 embedder::ChannelInfo* channel_info_; | |
44 | |
45 DISALLOW_COPY_AND_ASSIGN(AppChildProcessHost); | |
46 }; | |
47 | |
48 } // namespace shell | |
49 } // namespace mojo | |
50 | |
51 #endif // MOJO_SHELL_APP_CHILD_PROCESS_HOST_H_ | |
OLD | NEW |