OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/common/sandbox_policy.h" | 5 #include "content/common/sandbox_policy.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/debugger.h" | 10 #include "base/debug/debugger.h" |
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 } | 381 } |
382 | 382 |
383 base::ProcessHandle StartProcessWithAccess(CommandLine* cmd_line, | 383 base::ProcessHandle StartProcessWithAccess(CommandLine* cmd_line, |
384 const FilePath& exposed_dir) { | 384 const FilePath& exposed_dir) { |
385 base::ProcessHandle process = 0; | 385 base::ProcessHandle process = 0; |
386 const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); | 386 const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); |
387 ChildProcessInfo::ProcessType type; | 387 ChildProcessInfo::ProcessType type; |
388 std::string type_str = cmd_line->GetSwitchValueASCII(switches::kProcessType); | 388 std::string type_str = cmd_line->GetSwitchValueASCII(switches::kProcessType); |
389 if (type_str == switches::kRendererProcess) { | 389 if (type_str == switches::kRendererProcess) { |
390 type = ChildProcessInfo::RENDER_PROCESS; | 390 type = ChildProcessInfo::RENDER_PROCESS; |
391 } else if (type_str == switches::kExtensionProcess) { | |
392 // Extensions are just renderers with another name. | |
393 type = ChildProcessInfo::RENDER_PROCESS; | |
394 } else if (type_str == switches::kPluginProcess) { | 391 } else if (type_str == switches::kPluginProcess) { |
395 type = ChildProcessInfo::PLUGIN_PROCESS; | 392 type = ChildProcessInfo::PLUGIN_PROCESS; |
396 } else if (type_str == switches::kWorkerProcess) { | 393 } else if (type_str == switches::kWorkerProcess) { |
397 type = ChildProcessInfo::WORKER_PROCESS; | 394 type = ChildProcessInfo::WORKER_PROCESS; |
398 } else if (type_str == switches::kNaClLoaderProcess) { | 395 } else if (type_str == switches::kNaClLoaderProcess) { |
399 type = ChildProcessInfo::NACL_LOADER_PROCESS; | 396 type = ChildProcessInfo::NACL_LOADER_PROCESS; |
400 } else if (type_str == switches::kUtilityProcess) { | 397 } else if (type_str == switches::kUtilityProcess) { |
401 type = ChildProcessInfo::UTILITY_PROCESS; | 398 type = ChildProcessInfo::UTILITY_PROCESS; |
402 } else if (type_str == switches::kNaClBrokerProcess) { | 399 } else if (type_str == switches::kNaClBrokerProcess) { |
403 type = ChildProcessInfo::NACL_BROKER_PROCESS; | 400 type = ChildProcessInfo::NACL_BROKER_PROCESS; |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
563 | 560 |
564 // Help the process a little. It can't start the debugger by itself if | 561 // Help the process a little. It can't start the debugger by itself if |
565 // the process is in a sandbox. | 562 // the process is in a sandbox. |
566 if (child_needs_help) | 563 if (child_needs_help) |
567 base::debug::SpawnDebuggerOnProcess(target.dwProcessId); | 564 base::debug::SpawnDebuggerOnProcess(target.dwProcessId); |
568 | 565 |
569 return process; | 566 return process; |
570 } | 567 } |
571 | 568 |
572 } // namespace sandbox | 569 } // namespace sandbox |
OLD | NEW |