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

Unified Diff: content/browser/gpu/gpu_process_host.cc

Issue 1851213002: Remove sandbox on Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix nacl compile issues Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/child_process_launcher.cc ('k') | content/browser/ppapi_plugin_process_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/gpu/gpu_process_host.cc
diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc
index c16a63968238191fc66a1ee016bd165350eb6e6c..cb073befdf1eaf9f10027879a26ccbecce143766 100644
--- a/content/browser/gpu/gpu_process_host.cc
+++ b/content/browser/gpu/gpu_process_host.cc
@@ -62,8 +62,6 @@
#if defined(OS_WIN)
#include "base/win/windows_version.h"
-#include "content/common/sandbox_win.h"
-#include "sandbox/win/src/sandbox_policy.h"
#include "ui/gfx/switches.h"
#include "ui/gfx/win/rendering_window_manager.h"
#endif
@@ -199,73 +197,6 @@ class GpuSandboxedProcessLauncherDelegate
// backend. Note that the GPU process is connected to the interactive
// desktop.
bool PreSpawnTarget(sandbox::TargetPolicy* policy) override {
- if (base::win::GetVersion() > base::win::VERSION_XP) {
- if (cmd_line_->GetSwitchValueASCII(switches::kUseGL) ==
- gfx::kGLImplementationDesktopName) {
- // Open GL path.
- policy->SetTokenLevel(sandbox::USER_RESTRICTED_SAME_ACCESS,
- sandbox::USER_LIMITED);
- SetJobLevel(*cmd_line_, sandbox::JOB_UNPROTECTED, 0, policy);
- policy->SetDelayedIntegrityLevel(sandbox::INTEGRITY_LEVEL_LOW);
- } else {
- policy->SetTokenLevel(sandbox::USER_RESTRICTED_SAME_ACCESS,
- sandbox::USER_LIMITED);
-
- // UI restrictions break when we access Windows from outside our job.
- // However, we don't want a proxy window in this process because it can
- // introduce deadlocks where the renderer blocks on the gpu, which in
- // turn blocks on the browser UI thread. So, instead we forgo a window
- // message pump entirely and just add job restrictions to prevent child
- // processes.
- SetJobLevel(*cmd_line_,
- sandbox::JOB_LIMITED_USER,
- JOB_OBJECT_UILIMIT_SYSTEMPARAMETERS |
- JOB_OBJECT_UILIMIT_DESKTOP |
- JOB_OBJECT_UILIMIT_EXITWINDOWS |
- JOB_OBJECT_UILIMIT_DISPLAYSETTINGS,
- policy);
-
- policy->SetIntegrityLevel(sandbox::INTEGRITY_LEVEL_LOW);
- }
- } else {
- SetJobLevel(*cmd_line_, sandbox::JOB_UNPROTECTED, 0, policy);
- policy->SetTokenLevel(sandbox::USER_UNPROTECTED,
- sandbox::USER_LIMITED);
- }
-
- // Allow the server side of GPU sockets, which are pipes that have
- // the "chrome.gpu" namespace and an arbitrary suffix.
- sandbox::ResultCode result = policy->AddRule(
- sandbox::TargetPolicy::SUBSYS_NAMED_PIPES,
- sandbox::TargetPolicy::NAMEDPIPES_ALLOW_ANY,
- L"\\\\.\\pipe\\chrome.gpu.*");
- if (result != sandbox::SBOX_ALL_OK)
- return false;
-
- // Block this DLL even if it is not loaded by the browser process.
- policy->AddDllToUnload(L"cmsetac.dll");
-
-#ifdef USE_AURA
- // GPU also needs to add sections to the browser for aura
- // TODO(jschuh): refactor the GPU channel to remove this. crbug.com/128786
- result = policy->AddRule(sandbox::TargetPolicy::SUBSYS_HANDLES,
- sandbox::TargetPolicy::HANDLES_DUP_BROKER,
- L"Section");
- if (result != sandbox::SBOX_ALL_OK)
- return false;
-#endif
-
- if (cmd_line_->HasSwitch(switches::kEnableLogging)) {
- base::string16 log_file_path = logging::GetLogFileFullPath();
- if (!log_file_path.empty()) {
- result = policy->AddRule(sandbox::TargetPolicy::SUBSYS_FILES,
- sandbox::TargetPolicy::FILES_ALLOW_ANY,
- log_file_path.c_str());
- if (result != sandbox::SBOX_ALL_OK)
- return false;
- }
- }
-
return true;
}
#elif defined(OS_POSIX)
« no previous file with comments | « content/browser/child_process_launcher.cc ('k') | content/browser/ppapi_plugin_process_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698