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.
5 #ifndef MOJO_SHELL_APP_CHILD_PROCESS_HOST_H_
6 #define MOJO_SHELL_APP_CHILD_PROCESS_HOST_H_
8 #include "base/macros.h"
9 #include "mojo/shell/app_child_process.mojom.h"
10 #include "mojo/shell/child_process_host.h"
20 // A subclass of |ChildProcessHost| to host a |TYPE_APP| child process, which
21 // runs a single app (loaded from the file system).
23 // Note: After |Start()|, this object must remain alive until the controller
24 // client's |AppCompleted()| is called.
25 class AppChildProcessHost
: public ChildProcessHost
,
26 public ChildProcessHost::Delegate
{
28 AppChildProcessHost(Context
* context
,
29 AppChildControllerClient
* controller_client
);
30 virtual ~AppChildProcessHost();
32 AppChildController
* controller() {
33 return controller_
.get();
37 // |ChildProcessHost::Delegate| methods:
38 virtual void WillStart() OVERRIDE
;
39 virtual void DidStart(bool success
) OVERRIDE
;
41 // Callback for |embedder::CreateChannel()|.
42 void DidCreateChannel(embedder::ChannelInfo
* channel_info
);
44 AppChildControllerClient
* const controller_client_
;
46 AppChildControllerPtr controller_
;
47 embedder::ChannelInfo
* channel_info_
;
49 DISALLOW_COPY_AND_ASSIGN(AppChildProcessHost
);
55 #endif // MOJO_SHELL_APP_CHILD_PROCESS_HOST_H_