Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(348)

Unified Diff: services/native_support/process_controller_impl.h

Issue 1321253010: Add a "native_support" service. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: fix android? Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « services/native_support/make_pty_pair.cc ('k') | services/native_support/process_controller_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_
« no previous file with comments | « services/native_support/make_pty_pair.cc ('k') | services/native_support/process_controller_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698