| 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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 DWORD session_id = 0; | 233 DWORD session_id = 0; |
| 234 | 234 |
| 235 CHECK(::OpenProcessToken(::GetCurrentProcess(), TOKEN_QUERY, &token)); | 235 CHECK(::OpenProcessToken(::GetCurrentProcess(), TOKEN_QUERY, &token)); |
| 236 CHECK(::GetTokenInformation(token, TokenSessionId, &session_id, | 236 CHECK(::GetTokenInformation(token, TokenSessionId, &session_id, |
| 237 sizeof(session_id), &session_id_length)); | 237 sizeof(session_id), &session_id_length)); |
| 238 CloseHandle(token); | 238 CloseHandle(token); |
| 239 if (session_id) | 239 if (session_id) |
| 240 s_session_id = session_id; | 240 s_session_id = session_id; |
| 241 } | 241 } |
| 242 | 242 |
| 243 return base::StringPrintf(L"\\Sessions\\%lu%ls", s_session_id, object); | 243 return /*base::StringPrintf(L"\\Sessions\\%lu%ls", s_session_id, object)*/ L""
; |
| 244 } | 244 } |
| 245 | 245 |
| 246 // Checks if the sandbox should be let to run without a job object assigned. | 246 // Checks if the sandbox should be let to run without a job object assigned. |
| 247 bool ShouldSetJobLevel(const base::CommandLine& cmd_line) { | 247 bool ShouldSetJobLevel(const base::CommandLine& cmd_line) { |
| 248 if (!cmd_line.HasSwitch(switches::kAllowNoSandboxJob)) | 248 if (!cmd_line.HasSwitch(switches::kAllowNoSandboxJob)) |
| 249 return true; | 249 return true; |
| 250 | 250 |
| 251 // Windows 8 allows nested jobs so we don't need to check if we are in other | 251 // Windows 8 allows nested jobs so we don't need to check if we are in other |
| 252 // job. | 252 // job. |
| 253 if (base::win::GetVersion() >= base::win::VERSION_WIN8) | 253 if (base::win::GetVersion() >= base::win::VERSION_WIN8) |
| (...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 867 } | 867 } |
| 868 | 868 |
| 869 return false; | 869 return false; |
| 870 } | 870 } |
| 871 | 871 |
| 872 bool BrokerAddTargetPeer(HANDLE peer_process) { | 872 bool BrokerAddTargetPeer(HANDLE peer_process) { |
| 873 return g_broker_services->AddTargetPeer(peer_process) == sandbox::SBOX_ALL_OK; | 873 return g_broker_services->AddTargetPeer(peer_process) == sandbox::SBOX_ALL_OK; |
| 874 } | 874 } |
| 875 | 875 |
| 876 } // namespace content | 876 } // namespace content |
| OLD | NEW |