OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/devtools/protocol/system_info_handler.h" | 5 #include "content/browser/devtools/protocol/system_info_handler.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
| 11 #include "base/command_line.h" |
11 #include "content/browser/gpu/compositor_util.h" | 12 #include "content/browser/gpu/compositor_util.h" |
12 #include "content/public/browser/gpu_data_manager.h" | 13 #include "content/public/browser/gpu_data_manager.h" |
| 14 #include "gpu/config/gpu_feature_type.h" |
13 #include "gpu/config/gpu_info.h" | 15 #include "gpu/config/gpu_info.h" |
| 16 #include "gpu/config/gpu_switches.h" |
14 | 17 |
15 namespace content { | 18 namespace content { |
16 namespace devtools { | 19 namespace devtools { |
17 namespace system_info { | 20 namespace system_info { |
18 | 21 |
19 namespace { | 22 namespace { |
20 | 23 |
21 using Response = DevToolsProtocolClient::Response; | 24 using Response = DevToolsProtocolClient::Response; |
22 | 25 |
23 // Give the GPU process a few seconds to provide GPU info. | 26 // Give the GPU process a few seconds to provide GPU info. |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 SystemInfoHandler::~SystemInfoHandler() { | 145 SystemInfoHandler::~SystemInfoHandler() { |
143 } | 146 } |
144 | 147 |
145 void SystemInfoHandler::SetClient(scoped_ptr<Client> client) { | 148 void SystemInfoHandler::SetClient(scoped_ptr<Client> client) { |
146 client_.swap(client); | 149 client_.swap(client); |
147 } | 150 } |
148 | 151 |
149 Response SystemInfoHandler::GetInfo(DevToolsCommandId command_id) { | 152 Response SystemInfoHandler::GetInfo(DevToolsCommandId command_id) { |
150 std::string reason; | 153 std::string reason; |
151 if (!GpuDataManager::GetInstance()->GpuAccessAllowed(&reason) || | 154 if (!GpuDataManager::GetInstance()->GpuAccessAllowed(&reason) || |
152 GpuDataManager::GetInstance()->IsEssentialGpuInfoAvailable()) { | 155 GpuDataManager::GetInstance()->IsEssentialGpuInfoAvailable() || |
| 156 base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 157 switches::kGpuTestingNoCompleteInfoCollection)) { |
153 // The GpuDataManager already has all of the information needed to make | 158 // The GpuDataManager already has all of the information needed to make |
154 // GPU-based blacklisting decisions. Post a task to give it to the | 159 // GPU-based blacklisting decisions. Post a task to give it to the |
155 // client asynchronously. | 160 // client asynchronously. |
156 // | 161 // |
157 // Waiting for complete GPU info in the if-test above seems to | 162 // Waiting for complete GPU info in the if-test above seems to |
158 // frequently hit internal timeouts in the launching of the unsandboxed | 163 // frequently hit internal timeouts in the launching of the unsandboxed |
159 // GPU process in debug builds on Windows. | 164 // GPU process in debug builds on Windows. |
160 BrowserThread::PostTask( | 165 BrowserThread::PostTask( |
161 BrowserThread::UI, | 166 BrowserThread::UI, |
162 FROM_HERE, | 167 FROM_HERE, |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 SendGetInfoResponse(command_id); | 233 SendGetInfoResponse(command_id); |
229 // For the time being we want to know about this event in the test logs. | 234 // For the time being we want to know about this event in the test logs. |
230 LOG(ERROR) << "SystemInfoHandler: request for GPU info timed out!" | 235 LOG(ERROR) << "SystemInfoHandler: request for GPU info timed out!" |
231 << " Most recent info sent."; | 236 << " Most recent info sent."; |
232 } | 237 } |
233 } | 238 } |
234 | 239 |
235 } // namespace system_info | 240 } // namespace system_info |
236 } // namespace devtools | 241 } // namespace devtools |
237 } // namespace content | 242 } // namespace content |
OLD | NEW |