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

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

Issue 2569413002: Don't block GPU process access in single-process mode. (Closed)
Patch Set: update comments Created 4 years 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/gpu/gpu_data_manager_impl_private.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/gpu/gpu_data_manager_impl_private.cc
diff --git a/content/browser/gpu/gpu_data_manager_impl_private.cc b/content/browser/gpu/gpu_data_manager_impl_private.cc
index e114814bd9f61f01e0561a54a0cdf24d1d932a41..83ef7cac45db21659575c4acf55ac4562c748e8d 100644
--- a/content/browser/gpu/gpu_data_manager_impl_private.cc
+++ b/content/browser/gpu/gpu_data_manager_impl_private.cc
@@ -337,6 +337,9 @@ bool GpuDataManagerImplPrivate::GpuAccessAllowed(
return false;
}
+ if (in_process_gpu_)
+ return true;
+
if (card_blacklisted_) {
if (reason) {
*reason = "GPU access is disabled ";
@@ -600,8 +603,7 @@ void GpuDataManagerImplPrivate::Initialize() {
gpu_driver_bug_list_string,
gpu_info);
- if (command_line->HasSwitch(switches::kSingleProcess) ||
- command_line->HasSwitch(switches::kInProcessGPU)) {
+ if (in_process_gpu_) {
command_line->AppendSwitch(switches::kDisableGpuWatchdog);
AppendGpuCommandLine(command_line, nullptr);
}
@@ -1105,16 +1107,21 @@ GpuDataManagerImplPrivate::GpuDataManagerImplPrivate(GpuDataManagerImpl* owner)
owner_(owner),
gpu_process_accessible_(true),
is_initialized_(false),
- finalized_(false) {
+ finalized_(false),
+ in_process_gpu_(false) {
DCHECK(owner_);
const base::CommandLine* command_line =
base::CommandLine::ForCurrentProcess();
- swiftshader_path_ =
- base::CommandLine::ForCurrentProcess()->GetSwitchValuePath(
- switches::kSwiftShaderPath);
+ swiftshader_path_ = command_line->GetSwitchValuePath(
+ switches::kSwiftShaderPath);
if (ShouldDisableHardwareAcceleration())
DisableHardwareAcceleration();
+ if (command_line->HasSwitch(switches::kSingleProcess) ||
+ command_line->HasSwitch(switches::kInProcessGPU)) {
+ in_process_gpu_ = true;
+ }
+
#if defined(OS_MACOSX)
CGDisplayRegisterReconfigurationCallback(DisplayReconfigCallback, owner_);
#endif // OS_MACOSX
« no previous file with comments | « content/browser/gpu/gpu_data_manager_impl_private.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698