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

Unified Diff: services/native_support/process_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
Index: services/native_support/process_impl.h
diff --git a/services/native_support/process_impl.h b/services/native_support/process_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..dca0b70fe33f25b00bdda31959911050c2947606
--- /dev/null
+++ b/services/native_support/process_impl.h
@@ -0,0 +1,69 @@
+// 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_IMPL_H_
+#define SERVICES_NATIVE_SUPPORT_PROCESS_IMPL_H_
+
+#include <memory>
+#include <vector>
+
+#include "base/macros.h"
+#include "base/memory/ref_counted.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/native_support/public/interfaces/process.mojom.h"
+
+namespace mojo {
+class ApplicationConnection;
+}
+
+namespace native_support {
+
+class ProcessIORedirection;
+
+class ProcessImpl : public Process {
+ public:
+ ProcessImpl(scoped_refptr<base::TaskRunner> worker_runner,
+ mojo::ApplicationConnection* connection,
+ mojo::InterfaceRequest<Process> request);
+ ~ProcessImpl() override;
+
+ // |Process| implementation:
+ void Spawn(const mojo::String& path,
+ mojo::Array<mojo::String> argv,
+ mojo::Array<mojo::String> envp,
+ mojo::files::FilePtr stdin_file,
+ mojo::files::FilePtr stdout_file,
+ mojo::files::FilePtr stderr_file,
+ mojo::InterfaceRequest<ProcessController> process_controller,
+ const SpawnCallback& callback) override;
+ void SpawnWithTerminal(
+ const mojo::String& path,
+ mojo::Array<mojo::String> argv,
+ mojo::Array<mojo::String> envp,
+ mojo::files::FilePtr terminal_file,
+ mojo::InterfaceRequest<ProcessController> process_controller,
+ const SpawnWithTerminalCallback& callback) override;
+
+ private:
+ // Note: We take advantage of the fact that |SpawnCallback| and
+ // |SpawnWithTerminalCallback| are the same.
+ void SpawnImpl(const mojo::String& path,
+ mojo::Array<mojo::String> argv,
+ mojo::Array<mojo::String> envp,
+ std::unique_ptr<ProcessIORedirection> process_io_redirection,
+ const std::vector<int>& fds_to_inherit,
+ mojo::InterfaceRequest<ProcessController> process_controller,
+ const SpawnCallback& callback);
+
+ scoped_refptr<base::TaskRunner> worker_runner_;
+ mojo::StrongBinding<Process> binding_;
+
+ DISALLOW_COPY_AND_ASSIGN(ProcessImpl);
+};
+
+} // namespace native_support
+
+#endif // SERVICES_NATIVE_SUPPORT_PROCESS_IMPL_H_
« no previous file with comments | « services/native_support/process_controller_impl_unittest.cc ('k') | services/native_support/process_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698