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 <string> | 7 #include <string> |
8 | 8 |
9 #include "base/base_switches.h" | 9 #include "base/base_switches.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
552 if (command_line.HasSwitch(switches::kEnableAppContainer)) | 552 if (command_line.HasSwitch(switches::kEnableAppContainer)) |
553 return true; | 553 return true; |
554 return base::StartsWith(appcontainer_group_name, "Enabled", | 554 return base::StartsWith(appcontainer_group_name, "Enabled", |
555 base::CompareCase::INSENSITIVE_ASCII); | 555 base::CompareCase::INSENSITIVE_ASCII); |
556 } | 556 } |
557 | 557 |
558 } // namespace | 558 } // namespace |
559 | 559 |
560 void SetJobLevel(const base::CommandLine& cmd_line, | 560 void SetJobLevel(const base::CommandLine& cmd_line, |
561 sandbox::JobLevel job_level, | 561 sandbox::JobLevel job_level, |
562 uint32 ui_exceptions, | 562 uint32_t ui_exceptions, |
563 sandbox::TargetPolicy* policy) { | 563 sandbox::TargetPolicy* policy) { |
564 if (ShouldSetJobLevel(cmd_line)) { | 564 if (ShouldSetJobLevel(cmd_line)) { |
565 #ifdef _WIN64 | 565 #ifdef _WIN64 |
566 policy->SetJobMemoryLimit(4ULL * 1024 * 1024 * 1024); | 566 policy->SetJobMemoryLimit(4ULL * 1024 * 1024 * 1024); |
567 #endif | 567 #endif |
568 policy->SetJobLevel(job_level, ui_exceptions); | 568 policy->SetJobLevel(job_level, ui_exceptions); |
569 } else { | 569 } else { |
570 policy->SetJobLevel(sandbox::JOB_NONE, 0); | 570 policy->SetJobLevel(sandbox::JOB_NONE, 0); |
571 } | 571 } |
572 } | 572 } |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
851 } | 851 } |
852 | 852 |
853 return false; | 853 return false; |
854 } | 854 } |
855 | 855 |
856 bool BrokerAddTargetPeer(HANDLE peer_process) { | 856 bool BrokerAddTargetPeer(HANDLE peer_process) { |
857 return g_broker_services->AddTargetPeer(peer_process) == sandbox::SBOX_ALL_OK; | 857 return g_broker_services->AddTargetPeer(peer_process) == sandbox::SBOX_ALL_OK; |
858 } | 858 } |
859 | 859 |
860 } // namespace content | 860 } // namespace content |
OLD | NEW |