| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/common/sandbox_policy.h" | 5 #include "chrome/common/sandbox_policy.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "app/win_util.h" | 9 #include "app/win_util.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 if (type == ChildProcessInfo::PLUGIN_PROCESS) { | 448 if (type == ChildProcessInfo::PLUGIN_PROCESS) { |
| 449 if (!AddPolicyForPlugin(cmd_line, policy)) | 449 if (!AddPolicyForPlugin(cmd_line, policy)) |
| 450 return 0; | 450 return 0; |
| 451 } else { | 451 } else { |
| 452 AddPolicyForRenderer(policy, &on_sandbox_desktop); | 452 AddPolicyForRenderer(policy, &on_sandbox_desktop); |
| 453 | 453 |
| 454 if (type_str != switches::kRendererProcess) { | 454 if (type_str != switches::kRendererProcess) { |
| 455 // Hack for Google Desktop crash. Trick GD into not injecting its DLL into | 455 // Hack for Google Desktop crash. Trick GD into not injecting its DLL into |
| 456 // this subprocess. See | 456 // this subprocess. See |
| 457 // http://code.google.com/p/chromium/issues/detail?id=25580 | 457 // http://code.google.com/p/chromium/issues/detail?id=25580 |
| 458 cmd_line->AppendSwitchWithValue("ignored", " --type=renderer "); | 458 cmd_line->AppendSwitchASCII("ignored", " --type=renderer "); |
| 459 } | 459 } |
| 460 } | 460 } |
| 461 | 461 |
| 462 if (!exposed_dir.empty()) { | 462 if (!exposed_dir.empty()) { |
| 463 result = policy->AddRule(sandbox::TargetPolicy::SUBSYS_FILES, | 463 result = policy->AddRule(sandbox::TargetPolicy::SUBSYS_FILES, |
| 464 sandbox::TargetPolicy::FILES_ALLOW_ANY, | 464 sandbox::TargetPolicy::FILES_ALLOW_ANY, |
| 465 exposed_dir.ToWStringHack().c_str()); | 465 exposed_dir.ToWStringHack().c_str()); |
| 466 if (result != sandbox::SBOX_ALL_OK) | 466 if (result != sandbox::SBOX_ALL_OK) |
| 467 return 0; | 467 return 0; |
| 468 | 468 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 494 | 494 |
| 495 // Help the process a little. It can't start the debugger by itself if | 495 // Help the process a little. It can't start the debugger by itself if |
| 496 // the process is in a sandbox. | 496 // the process is in a sandbox. |
| 497 if (child_needs_help) | 497 if (child_needs_help) |
| 498 DebugUtil::SpawnDebuggerOnProcess(target.dwProcessId); | 498 DebugUtil::SpawnDebuggerOnProcess(target.dwProcessId); |
| 499 | 499 |
| 500 return process; | 500 return process; |
| 501 } | 501 } |
| 502 | 502 |
| 503 } // namespace sandbox | 503 } // namespace sandbox |
| OLD | NEW |