| 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/browser/gpu/gpu_process_host.h" | 5 #include "content/browser/gpu/gpu_process_host.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 return true; | 198 return true; |
| 199 } | 199 } |
| 200 | 200 |
| 201 // For the GPU process we gotten as far as USER_LIMITED. The next level | 201 // For the GPU process we gotten as far as USER_LIMITED. The next level |
| 202 // which is USER_RESTRICTED breaks both the DirectX backend and the OpenGL | 202 // which is USER_RESTRICTED breaks both the DirectX backend and the OpenGL |
| 203 // backend. Note that the GPU process is connected to the interactive | 203 // backend. Note that the GPU process is connected to the interactive |
| 204 // desktop. | 204 // desktop. |
| 205 bool PreSpawnTarget(sandbox::TargetPolicy* policy) override { | 205 bool PreSpawnTarget(sandbox::TargetPolicy* policy) override { |
| 206 if (base::win::GetVersion() > base::win::VERSION_XP) { | 206 if (base::win::GetVersion() > base::win::VERSION_XP) { |
| 207 if (cmd_line_->GetSwitchValueASCII(switches::kUseGL) == | 207 if (cmd_line_->GetSwitchValueASCII(switches::kUseGL) == |
| 208 gfx::kGLImplementationDesktopName) { | 208 gl::kGLImplementationDesktopName) { |
| 209 // Open GL path. | 209 // Open GL path. |
| 210 policy->SetTokenLevel(sandbox::USER_RESTRICTED_SAME_ACCESS, | 210 policy->SetTokenLevel(sandbox::USER_RESTRICTED_SAME_ACCESS, |
| 211 sandbox::USER_LIMITED); | 211 sandbox::USER_LIMITED); |
| 212 SetJobLevel(*cmd_line_, sandbox::JOB_UNPROTECTED, 0, policy); | 212 SetJobLevel(*cmd_line_, sandbox::JOB_UNPROTECTED, 0, policy); |
| 213 policy->SetDelayedIntegrityLevel(sandbox::INTEGRITY_LEVEL_LOW); | 213 policy->SetDelayedIntegrityLevel(sandbox::INTEGRITY_LEVEL_LOW); |
| 214 } else { | 214 } else { |
| 215 policy->SetTokenLevel(sandbox::USER_RESTRICTED_SAME_ACCESS, | 215 policy->SetTokenLevel(sandbox::USER_RESTRICTED_SAME_ACCESS, |
| 216 sandbox::USER_LIMITED); | 216 sandbox::USER_LIMITED); |
| 217 | 217 |
| 218 // UI restrictions break when we access Windows from outside our job. | 218 // UI restrictions break when we access Windows from outside our job. |
| (...skipping 953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1172 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); | 1172 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); |
| 1173 ClientIdToShaderCacheMap::iterator iter = | 1173 ClientIdToShaderCacheMap::iterator iter = |
| 1174 client_id_to_shader_cache_.find(client_id); | 1174 client_id_to_shader_cache_.find(client_id); |
| 1175 // If the cache doesn't exist then this is an off the record profile. | 1175 // If the cache doesn't exist then this is an off the record profile. |
| 1176 if (iter == client_id_to_shader_cache_.end()) | 1176 if (iter == client_id_to_shader_cache_.end()) |
| 1177 return; | 1177 return; |
| 1178 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); | 1178 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); |
| 1179 } | 1179 } |
| 1180 | 1180 |
| 1181 } // namespace content | 1181 } // namespace content |
| OLD | NEW |