| Index: services/native_support/process_controller_impl.h
|
| diff --git a/services/native_support/process_controller_impl.h b/services/native_support/process_controller_impl.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..6182e6c80164091aea6f31e29b533cf96709fbef
|
| --- /dev/null
|
| +++ b/services/native_support/process_controller_impl.h
|
| @@ -0,0 +1,57 @@
|
| +// Copyright 2015 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef SERVICES_NATIVE_SUPPORT_PROCESS_CONTROLLER_IMPL_H_
|
| +#define SERVICES_NATIVE_SUPPORT_PROCESS_CONTROLLER_IMPL_H_
|
| +
|
| +#include <memory>
|
| +
|
| +#include "base/macros.h"
|
| +#include "base/memory/ref_counted.h"
|
| +#include "base/memory/weak_ptr.h"
|
| +#include "base/process/process.h"
|
| +#include "base/task_runner.h"
|
| +#include "mojo/public/cpp/bindings/interface_request.h"
|
| +#include "mojo/public/cpp/bindings/strong_binding.h"
|
| +#include "mojo/services/files/public/interfaces/file.mojom.h"
|
| +#include "mojo/services/files/public/interfaces/types.mojom.h"
|
| +#include "mojo/services/native_support/public/interfaces/process.mojom.h"
|
| +
|
| +namespace native_support {
|
| +
|
| +class ProcessIORedirection;
|
| +
|
| +class ProcessControllerImpl : public ProcessController {
|
| + public:
|
| + ProcessControllerImpl(
|
| + scoped_refptr<base::TaskRunner> worker_runner,
|
| + mojo::InterfaceRequest<ProcessController> request,
|
| + base::Process process,
|
| + std::unique_ptr<ProcessIORedirection> process_io_redirection);
|
| + ~ProcessControllerImpl() override;
|
| +
|
| + // |ProcessController| implementation:
|
| + void Wait(const WaitCallback& callback) override;
|
| + void Kill(int32_t signal, const KillCallback& callback) override;
|
| +
|
| + private:
|
| + void OnWaitComplete(const WaitCallback& callback,
|
| + mojo::files::Error result,
|
| + int32_t exit_status);
|
| +
|
| + mojo::files::Error KillHelper(int32_t signal);
|
| +
|
| + scoped_refptr<base::TaskRunner> worker_runner_;
|
| + mojo::StrongBinding<ProcessController> binding_;
|
| + base::Process process_;
|
| + std::unique_ptr<ProcessIORedirection> process_io_redirection_;
|
| +
|
| + base::WeakPtrFactory<ProcessControllerImpl> weak_factory_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(ProcessControllerImpl);
|
| +};
|
| +
|
| +} // namespace native_support
|
| +
|
| +#endif // SERVICES_NATIVE_SUPPORT_PROCESS_CONTROLLER_IMPL_H_
|
|
|