| 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/common/sandbox_win.h" | 5 #include "content/common/sandbox_win.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 403 result = policy->SetDelayedIntegrityLevel(sandbox::INTEGRITY_LEVEL_UNTRUSTED); | 403 result = policy->SetDelayedIntegrityLevel(sandbox::INTEGRITY_LEVEL_UNTRUSTED); |
| 404 if (result != sandbox::SBOX_ALL_OK) | 404 if (result != sandbox::SBOX_ALL_OK) |
| 405 return result; | 405 return result; |
| 406 result = policy->SetIntegrityLevel(sandbox::INTEGRITY_LEVEL_LOW); | 406 result = policy->SetIntegrityLevel(sandbox::INTEGRITY_LEVEL_LOW); |
| 407 if (result != sandbox::SBOX_ALL_OK) | 407 if (result != sandbox::SBOX_ALL_OK) |
| 408 return result; | 408 return result; |
| 409 policy->SetLockdownDefaultDacl(); | 409 policy->SetLockdownDefaultDacl(); |
| 410 | 410 |
| 411 result = policy->SetAlternateDesktop(true); | 411 result = policy->SetAlternateDesktop(true); |
| 412 if (result != sandbox::SBOX_ALL_OK) { | 412 if (result != sandbox::SBOX_ALL_OK) { |
| 413 // Ignore the result of setting the alternate desktop. |
| 413 DLOG(WARNING) << "Failed to apply desktop security to the renderer"; | 414 DLOG(WARNING) << "Failed to apply desktop security to the renderer"; |
| 414 return result; | 415 result = sandbox::SBOX_ALL_OK; |
| 415 } | 416 } |
| 416 | 417 |
| 417 return result; | 418 return result; |
| 418 } | 419 } |
| 419 | 420 |
| 420 // Updates the command line arguments with debug-related flags. If debug flags | 421 // Updates the command line arguments with debug-related flags. If debug flags |
| 421 // have been used with this process, they will be filtered and added to | 422 // have been used with this process, they will be filtered and added to |
| 422 // command_line as needed. | 423 // command_line as needed. |
| 423 void ProcessDebugFlags(base::CommandLine* command_line) { | 424 void ProcessDebugFlags(base::CommandLine* command_line) { |
| 424 const base::CommandLine& current_cmd_line = | 425 const base::CommandLine& current_cmd_line = |
| (...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 816 } | 817 } |
| 817 | 818 |
| 818 delegate->PostSpawnTarget(target.process_handle()); | 819 delegate->PostSpawnTarget(target.process_handle()); |
| 819 | 820 |
| 820 CHECK(ResumeThread(target.thread_handle()) != static_cast<DWORD>(-1)); | 821 CHECK(ResumeThread(target.thread_handle()) != static_cast<DWORD>(-1)); |
| 821 *process = base::Process(target.TakeProcessHandle()); | 822 *process = base::Process(target.TakeProcessHandle()); |
| 822 return sandbox::SBOX_ALL_OK; | 823 return sandbox::SBOX_ALL_OK; |
| 823 } | 824 } |
| 824 | 825 |
| 825 } // namespace content | 826 } // namespace content |
| OLD | NEW |