| 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 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 674 TRACE_EVENT1("startup", "StartProcessWithAccess", "type", type_str); | 674 TRACE_EVENT1("startup", "StartProcessWithAccess", "type", type_str); |
| 675 | 675 |
| 676 // Propagate the --allow-no-job flag if present. | 676 // Propagate the --allow-no-job flag if present. |
| 677 if (browser_command_line.HasSwitch(switches::kAllowNoSandboxJob) && | 677 if (browser_command_line.HasSwitch(switches::kAllowNoSandboxJob) && |
| 678 !cmd_line->HasSwitch(switches::kAllowNoSandboxJob)) { | 678 !cmd_line->HasSwitch(switches::kAllowNoSandboxJob)) { |
| 679 cmd_line->AppendSwitch(switches::kAllowNoSandboxJob); | 679 cmd_line->AppendSwitch(switches::kAllowNoSandboxJob); |
| 680 } | 680 } |
| 681 | 681 |
| 682 ProcessDebugFlags(cmd_line); | 682 ProcessDebugFlags(cmd_line); |
| 683 | 683 |
| 684 // Prefetch hints on windows: | |
| 685 // Using a different prefetch profile per process type will allow Windows | |
| 686 // to create separate pretetch settings for browser, renderer etc. | |
| 687 cmd_line->AppendArg(base::StringPrintf("/prefetch:%d", base::Hash(type_str))); | |
| 688 | |
| 689 if ((!delegate->ShouldSandbox()) || | 684 if ((!delegate->ShouldSandbox()) || |
| 690 browser_command_line.HasSwitch(switches::kNoSandbox) || | 685 browser_command_line.HasSwitch(switches::kNoSandbox) || |
| 691 cmd_line->HasSwitch(switches::kNoSandbox)) { | 686 cmd_line->HasSwitch(switches::kNoSandbox)) { |
| 692 base::Process process = | 687 base::Process process = |
| 693 base::LaunchProcess(*cmd_line, base::LaunchOptions()); | 688 base::LaunchProcess(*cmd_line, base::LaunchOptions()); |
| 694 // TODO(rvargas) crbug.com/417532: Don't share a raw handle. | 689 // TODO(rvargas) crbug.com/417532: Don't share a raw handle. |
| 695 g_broker_services->AddTargetPeer(process.Handle()); | 690 g_broker_services->AddTargetPeer(process.Handle()); |
| 696 return process.Pass(); | 691 return process.Pass(); |
| 697 } | 692 } |
| 698 | 693 |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 859 } | 854 } |
| 860 | 855 |
| 861 return false; | 856 return false; |
| 862 } | 857 } |
| 863 | 858 |
| 864 bool BrokerAddTargetPeer(HANDLE peer_process) { | 859 bool BrokerAddTargetPeer(HANDLE peer_process) { |
| 865 return g_broker_services->AddTargetPeer(peer_process) == sandbox::SBOX_ALL_OK; | 860 return g_broker_services->AddTargetPeer(peer_process) == sandbox::SBOX_ALL_OK; |
| 866 } | 861 } |
| 867 | 862 |
| 868 } // namespace content | 863 } // namespace content |
| OLD | NEW |