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

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

Issue 12375003: Windows: Automatically disable GPU sandbox when DisplayLink is installed. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 10 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 | « no previous file | 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.cc
===================================================================
--- content/browser/gpu/gpu_data_manager_impl.cc (revision 184931)
+++ content/browser/gpu/gpu_data_manager_impl.cc (working copy)
@@ -4,6 +4,8 @@
#include "content/browser/gpu/gpu_data_manager_impl.h"
+#include <set>
+
#if defined(OS_MACOSX)
#include <ApplicationServices/ApplicationServices.h>
#endif // OS_MACOSX
@@ -14,6 +16,7 @@
#include "base/file_util.h"
#include "base/metrics/field_trial.h"
#include "base/metrics/histogram.h"
+#include "base/string16.h"
#include "base/string_piece.h"
#include "base/stringprintf.h"
#include "base/sys_info.h"
@@ -36,6 +39,7 @@
#include "webkit/plugins/plugin_switches.h"
#if defined(OS_WIN)
+#include "base/win/registry.h"
#include "base/win/windows_version.h"
#endif
@@ -83,6 +87,46 @@
BLOCK_STATUS_MAX
};
+#if defined(OS_WIN)
+bool GetInstalledProgramDisplayNames(std::set<string16>* display_names) {
+ base::win::RegKey key;
+
+ if (FAILED(key.Open(
+ HKEY_LOCAL_MACHINE, L"SOFTWARE", KEY_READ | KEY_WOW64_64KEY))) {
+ return false;
+ }
+
+ if (FAILED(key.OpenKey(L"Microsoft", KEY_READ | KEY_WOW64_64KEY)))
+ return false;
+
+ if (FAILED(key.OpenKey(L"Windows", KEY_READ | KEY_WOW64_64KEY)))
+ return false;
+
+ if (FAILED(key.OpenKey(L"CurrentVersion", KEY_READ | KEY_WOW64_64KEY)))
+ return false;
+
+ if (FAILED(key.OpenKey(L"Uninstall", KEY_READ | KEY_WOW64_64KEY)))
+ return false;
+
+ for (base::win::RegistryKeyIterator key_it(key.Handle(), NULL);
+ key_it.Valid();
+ ++key_it) {
+ base::win::RegKey sub_key;
+ if (FAILED(sub_key.Open(
+ key.Handle(), key_it.Name(), KEY_READ | KEY_WOW64_64KEY))) {
+ continue;
+ }
+
+ string16 display_name;
+ if (FAILED(sub_key.ReadValue(L"DisplayName", &display_name)))
+ continue;
+
+ display_names->insert(display_name);
+ }
+
+ return true;
+}
+#endif
} // namespace anonymous
// static
@@ -436,6 +480,17 @@
command_line->AppendSwitchPath(switches::kSwiftShaderPath,
swiftshader_path);
+#if defined(OS_WIN)
+ // DisplayLink drivers cause a hang when running in the GPU process sandbox.
+ std::set<string16> installed_display_names;
+ if (GetInstalledProgramDisplayNames(&installed_display_names)) {
+ if (installed_display_names.find(L"DisplayLink Core Software") !=
+ installed_display_names.end()) {
+ command_line->AppendSwitch(switches::kReduceGpuSandbox);
+ }
+ }
+#endif
+
{
base::AutoLock auto_lock(gpu_info_lock_);
if (gpu_info_.optimus)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698