| 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 "base/base_switches.h" | 7 #include "base/base_switches.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 // Let the utility process know if it is intended to be elevated. | 285 // Let the utility process know if it is intended to be elevated. |
| 286 if (run_elevated_) | 286 if (run_elevated_) |
| 287 cmd_line->AppendSwitch(switches::kUtilityProcessRunningElevated); | 287 cmd_line->AppendSwitch(switches::kUtilityProcessRunningElevated); |
| 288 #endif | 288 #endif |
| 289 | 289 |
| 290 process_->Launch( | 290 process_->Launch( |
| 291 new UtilitySandboxedProcessLauncherDelegate(exposed_dir_, | 291 new UtilitySandboxedProcessLauncherDelegate(exposed_dir_, |
| 292 run_elevated_, | 292 run_elevated_, |
| 293 no_sandbox_, env_, | 293 no_sandbox_, env_, |
| 294 process_->GetHost()), | 294 process_->GetHost()), |
| 295 cmd_line); | 295 cmd_line, |
| 296 true); |
| 296 } | 297 } |
| 297 | 298 |
| 298 return true; | 299 return true; |
| 299 } | 300 } |
| 300 | 301 |
| 301 bool UtilityProcessHostImpl::OnMessageReceived(const IPC::Message& message) { | 302 bool UtilityProcessHostImpl::OnMessageReceived(const IPC::Message& message) { |
| 302 if (!client_.get()) | 303 if (!client_.get()) |
| 303 return true; | 304 return true; |
| 304 | 305 |
| 305 client_task_runner_->PostTask( | 306 client_task_runner_->PostTask( |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 if (RenderProcessHost::run_renderer_in_process()) | 339 if (RenderProcessHost::run_renderer_in_process()) |
| 339 handle = base::GetCurrentProcessHandle(); | 340 handle = base::GetCurrentProcessHandle(); |
| 340 else | 341 else |
| 341 handle = process_->GetData().handle; | 342 handle = process_->GetData().handle; |
| 342 | 343 |
| 343 mojo_application_host_->Activate(this, handle); | 344 mojo_application_host_->Activate(this, handle); |
| 344 } | 345 } |
| 345 } | 346 } |
| 346 | 347 |
| 347 } // namespace content | 348 } // namespace content |
| OLD | NEW |