#ifndef MOJO_SHELL_OUT_OF_PROCESS_DYNAMIC_SERVICE_RUNNER_H_
#define MOJO_SHELL_OUT_OF_PROCESS_DYNAMIC_SERVICE_RUNNER_H_
#include "base/callback.h"
#include "base/files/file_path.h"
#include "base/macros.h"
#include "mojo/shell/app_child_process.mojom.h"
#include "mojo/shell/app_child_process_host.h"
#include "mojo/shell/dynamic_service_runner.h"
namespace mojo {
namespace shell {
class OutOfProcessDynamicServiceRunner
: public DynamicServiceRunner,
public mojo_shell::AppChildControllerClient {
public:
explicit OutOfProcessDynamicServiceRunner(Context* context);
virtual ~OutOfProcessDynamicServiceRunner();
virtual void Start(const base::FilePath& app_path,
ScopedShellHandle service_handle,
const base::Closure& app_completed_callback) OVERRIDE;
private:
virtual void AppCompleted(int32_t result) OVERRIDE;
Context* const context_;
base::FilePath app_path_;
ScopedShellHandle service_handle_;
base::Closure app_completed_callback_;
scoped_ptr<AppChildProcessHost> app_child_process_host_;
DISALLOW_COPY_AND_ASSIGN(OutOfProcessDynamicServiceRunner);
};
typedef DynamicServiceRunnerFactoryImpl<OutOfProcessDynamicServiceRunner>
OutOfProcessDynamicServiceRunnerFactory;
}
}
#endif