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

Unified Diff: services/native_support/process_impl.cc

Issue 1682113003: Mojo C++ bindings: Generate InterfaceHandle<> instead of InterfacePtr<>. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: rebase ontop of master, address trung's comments Created 4 years, 10 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/process_impl.h ('k') | services/native_viewport/native_viewport_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/native_support/process_impl.cc
diff --git a/services/native_support/process_impl.cc b/services/native_support/process_impl.cc
index 7e3deb9917d45ddec51d9182fc3876b3322d2072..4e72164c9dfe0a4114f157af8d6a4a2a6b06cadb 100644
--- a/services/native_support/process_impl.cc
+++ b/services/native_support/process_impl.cc
@@ -26,6 +26,8 @@
#include "services/native_support/process_controller_impl.h"
#include "services/native_support/process_io_redirection.h"
+using mojo::files::FilePtr;
+
namespace native_support {
namespace {
@@ -60,9 +62,9 @@ void ProcessImpl::Spawn(
mojo::Array<uint8_t> path,
mojo::Array<mojo::Array<uint8_t>> argv,
mojo::Array<mojo::Array<uint8_t>> envp,
- mojo::files::FilePtr stdin_file,
- mojo::files::FilePtr stdout_file,
- mojo::files::FilePtr stderr_file,
+ mojo::InterfaceHandle<mojo::files::File> stdin_file,
+ mojo::InterfaceHandle<mojo::files::File> stdout_file,
+ mojo::InterfaceHandle<mojo::files::File> stderr_file,
mojo::InterfaceRequest<ProcessController> process_controller,
const SpawnCallback& callback) {
std::vector<int> fds_to_inherit(3, -1);
@@ -108,9 +110,10 @@ void ProcessImpl::Spawn(
std::unique_ptr<ProcessIORedirection> process_io_redirection(
new ProcessIORedirectionForStdIO(
- stdin_file.Pass(), stdout_file.Pass(), stderr_file.Pass(),
- stdin_parent_fd.Pass(), stdout_parent_fd.Pass(),
- stderr_parent_fd.Pass()));
+ FilePtr::Create(std::move(stdin_file)),
+ FilePtr::Create(std::move(stdout_file)),
+ FilePtr::Create(std::move(stderr_file)), stdin_parent_fd.Pass(),
+ stdout_parent_fd.Pass(), stderr_parent_fd.Pass()));
SpawnImpl(path.Pass(), argv.Pass(), envp.Pass(),
std::move(process_io_redirection), fds_to_inherit,
@@ -121,7 +124,7 @@ void ProcessImpl::SpawnWithTerminal(
mojo::Array<uint8_t> path,
mojo::Array<mojo::Array<uint8_t>> argv,
mojo::Array<mojo::Array<uint8_t>> envp,
- mojo::files::FilePtr terminal_file,
+ mojo::InterfaceHandle<mojo::files::File> terminal_file,
mojo::InterfaceRequest<ProcessController> process_controller,
const SpawnWithTerminalCallback& callback) {
DCHECK(terminal_file);
@@ -150,8 +153,8 @@ void ProcessImpl::SpawnWithTerminal(
fds_to_inherit[STDERR_FILENO] = stderr_fd.get();
std::unique_ptr<ProcessIORedirection> process_io_redirection(
- new ProcessIORedirectionForTerminal(terminal_file.Pass(),
- master_fd.Pass()));
+ new ProcessIORedirectionForTerminal(
+ FilePtr::Create(std::move(terminal_file)), master_fd.Pass()));
SpawnImpl(path.Pass(), argv.Pass(), envp.Pass(),
std::move(process_io_redirection), fds_to_inherit,
« no previous file with comments | « services/native_support/process_impl.h ('k') | services/native_viewport/native_viewport_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698