OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "content/browser/utility_process_host_impl.h" | 5 #include "content/browser/utility_process_host_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/base_switches.h" | 9 #include "base/base_switches.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 cmd_line->AppendSwitchPath(switches::kUtilityProcessAllowedDir, | 334 cmd_line->AppendSwitchPath(switches::kUtilityProcessAllowedDir, |
335 exposed_dir_); | 335 exposed_dir_); |
336 } | 336 } |
337 | 337 |
338 #if defined(OS_WIN) | 338 #if defined(OS_WIN) |
339 // Let the utility process know if it is intended to be elevated. | 339 // Let the utility process know if it is intended to be elevated. |
340 if (run_elevated_) | 340 if (run_elevated_) |
341 cmd_line->AppendSwitch(switches::kUtilityProcessRunningElevated); | 341 cmd_line->AppendSwitch(switches::kUtilityProcessRunningElevated); |
342 #endif | 342 #endif |
343 | 343 |
344 process_->Launch( | 344 process_->Launch(new UtilitySandboxedProcessLauncherDelegate( |
345 new UtilitySandboxedProcessLauncherDelegate(exposed_dir_, | 345 exposed_dir_, run_elevated_, no_sandbox_, env_, |
346 run_elevated_, | 346 process_->GetHost()), |
347 no_sandbox_, env_, | 347 cmd_line, nullptr, true); |
348 process_->GetHost()), | |
349 cmd_line, | |
350 true); | |
351 } | 348 } |
352 | 349 |
353 return true; | 350 return true; |
354 } | 351 } |
355 | 352 |
356 bool UtilityProcessHostImpl::OnMessageReceived(const IPC::Message& message) { | 353 bool UtilityProcessHostImpl::OnMessageReceived(const IPC::Message& message) { |
357 if (!client_.get()) | 354 if (!client_.get()) |
358 return true; | 355 return true; |
359 | 356 |
360 client_task_runner_->PostTask( | 357 client_task_runner_->PostTask( |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 base::WeakPtr<UtilityProcessHostImpl> host, | 398 base::WeakPtr<UtilityProcessHostImpl> host, |
402 int error_code) { | 399 int error_code) { |
403 if (!host) | 400 if (!host) |
404 return; | 401 return; |
405 | 402 |
406 host->OnProcessLaunchFailed(error_code); | 403 host->OnProcessLaunchFailed(error_code); |
407 delete host.get(); | 404 delete host.get(); |
408 } | 405 } |
409 | 406 |
410 } // namespace content | 407 } // namespace content |
OLD | NEW |