summaryrefslogtreecommitdiffstats
path: root/content/browser/utility_process_host_impl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'content/browser/utility_process_host_impl.cc')
-rw-r--r--content/browser/utility_process_host_impl.cc24
1 files changed, 24 insertions, 0 deletions
diff --git a/content/browser/utility_process_host_impl.cc b/content/browser/utility_process_host_impl.cc
index e2f45245..013c62a 100644
--- a/content/browser/utility_process_host_impl.cc
+++ b/content/browser/utility_process_host_impl.cc
@@ -73,6 +73,9 @@ UtilityProcessHostImpl::UtilityProcessHostImpl(
is_batch_mode_(false),
is_mdns_enabled_(false),
no_sandbox_(false),
+#if defined(OS_WIN)
+ run_elevated_(false),
+#endif
#if defined(OS_LINUX)
child_flags_(ChildProcessHost::CHILD_ALLOW_SELF),
#else
@@ -119,6 +122,13 @@ void UtilityProcessHostImpl::DisableSandbox() {
no_sandbox_ = true;
}
+#if defined(OS_WIN)
+void UtilityProcessHostImpl::ElevatePrivileges() {
+ no_sandbox_ = true;
+ run_elevated_ = true;
+}
+#endif
+
const ChildProcessData& UtilityProcessHostImpl::GetData() {
return process_->GetData();
}
@@ -210,6 +220,12 @@ bool UtilityProcessHostImpl::StartProcess() {
if (is_mdns_enabled_)
cmd_line->AppendSwitch(switches::kUtilityProcessEnableMDns);
+#if defined(OS_WIN)
+ // Let the utility process know if it is intended to be elevated.
+ if (run_elevated_)
+ cmd_line->AppendSwitch(switches::kUtilityProcessRunningElevated);
+#endif
+
bool use_zygote = false;
#if defined(OS_LINUX)
@@ -221,6 +237,7 @@ bool UtilityProcessHostImpl::StartProcess() {
process_->Launch(
#if defined(OS_WIN)
new UtilitySandboxedProcessLauncherDelegate(exposed_dir_),
+ run_elevated_,
#elif defined(OS_POSIX)
use_zygote,
env_,
@@ -240,6 +257,13 @@ bool UtilityProcessHostImpl::OnMessageReceived(const IPC::Message& message) {
return true;
}
+void UtilityProcessHostImpl::OnProcessLaunchFailed() {
+ client_task_runner_->PostTask(
+ FROM_HERE,
+ base::Bind(&UtilityProcessHostClient::OnProcessLaunchFailed,
+ client_.get()));
+}
+
void UtilityProcessHostImpl::OnProcessCrashed(int exit_code) {
client_task_runner_->PostTask(
FROM_HERE,