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

Unified Diff: shell/child_process_host.cc

Issue 1378303005: Do some plumbing. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: review Created 5 years, 2 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 | « shell/child_process_host.h ('k') | shell/child_process_host_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: shell/child_process_host.cc
diff --git a/shell/child_process_host.cc b/shell/child_process_host.cc
index 8e3908f4893cbcf6b2533567f467bd9ad3b0c674..4318bc1fd1b3057e3766a85cc869c03c1474f755 100644
--- a/shell/child_process_host.cc
+++ b/shell/child_process_host.cc
@@ -16,9 +16,11 @@
#include "base/process/launch.h"
#include "base/task_runner.h"
#include "base/task_runner_util.h"
+#include "build/build_config.h"
#include "mojo/edk/embedder/embedder.h"
#include "mojo/edk/embedder/platform_channel_pair.h"
#include "mojo/public/cpp/system/message_pipe.h"
+#include "shell/application_manager/native_application_options.h"
#include "shell/child_switches.h"
#include "shell/context.h"
#include "shell/task_runners.h"
@@ -29,6 +31,7 @@ struct ChildProcessHost::LaunchData {
LaunchData() {}
~LaunchData() {}
+ NativeApplicationOptions options;
base::FilePath child_path;
mojo::embedder::PlatformChannelPair platform_channel_pair;
std::string child_connection_id;
@@ -42,15 +45,17 @@ ChildProcessHost::~ChildProcessHost() {
DCHECK(!child_process_.IsValid());
}
-void ChildProcessHost::Start(bool require_32_bit) {
+void ChildProcessHost::Start(const NativeApplicationOptions& options) {
DCHECK(!child_process_.IsValid());
scoped_ptr<LaunchData> launch_data(new LaunchData());
+ launch_data->options = options;
launch_data->child_path = context_->mojo_shell_child_path();
#if defined(ARCH_CPU_64_BITS)
- if (require_32_bit)
+ if (options.require_32_bit) {
launch_data->child_path =
context_->mojo_shell_child_path().InsertBeforeExtensionASCII("_32");
+ }
#endif
// TODO(vtl): Add something for |slave_info|.
// TODO(vtl): The "unretained this" is wrong (see also below).
@@ -136,6 +141,9 @@ base::Process ChildProcessHost::DoLaunch(scoped_ptr<LaunchData> launch_data) {
base::LaunchOptions options;
options.fds_to_remap = &handle_passing_info;
+#if defined(OS_LINUX)
+ options.allow_new_privs = launch_data->options.allow_new_privs;
+#endif
DVLOG(2) << "Launching child with command line: "
<< child_command_line.GetCommandLineString();
base::Process child_process =
« no previous file with comments | « shell/child_process_host.h ('k') | shell/child_process_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698