Chromium Code Reviews| Index: content/browser/devtools/protocol/system_info_handler.cc |
| diff --git a/content/browser/devtools/protocol/system_info_handler.cc b/content/browser/devtools/protocol/system_info_handler.cc |
| index 27877b0bd981f9fd9d43169fdc261953642d22e8..340bca475580c466412c82c40a82cd54407f7c9e 100644 |
| --- a/content/browser/devtools/protocol/system_info_handler.cc |
| +++ b/content/browser/devtools/protocol/system_info_handler.cc |
| @@ -8,9 +8,12 @@ |
| #include <utility> |
| #include "base/bind.h" |
| +#include "base/command_line.h" |
| #include "content/browser/gpu/compositor_util.h" |
| #include "content/public/browser/gpu_data_manager.h" |
| +#include "gpu/config/gpu_feature_type.h" |
| #include "gpu/config/gpu_info.h" |
| +#include "gpu/config/gpu_switches.h" |
| namespace content { |
| namespace devtools { |
| @@ -147,9 +150,22 @@ void SystemInfoHandler::SetClient(scoped_ptr<Client> client) { |
| } |
| Response SystemInfoHandler::GetInfo(DevToolsCommandId command_id) { |
| + bool skip_request_collection = false; |
| +#if defined(OS_LINUX) |
| + skip_request_collection = base::CommandLine::ForCurrentProcess()->HasSwitch( |
| + switches::kGpuTestingNoCompleteInfoCollection); |
| + for (int feature = 0; feature < gpu::NUMBER_OF_GPU_FEATURE_TYPES; ++feature) { |
|
Zhenyao Mo
2016/02/02 22:22:34
I don't think this for-loop logic is necessary. I
|
| + skip_request_collection &= |
| + GpuDataManager::GetInstance()->IsFeatureBlacklisted(feature); |
| + if (!skip_request_collection) |
| + break; |
| + } |
| +#endif |
| + |
| std::string reason; |
| if (!GpuDataManager::GetInstance()->GpuAccessAllowed(&reason) || |
| - GpuDataManager::GetInstance()->IsEssentialGpuInfoAvailable()) { |
| + GpuDataManager::GetInstance()->IsEssentialGpuInfoAvailable() || |
| + skip_request_collection) { |
| // The GpuDataManager already has all of the information needed to make |
| // GPU-based blacklisting decisions. Post a task to give it to the |
| // client asynchronously. |