| 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/win_util.h" | 9 #include "app/win/win_util.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 605 // Hack for Google Desktop crash. Trick GD into not injecting its DLL into | 605 // Hack for Google Desktop crash. Trick GD into not injecting its DLL into |
| 606 // this subprocess. See | 606 // this subprocess. See |
| 607 // http://code.google.com/p/chromium/issues/detail?id=25580 | 607 // http://code.google.com/p/chromium/issues/detail?id=25580 |
| 608 cmd_line->AppendSwitchASCII("ignored", " --type=renderer "); | 608 cmd_line->AppendSwitchASCII("ignored", " --type=renderer "); |
| 609 } | 609 } |
| 610 } | 610 } |
| 611 | 611 |
| 612 if (!exposed_dir.empty()) { | 612 if (!exposed_dir.empty()) { |
| 613 result = policy->AddRule(sandbox::TargetPolicy::SUBSYS_FILES, | 613 result = policy->AddRule(sandbox::TargetPolicy::SUBSYS_FILES, |
| 614 sandbox::TargetPolicy::FILES_ALLOW_ANY, | 614 sandbox::TargetPolicy::FILES_ALLOW_ANY, |
| 615 exposed_dir.ToWStringHack().c_str()); | 615 exposed_dir.value().c_str()); |
| 616 if (result != sandbox::SBOX_ALL_OK) | 616 if (result != sandbox::SBOX_ALL_OK) |
| 617 return 0; | 617 return 0; |
| 618 | 618 |
| 619 FilePath exposed_files = exposed_dir.AppendASCII("*"); | 619 FilePath exposed_files = exposed_dir.AppendASCII("*"); |
| 620 result = policy->AddRule(sandbox::TargetPolicy::SUBSYS_FILES, | 620 result = policy->AddRule(sandbox::TargetPolicy::SUBSYS_FILES, |
| 621 sandbox::TargetPolicy::FILES_ALLOW_ANY, | 621 sandbox::TargetPolicy::FILES_ALLOW_ANY, |
| 622 exposed_files.ToWStringHack().c_str()); | 622 exposed_files.value().c_str()); |
| 623 if (result != sandbox::SBOX_ALL_OK) | 623 if (result != sandbox::SBOX_ALL_OK) |
| 624 return 0; | 624 return 0; |
| 625 } | 625 } |
| 626 | 626 |
| 627 if (!AddGenericPolicy(policy)) { | 627 if (!AddGenericPolicy(policy)) { |
| 628 NOTREACHED(); | 628 NOTREACHED(); |
| 629 return 0; | 629 return 0; |
| 630 } | 630 } |
| 631 | 631 |
| 632 TRACE_EVENT_BEGIN("StartProcessWithAccess::LAUNCHPROCESS", 0, 0); | 632 TRACE_EVENT_BEGIN("StartProcessWithAccess::LAUNCHPROCESS", 0, 0); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 648 | 648 |
| 649 // Help the process a little. It can't start the debugger by itself if | 649 // Help the process a little. It can't start the debugger by itself if |
| 650 // the process is in a sandbox. | 650 // the process is in a sandbox. |
| 651 if (child_needs_help) | 651 if (child_needs_help) |
| 652 base::debug::SpawnDebuggerOnProcess(target.dwProcessId); | 652 base::debug::SpawnDebuggerOnProcess(target.dwProcessId); |
| 653 | 653 |
| 654 return process; | 654 return process; |
| 655 } | 655 } |
| 656 | 656 |
| 657 } // namespace sandbox | 657 } // namespace sandbox |
| OLD | NEW |