Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(430)

Side by Side Diff: content/common/sandbox_win.cc

Issue 2909943003: Removing useless Win7 checks + standardize its use (Closed)
Patch Set: Various nits Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 UMA_HISTOGRAM_SPARSE_SLOWLY("Process.Sandbox.Launch.WarningResultCode", 396 UMA_HISTOGRAM_SPARSE_SLOWLY("Process.Sandbox.Launch.WarningResultCode",
397 last_warning); 397 last_warning);
398 UMA_HISTOGRAM_SPARSE_SLOWLY("Process.Sandbox.Launch.Warning", last_error); 398 UMA_HISTOGRAM_SPARSE_SLOWLY("Process.Sandbox.Launch.Warning", last_error);
399 } 399 }
400 400
401 sandbox::ResultCode AddPolicyForSandboxedProcess( 401 sandbox::ResultCode AddPolicyForSandboxedProcess(
402 sandbox::TargetPolicy* policy) { 402 sandbox::TargetPolicy* policy) {
403 sandbox::ResultCode result = sandbox::SBOX_ALL_OK; 403 sandbox::ResultCode result = sandbox::SBOX_ALL_OK;
404 404
405 // Win8+ adds a device DeviceApi that we don't need. 405 // Win8+ adds a device DeviceApi that we don't need.
406 if (base::win::GetVersion() > base::win::VERSION_WIN7) 406 if (base::win::GetVersion() >= base::win::VERSION_WIN8)
407 result = policy->AddKernelObjectToClose(L"File", L"\\Device\\DeviceApi"); 407 result = policy->AddKernelObjectToClose(L"File", L"\\Device\\DeviceApi");
408 if (result != sandbox::SBOX_ALL_OK) 408 if (result != sandbox::SBOX_ALL_OK)
409 return result; 409 return result;
410 410
411 // Close the proxy settings on XP. 411 // Close the proxy settings on XP.
412 if (base::win::GetVersion() <= base::win::VERSION_SERVER_2003) 412 if (base::win::GetVersion() <= base::win::VERSION_SERVER_2003)
413 result = policy->AddKernelObjectToClose(L"Key", 413 result = policy->AddKernelObjectToClose(L"Key",
414 L"HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\" \ 414 L"HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\" \
415 L"CurrentVersion\\Internet Settings"); 415 L"CurrentVersion\\Internet Settings");
416 if (result != sandbox::SBOX_ALL_OK) 416 if (result != sandbox::SBOX_ALL_OK)
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
887 } 887 }
888 888
889 delegate->PostSpawnTarget(target.process_handle()); 889 delegate->PostSpawnTarget(target.process_handle());
890 890
891 CHECK(ResumeThread(target.thread_handle()) != static_cast<DWORD>(-1)); 891 CHECK(ResumeThread(target.thread_handle()) != static_cast<DWORD>(-1));
892 *process = base::Process(target.TakeProcessHandle()); 892 *process = base::Process(target.TakeProcessHandle());
893 return sandbox::SBOX_ALL_OK; 893 return sandbox::SBOX_ALL_OK;
894 } 894 }
895 895
896 } // namespace content 896 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/legacy_render_widget_host_win.cc ('k') | content/ppapi_plugin/ppapi_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698