summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzmo@chromium.org <zmo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-07 00:12:55 +0000
committerzmo@chromium.org <zmo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-07 00:12:55 +0000
commita0401380072097ae9a3b34ed900299f26ef9bf6d (patch)
tree1863e20cfb1b55649c91850e545043e6f26fe5d2
parent858ddc0adbeb9fb56a5ea54aed4b488258cb3851 (diff)
downloadchromium_src-a0401380072097ae9a3b34ed900299f26ef9bf6d.zip
chromium_src-a0401380072097ae9a3b34ed900299f26ef9bf6d.tar.gz
chromium_src-a0401380072097ae9a3b34ed900299f26ef9bf6d.tar.bz2
Provide a reason why GPU access is blocked.
This provides better information in about:gpu, which helps us to better diagnose GPU feature failures. Also, move the gpu access blocked message to the top as this is the most important message as compared with individual blacklist entry messages. BUG=237393 TEST=about:gpu shows gpu process fails to launch because of settings where gpu is turned off R=joi@chromium.org, kbr@chromium.org, sky@chromium.org, thestig@chromium.org Review URL: https://codereview.chromium.org/14697014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@198570 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/component_updater/swiftshader_component_installer.cc2
-rw-r--r--chrome/browser/gpu/gpu_feature_checker.cc2
-rw-r--r--chrome/browser/ui/webui/flash_ui.cc9
-rw-r--r--content/browser/browser_main_loop.cc2
-rw-r--r--content/browser/gpu/compositor_util.cc2
-rw-r--r--content/browser/gpu/gpu_data_manager_impl.cc30
-rw-r--r--content/browser/gpu/gpu_data_manager_impl.h2
-rw-r--r--content/browser/gpu/gpu_data_manager_impl_unittest.cc90
-rw-r--r--content/browser/gpu/gpu_internals_ui.cc8
-rw-r--r--content/browser/gpu/gpu_process_host.cc6
-rw-r--r--content/public/browser/gpu_data_manager.h4
11 files changed, 116 insertions, 41 deletions
diff --git a/chrome/browser/component_updater/swiftshader_component_installer.cc b/chrome/browser/component_updater/swiftshader_component_installer.cc
index f956a93..8e365da 100644
--- a/chrome/browser/component_updater/swiftshader_component_installer.cc
+++ b/chrome/browser/component_updater/swiftshader_component_installer.cc
@@ -179,7 +179,7 @@ UpdateChecker::UpdateChecker(ComponentUpdateService* cus)
void UpdateChecker::OnGpuInfoUpdate() {
GpuDataManager *gpu_data_manager = GpuDataManager::GetInstance();
- if (!gpu_data_manager->GpuAccessAllowed() ||
+ if (!gpu_data_manager->GpuAccessAllowed(NULL) ||
gpu_data_manager->IsFeatureBlacklisted(content::GPU_FEATURE_TYPE_WEBGL) ||
gpu_data_manager->ShouldUseSwiftShader()) {
gpu_data_manager->RemoveObserver(this);
diff --git a/chrome/browser/gpu/gpu_feature_checker.cc b/chrome/browser/gpu/gpu_feature_checker.cc
index 23e0fb1..084f0c8 100644
--- a/chrome/browser/gpu/gpu_feature_checker.cc
+++ b/chrome/browser/gpu/gpu_feature_checker.cc
@@ -14,7 +14,7 @@ namespace {
// GPU info has been collected in a GPU process.
bool IsFeatureAllowed(content::GpuDataManager* manager,
content::GpuFeatureType feature) {
- return (manager->GpuAccessAllowed() &&
+ return (manager->GpuAccessAllowed(NULL) &&
!manager->IsFeatureBlacklisted(feature));
}
diff --git a/chrome/browser/ui/webui/flash_ui.cc b/chrome/browser/ui/webui/flash_ui.cc
index 0a1a9f2..94678562 100644
--- a/chrome/browser/ui/webui/flash_ui.cc
+++ b/chrome/browser/ui/webui/flash_ui.cc
@@ -153,7 +153,7 @@ FlashDOMHandler::FlashDOMHandler()
// GPU access might not be allowed at all, which will cause us not to get a
// call back.
- if (!GpuDataManager::GetInstance()->GpuAccessAllowed())
+ if (!GpuDataManager::GetInstance()->GpuAccessAllowed(NULL))
OnGpuInfoUpdate();
PluginService::GetInstance()->GetPlugins(base::Bind(
@@ -316,8 +316,11 @@ void FlashDOMHandler::MaybeRespondToPage() {
AddPair(list, string16(), "--- GPU information ---");
content::GPUInfo gpu_info = GpuDataManager::GetInstance()->GetGPUInfo();
- if (!GpuDataManager::GetInstance()->GpuAccessAllowed())
- AddPair(list, ASCIIToUTF16("WARNING:"), "GPU access is not allowed");
+ std::string reason;
+ if (!GpuDataManager::GetInstance()->GpuAccessAllowed(&reason)) {
+ AddPair(list, ASCIIToUTF16("WARNING:"),
+ "GPU access is not allowed: " + reason);
+ }
#if defined(OS_WIN)
const content::DxDiagNode& node = gpu_info.dx_diagnostics;
for (std::map<std::string, content::DxDiagNode>::const_iterator it =
diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc
index 3c20e5f..31f9f17 100644
--- a/content/browser/browser_main_loop.cc
+++ b/content/browser/browser_main_loop.cc
@@ -792,7 +792,7 @@ void BrowserMainLoop::BrowserThreadsStarted() {
// When running the GPU thread in-process, avoid optimistically starting it
// since creating the GPU thread races against creation of the one-and-only
// ChildProcess instance which is created by the renderer thread.
- if (GpuDataManagerImpl::GetInstance()->GpuAccessAllowed() &&
+ if (GpuDataManagerImpl::GetInstance()->GpuAccessAllowed(NULL) &&
IsForceCompositingModeEnabled() &&
!parsed_command_line_.HasSwitch(switches::kDisableGpuProcessPrelaunch) &&
!parsed_command_line_.HasSwitch(switches::kSingleProcess) &&
diff --git a/content/browser/gpu/compositor_util.cc b/content/browser/gpu/compositor_util.cc
index 114987e..0b34932 100644
--- a/content/browser/gpu/compositor_util.cc
+++ b/content/browser/gpu/compositor_util.cc
@@ -20,7 +20,7 @@ bool CanDoAcceleratedCompositing() {
// Don't run the field trial if gpu access has been blocked or
// accelerated compositing is blacklisted.
- if (!manager->GpuAccessAllowed() ||
+ if (!manager->GpuAccessAllowed(NULL) ||
manager->IsFeatureBlacklisted(GPU_FEATURE_TYPE_ACCELERATED_COMPOSITING))
return false;
diff --git a/content/browser/gpu/gpu_data_manager_impl.cc b/content/browser/gpu/gpu_data_manager_impl.cc
index 1ac0c17..5f17f0a 100644
--- a/content/browser/gpu/gpu_data_manager_impl.cc
+++ b/content/browser/gpu/gpu_data_manager_impl.cc
@@ -168,23 +168,40 @@ void GpuDataManagerImpl::GetGpuProcessHandles(
GpuProcessHost::GetProcessHandles(callback);
}
-bool GpuDataManagerImpl::GpuAccessAllowed() const {
+bool GpuDataManagerImpl::GpuAccessAllowed(std::string* reason) const {
if (use_swiftshader_)
return true;
- if (!gpu_info_.gpu_accessible)
+ if (!gpu_info_.gpu_accessible) {
+ if (reason) {
+ *reason = "GPU process launch failed.";
+ }
return false;
+ }
- if (card_blacklisted_)
+ if (card_blacklisted_) {
+ if (reason) {
+ *reason = "GPU access is disabled ";
+ CommandLine* command_line = CommandLine::ForCurrentProcess();
+ if (command_line->HasSwitch(switches::kDisableGpu))
+ *reason += "through commandline switch --disable-gpu.";
+ else
+ *reason += "in chrome://settings.";
+ }
return false;
+ }
// We only need to block GPU process if more features are disallowed other
// than those in the preliminary gpu feature flags because the latter work
// through renderer commandline switches.
std::set<int> features = preliminary_blacklisted_features_;
MergeFeatureSets(&features, blacklisted_features_);
- if (features.size() > preliminary_blacklisted_features_.size())
+ if (features.size() > preliminary_blacklisted_features_.size()) {
+ if (reason) {
+ *reason = "Features are disabled upon full but not preliminary GPU info.";
+ }
return false;
+ }
if (blacklisted_features_.size() == NUMBER_OF_GPU_FEATURE_TYPES) {
// On Linux, we use cached GL strings to make blacklist decsions at browser
@@ -193,6 +210,9 @@ bool GpuDataManagerImpl::GpuAccessAllowed() const {
// disabled, the GPU process will only initialize GL bindings, create a GL
// context, and collect full GPU info.
#if !defined(OS_LINUX)
+ if (reason) {
+ *reason = "All GPU features are blacklisted.";
+ }
return false;
#endif
}
@@ -806,7 +826,7 @@ void GpuDataManagerImpl::NotifyGpuInfoUpdate() {
}
void GpuDataManagerImpl::EnableSwiftShaderIfNecessary() {
- if (!GpuAccessAllowed() ||
+ if (!GpuAccessAllowed(NULL) ||
blacklisted_features_.count(GPU_FEATURE_TYPE_WEBGL)) {
if (!swiftshader_path_.empty() &&
!CommandLine::ForCurrentProcess()->HasSwitch(
diff --git a/content/browser/gpu/gpu_data_manager_impl.h b/content/browser/gpu/gpu_data_manager_impl.h
index 34462ff..5fa8780 100644
--- a/content/browser/gpu/gpu_data_manager_impl.h
+++ b/content/browser/gpu/gpu_data_manager_impl.h
@@ -69,7 +69,7 @@ class CONTENT_EXPORT GpuDataManagerImpl
virtual GPUInfo GetGPUInfo() const OVERRIDE;
virtual void GetGpuProcessHandles(
const GetGpuProcessHandlesCallback& callback) const OVERRIDE;
- virtual bool GpuAccessAllowed() const OVERRIDE;
+ virtual bool GpuAccessAllowed(std::string* reason) const OVERRIDE;
virtual void RequestCompleteGpuInfoIfNeeded() OVERRIDE;
virtual bool IsCompleteGpuInfoAvailable() const OVERRIDE;
virtual void RequestVideoMemoryUsageStatsUpdate() const OVERRIDE;
diff --git a/content/browser/gpu/gpu_data_manager_impl_unittest.cc b/content/browser/gpu/gpu_data_manager_impl_unittest.cc
index 280be50..efbcdfb 100644
--- a/content/browser/gpu/gpu_data_manager_impl_unittest.cc
+++ b/content/browser/gpu/gpu_data_manager_impl_unittest.cc
@@ -113,7 +113,9 @@ TEST_F(GpuDataManagerImplTest, GpuSideBlacklisting) {
ScopedGpuDataManagerImpl manager;
ASSERT_TRUE(manager.get());
EXPECT_EQ(0u, manager->GetBlacklistedFeatureCount());
- EXPECT_TRUE(manager->GpuAccessAllowed());
+ std::string reason;
+ EXPECT_TRUE(manager->GpuAccessAllowed(&reason));
+ EXPECT_TRUE(reason.empty());
const std::string blacklist_json = LONG_STRING_CONST(
{
@@ -145,14 +147,16 @@ TEST_F(GpuDataManagerImplTest, GpuSideBlacklisting) {
gpu_info.gpu.device_id = 0x0640;
manager->InitializeForTesting(blacklist_json, gpu_info);
- EXPECT_TRUE(manager->GpuAccessAllowed());
+ EXPECT_TRUE(manager->GpuAccessAllowed(&reason));
+ EXPECT_TRUE(reason.empty());
EXPECT_EQ(1u, manager->GetBlacklistedFeatureCount());
EXPECT_TRUE(manager->IsFeatureBlacklisted(GPU_FEATURE_TYPE_WEBGL));
gpu_info.gl_vendor = "NVIDIA";
gpu_info.gl_renderer = "NVIDIA GeForce GT 120";
manager->UpdateGpuInfo(gpu_info);
- EXPECT_FALSE(manager->GpuAccessAllowed());
+ EXPECT_FALSE(manager->GpuAccessAllowed(&reason));
+ EXPECT_FALSE(reason.empty());
EXPECT_EQ(2u, manager->GetBlacklistedFeatureCount());
EXPECT_TRUE(manager->IsFeatureBlacklisted(GPU_FEATURE_TYPE_WEBGL));
EXPECT_TRUE(manager->IsFeatureBlacklisted(
@@ -163,7 +167,7 @@ TEST_F(GpuDataManagerImplTest, GpuSideExceptions) {
ScopedGpuDataManagerImpl manager;
ASSERT_TRUE(manager.get());
EXPECT_EQ(0u, manager->GetBlacklistedFeatureCount());
- EXPECT_TRUE(manager->GpuAccessAllowed());
+ EXPECT_TRUE(manager->GpuAccessAllowed(NULL));
const std::string blacklist_json = LONG_STRING_CONST(
{
@@ -192,13 +196,13 @@ TEST_F(GpuDataManagerImplTest, GpuSideExceptions) {
gpu_info.gpu.device_id = 0x0640;
manager->InitializeForTesting(blacklist_json, gpu_info);
- EXPECT_TRUE(manager->GpuAccessAllowed());
+ EXPECT_TRUE(manager->GpuAccessAllowed(NULL));
EXPECT_EQ(0u, manager->GetBlacklistedFeatureCount());
// Now assume gpu process launches and full GPU info is collected.
gpu_info.gl_renderer = "NVIDIA GeForce GT 120";
manager->UpdateGpuInfo(gpu_info);
- EXPECT_TRUE(manager->GpuAccessAllowed());
+ EXPECT_TRUE(manager->GpuAccessAllowed(NULL));
EXPECT_EQ(0u, manager->GetBlacklistedFeatureCount());
}
@@ -206,10 +210,13 @@ TEST_F(GpuDataManagerImplTest, DisableHardwareAcceleration) {
ScopedGpuDataManagerImpl manager;
ASSERT_TRUE(manager.get());
EXPECT_EQ(0u, manager->GetBlacklistedFeatureCount());
- EXPECT_TRUE(manager->GpuAccessAllowed());
+ std::string reason;
+ EXPECT_TRUE(manager->GpuAccessAllowed(&reason));
+ EXPECT_TRUE(reason.empty());
manager->DisableHardwareAcceleration();
- EXPECT_FALSE(manager->GpuAccessAllowed());
+ EXPECT_FALSE(manager->GpuAccessAllowed(&reason));
+ EXPECT_FALSE(reason.empty());
EXPECT_EQ(static_cast<size_t>(NUMBER_OF_GPU_FEATURE_TYPES),
manager->GetBlacklistedFeatureCount());
}
@@ -219,11 +226,11 @@ TEST_F(GpuDataManagerImplTest, SwiftShaderRendering) {
ScopedGpuDataManagerImpl manager;
ASSERT_TRUE(manager.get());
EXPECT_EQ(0u, manager->GetBlacklistedFeatureCount());
- EXPECT_TRUE(manager->GpuAccessAllowed());
+ EXPECT_TRUE(manager->GpuAccessAllowed(NULL));
EXPECT_FALSE(manager->ShouldUseSwiftShader());
manager->DisableHardwareAcceleration();
- EXPECT_FALSE(manager->GpuAccessAllowed());
+ EXPECT_FALSE(manager->GpuAccessAllowed(NULL));
EXPECT_FALSE(manager->ShouldUseSwiftShader());
// If SwiftShader is enabled, even if we blacklist GPU,
@@ -231,7 +238,7 @@ TEST_F(GpuDataManagerImplTest, SwiftShaderRendering) {
const base::FilePath test_path(FILE_PATH_LITERAL("AnyPath"));
manager->RegisterSwiftShaderPath(test_path);
EXPECT_TRUE(manager->ShouldUseSwiftShader());
- EXPECT_TRUE(manager->GpuAccessAllowed());
+ EXPECT_TRUE(manager->GpuAccessAllowed(NULL));
EXPECT_EQ(1u, manager->GetBlacklistedFeatureCount());
EXPECT_TRUE(
manager->IsFeatureBlacklisted(GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS));
@@ -242,17 +249,17 @@ TEST_F(GpuDataManagerImplTest, SwiftShaderRendering2) {
ScopedGpuDataManagerImpl manager;
ASSERT_TRUE(manager.get());
EXPECT_EQ(0u, manager->GetBlacklistedFeatureCount());
- EXPECT_TRUE(manager->GpuAccessAllowed());
+ EXPECT_TRUE(manager->GpuAccessAllowed(NULL));
EXPECT_FALSE(manager->ShouldUseSwiftShader());
const base::FilePath test_path(FILE_PATH_LITERAL("AnyPath"));
manager->RegisterSwiftShaderPath(test_path);
EXPECT_EQ(0u, manager->GetBlacklistedFeatureCount());
- EXPECT_TRUE(manager->GpuAccessAllowed());
+ EXPECT_TRUE(manager->GpuAccessAllowed(NULL));
EXPECT_FALSE(manager->ShouldUseSwiftShader());
manager->DisableHardwareAcceleration();
- EXPECT_TRUE(manager->GpuAccessAllowed());
+ EXPECT_TRUE(manager->GpuAccessAllowed(NULL));
EXPECT_TRUE(manager->ShouldUseSwiftShader());
EXPECT_EQ(1u, manager->GetBlacklistedFeatureCount());
EXPECT_TRUE(
@@ -289,7 +296,7 @@ TEST_F(GpuDataManagerImplTest, NoGpuInfoUpdateWithSwiftShader) {
const base::FilePath test_path(FILE_PATH_LITERAL("AnyPath"));
manager->RegisterSwiftShaderPath(test_path);
EXPECT_TRUE(manager->ShouldUseSwiftShader());
- EXPECT_TRUE(manager->GpuAccessAllowed());
+ EXPECT_TRUE(manager->GpuAccessAllowed(NULL));
{
base::RunLoop run_loop;
@@ -471,7 +478,7 @@ TEST_F(GpuDataManagerImplTest, SetGLStrings) {
ScopedGpuDataManagerImpl manager;
ASSERT_TRUE(manager.get());
EXPECT_EQ(0u, manager->GetBlacklistedFeatureCount());
- EXPECT_TRUE(manager->GpuAccessAllowed());
+ EXPECT_TRUE(manager->GpuAccessAllowed(NULL));
const std::string blacklist_json = LONG_STRING_CONST(
{
@@ -503,7 +510,7 @@ TEST_F(GpuDataManagerImplTest, SetGLStrings) {
manager->InitializeForTesting(blacklist_json, gpu_info);
// Not enough GPUInfo.
- EXPECT_TRUE(manager->GpuAccessAllowed());
+ EXPECT_TRUE(manager->GpuAccessAllowed(NULL));
EXPECT_EQ(0u, manager->GetBlacklistedFeatureCount());
// Now assume browser gets GL strings from local state.
@@ -511,7 +518,7 @@ TEST_F(GpuDataManagerImplTest, SetGLStrings) {
// However, GPU process is not blocked because this is all browser side and
// happens before renderer launching.
manager->SetGLStrings(kGLVendorMesa, kGLRendererMesa, kGLVersionMesa801);
- EXPECT_TRUE(manager->GpuAccessAllowed());
+ EXPECT_TRUE(manager->GpuAccessAllowed(NULL));
EXPECT_EQ(1u, manager->GetBlacklistedFeatureCount());
EXPECT_TRUE(manager->IsFeatureBlacklisted(GPU_FEATURE_TYPE_WEBGL));
}
@@ -525,7 +532,7 @@ TEST_F(GpuDataManagerImplTest, SetGLStringsNoEffects) {
ScopedGpuDataManagerImpl manager;
ASSERT_TRUE(manager.get());
EXPECT_EQ(0u, manager->GetBlacklistedFeatureCount());
- EXPECT_TRUE(manager->GpuAccessAllowed());
+ EXPECT_TRUE(manager->GpuAccessAllowed(NULL));
const std::string blacklist_json = LONG_STRING_CONST(
{
@@ -562,7 +569,7 @@ TEST_F(GpuDataManagerImplTest, SetGLStringsNoEffects) {
manager->InitializeForTesting(blacklist_json, gpu_info);
// Full GPUInfo, the entry applies.
- EXPECT_TRUE(manager->GpuAccessAllowed());
+ EXPECT_TRUE(manager->GpuAccessAllowed(NULL));
EXPECT_EQ(1u, manager->GetBlacklistedFeatureCount());
EXPECT_TRUE(manager->IsFeatureBlacklisted(GPU_FEATURE_TYPE_WEBGL));
@@ -570,7 +577,7 @@ TEST_F(GpuDataManagerImplTest, SetGLStringsNoEffects) {
// SetGLStrings() has no effects because GPUInfo already got these strings.
// (Otherwise the entry should not apply.)
manager->SetGLStrings(kGLVendorMesa, kGLRendererMesa, kGLVersionMesa802);
- EXPECT_TRUE(manager->GpuAccessAllowed());
+ EXPECT_TRUE(manager->GpuAccessAllowed(NULL));
EXPECT_EQ(1u, manager->GetBlacklistedFeatureCount());
EXPECT_TRUE(manager->IsFeatureBlacklisted(GPU_FEATURE_TYPE_WEBGL));
}
@@ -605,4 +612,45 @@ TEST_F(GpuDataManagerImplTest, GpuDriverBugListMultiple) {
EXPECT_STREQ("5,7", args.c_str());
}
+TEST_F(GpuDataManagerImplTest, BlacklistAllFeatures) {
+ ScopedGpuDataManagerImpl manager;
+ ASSERT_TRUE(manager.get());
+ EXPECT_EQ(0u, manager->GetBlacklistedFeatureCount());
+ std::string reason;
+ EXPECT_TRUE(manager->GpuAccessAllowed(&reason));
+ EXPECT_TRUE(reason.empty());
+
+ const std::string blacklist_json = LONG_STRING_CONST(
+ {
+ "name": "gpu blacklist",
+ "version": "0.1",
+ "entries": [
+ {
+ "id": 1,
+ "features": [
+ "all"
+ ]
+ }
+ ]
+ }
+ );
+
+ GPUInfo gpu_info;
+ gpu_info.gpu.vendor_id = 0x10de;
+ gpu_info.gpu.device_id = 0x0640;
+ manager->InitializeForTesting(blacklist_json, gpu_info);
+
+ EXPECT_EQ(NUMBER_OF_GPU_FEATURE_TYPES,
+ manager->GetBlacklistedFeatureCount());
+ // TODO(zmo): remove the Linux specific behavior once we fix
+ // crbug.com/238466.
+#if defined(OS_LINUX)
+ EXPECT_TRUE(manager->GpuAccessAllowed(&reason));
+ EXPECT_TRUE(reason.empty());
+#else
+ EXPECT_FALSE(manager->GpuAccessAllowed(&reason));
+ EXPECT_FALSE(reason.empty());
+#endif
+}
+
} // namespace content
diff --git a/content/browser/gpu/gpu_internals_ui.cc b/content/browser/gpu/gpu_internals_ui.cc
index d8ac963..eb7646c 100644
--- a/content/browser/gpu/gpu_internals_ui.cc
+++ b/content/browser/gpu/gpu_internals_ui.cc
@@ -193,7 +193,9 @@ bool SupportsAccelerated2dCanvas() {
base::Value* GetFeatureStatus() {
const CommandLine& command_line = *CommandLine::ForCurrentProcess();
GpuDataManagerImpl* manager = GpuDataManagerImpl::GetInstance();
- bool gpu_access_blocked = !manager->GpuAccessAllowed();
+ std::string gpu_access_blocked_reason;
+ bool gpu_access_blocked =
+ !manager->GpuAccessAllowed(&gpu_access_blocked_reason);
base::DictionaryValue* status = new base::DictionaryValue();
@@ -438,10 +440,10 @@ base::Value* GetFeatureStatus() {
if (gpu_access_blocked) {
base::DictionaryValue* problem = new base::DictionaryValue();
problem->SetString("description",
- "GPU process was unable to boot. Access to GPU disallowed.");
+ "GPU process was unable to boot: " + gpu_access_blocked_reason);
problem->Set("crBugs", new base::ListValue());
problem->Set("webkitBugs", new base::ListValue());
- problem_list->Append(problem);
+ problem_list->Insert(0, problem);
}
for (size_t i = 0; i < kNumFeatures; ++i) {
diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc
index fa88129..560fed2a 100644
--- a/content/browser/gpu/gpu_process_host.cc
+++ b/content/browser/gpu/gpu_process_host.cc
@@ -347,7 +347,7 @@ GpuProcessHost* GpuProcessHost::Get(GpuProcessKind kind,
// Don't grant further access to GPU if it is not allowed.
GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance();
DCHECK(gpu_data_manager);
- if (!gpu_data_manager->GpuAccessAllowed())
+ if (!gpu_data_manager->GpuAccessAllowed(NULL))
return NULL;
if (g_gpu_process_hosts[kind] && ValidateHost(g_gpu_process_hosts[kind]))
@@ -705,7 +705,7 @@ void GpuProcessHost::EstablishGpuChannel(
TRACE_EVENT0("gpu", "GpuProcessHost::EstablishGpuChannel");
// If GPU features are already blacklisted, no need to establish the channel.
- if (!GpuDataManagerImpl::GetInstance()->GpuAccessAllowed()) {
+ if (!GpuDataManagerImpl::GetInstance()->GpuAccessAllowed(NULL)) {
callback.Run(IPC::ChannelHandle(), GPUInfo());
return;
}
@@ -791,7 +791,7 @@ void GpuProcessHost::OnChannelEstablished(
// Currently if any of the GPU features are blacklisted, we don't establish a
// GPU channel.
if (!channel_handle.name.empty() &&
- !GpuDataManagerImpl::GetInstance()->GpuAccessAllowed()) {
+ !GpuDataManagerImpl::GetInstance()->GpuAccessAllowed(NULL)) {
Send(new GpuMsg_CloseChannel(channel_handle));
callback.Run(IPC::ChannelHandle(), GPUInfo());
RouteOnUIThread(GpuHostMsg_OnLogMessage(
diff --git a/content/public/browser/gpu_data_manager.h b/content/public/browser/gpu_data_manager.h
index d43bc73..f76907a 100644
--- a/content/public/browser/gpu_data_manager.h
+++ b/content/public/browser/gpu_data_manager.h
@@ -50,7 +50,9 @@ class GpuDataManager {
// process, establish GPU channel, and GPU info collection, should be
// blocked.
// Can be called on any thread.
- virtual bool GpuAccessAllowed() const = 0;
+ // If |reason| is not NULL and GPU access is blocked, upon return, |reason|
+ // contains a description of the reason why GPU access is blocked.
+ virtual bool GpuAccessAllowed(std::string* reason) const = 0;
// Requests complete GPUinfo if it has not already been requested
virtual void RequestCompleteGpuInfoIfNeeded() = 0;