| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef SERVICES_NATIVE_SUPPORT_PROCESS_IMPL_H_ | 5 #ifndef SERVICES_NATIVE_SUPPORT_PROCESS_IMPL_H_ |
| 6 #define SERVICES_NATIVE_SUPPORT_PROCESS_IMPL_H_ | 6 #define SERVICES_NATIVE_SUPPORT_PROCESS_IMPL_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/task_runner.h" | 13 #include "base/task_runner.h" |
| 14 #include "mojo/public/cpp/bindings/interface_request.h" | 14 #include "mojo/public/cpp/bindings/interface_request.h" |
| 15 #include "mojo/public/cpp/bindings/strong_binding.h" | 15 #include "mojo/public/cpp/bindings/strong_binding.h" |
| 16 #include "mojo/services/native_support/interfaces/process.mojom.h" | 16 #include "mojo/services/native_support/interfaces/process.mojom.h" |
| 17 | 17 |
| 18 namespace mojo { | 18 namespace mojo { |
| 19 class ApplicationConnection; | 19 struct ConnectionContext; |
| 20 } | 20 } |
| 21 | 21 |
| 22 namespace native_support { | 22 namespace native_support { |
| 23 | 23 |
| 24 class ProcessIORedirection; | 24 class ProcessIORedirection; |
| 25 | 25 |
| 26 class ProcessImpl : public Process { | 26 class ProcessImpl : public Process { |
| 27 public: | 27 public: |
| 28 ProcessImpl(scoped_refptr<base::TaskRunner> worker_runner, | 28 ProcessImpl(scoped_refptr<base::TaskRunner> worker_runner, |
| 29 mojo::ApplicationConnection* connection, | 29 const mojo::ConnectionContext& connection_context, |
| 30 mojo::InterfaceRequest<Process> request); | 30 mojo::InterfaceRequest<Process> request); |
| 31 ~ProcessImpl() override; | 31 ~ProcessImpl() override; |
| 32 | 32 |
| 33 // |Process| implementation: | 33 // |Process| implementation: |
| 34 void Spawn(mojo::Array<uint8_t> path, | 34 void Spawn(mojo::Array<uint8_t> path, |
| 35 mojo::Array<mojo::Array<uint8_t>> argv, | 35 mojo::Array<mojo::Array<uint8_t>> argv, |
| 36 mojo::Array<mojo::Array<uint8_t>> envp, | 36 mojo::Array<mojo::Array<uint8_t>> envp, |
| 37 mojo::InterfaceHandle<mojo::files::File> stdin_file, | 37 mojo::InterfaceHandle<mojo::files::File> stdin_file, |
| 38 mojo::InterfaceHandle<mojo::files::File> stdout_file, | 38 mojo::InterfaceHandle<mojo::files::File> stdout_file, |
| 39 mojo::InterfaceHandle<mojo::files::File> stderr_file, | 39 mojo::InterfaceHandle<mojo::files::File> stderr_file, |
| (...skipping 20 matching lines...) Expand all Loading... |
| 60 | 60 |
| 61 scoped_refptr<base::TaskRunner> worker_runner_; | 61 scoped_refptr<base::TaskRunner> worker_runner_; |
| 62 mojo::StrongBinding<Process> binding_; | 62 mojo::StrongBinding<Process> binding_; |
| 63 | 63 |
| 64 DISALLOW_COPY_AND_ASSIGN(ProcessImpl); | 64 DISALLOW_COPY_AND_ASSIGN(ProcessImpl); |
| 65 }; | 65 }; |
| 66 | 66 |
| 67 } // namespace native_support | 67 } // namespace native_support |
| 68 | 68 |
| 69 #endif // SERVICES_NATIVE_SUPPORT_PROCESS_IMPL_H_ | 69 #endif // SERVICES_NATIVE_SUPPORT_PROCESS_IMPL_H_ |
| OLD | NEW |