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 | 9 |
9 #include "base/bind.h" | 10 #include "base/bind.h" |
10 #include "content/browser/gpu/compositor_util.h" | 11 #include "content/browser/gpu/compositor_util.h" |
11 #include "content/public/browser/gpu_data_manager.h" | 12 #include "content/public/browser/gpu_data_manager.h" |
12 #include "gpu/config/gpu_info.h" | 13 #include "gpu/config/gpu_info.h" |
13 | 14 |
14 namespace content { | 15 namespace content { |
15 namespace devtools { | 16 namespace devtools { |
16 namespace system_info { | 17 namespace system_info { |
17 | 18 |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 gpu::GPUInfo gpu_info = GpuDataManager::GetInstance()->GetGPUInfo(); | 189 gpu::GPUInfo gpu_info = GpuDataManager::GetInstance()->GetGPUInfo(); |
189 std::vector<scoped_refptr<GPUDevice>> devices; | 190 std::vector<scoped_refptr<GPUDevice>> devices; |
190 devices.push_back(GPUDeviceToProtocol(gpu_info.gpu)); | 191 devices.push_back(GPUDeviceToProtocol(gpu_info.gpu)); |
191 for (const auto& device : gpu_info.secondary_gpus) | 192 for (const auto& device : gpu_info.secondary_gpus) |
192 devices.push_back(GPUDeviceToProtocol(device)); | 193 devices.push_back(GPUDeviceToProtocol(device)); |
193 | 194 |
194 scoped_ptr<base::DictionaryValue> aux_attributes(new base::DictionaryValue); | 195 scoped_ptr<base::DictionaryValue> aux_attributes(new base::DictionaryValue); |
195 AuxGPUInfoEnumerator enumerator(aux_attributes.get()); | 196 AuxGPUInfoEnumerator enumerator(aux_attributes.get()); |
196 gpu_info.EnumerateFields(&enumerator); | 197 gpu_info.EnumerateFields(&enumerator); |
197 | 198 |
198 scoped_refptr<GPUInfo> gpu = GPUInfo::Create() | 199 scoped_refptr<GPUInfo> gpu = |
199 ->set_devices(devices) | 200 GPUInfo::Create() |
200 ->set_aux_attributes(aux_attributes.Pass()) | 201 ->set_devices(devices) |
201 ->set_feature_status(make_scoped_ptr(GetFeatureStatus())) | 202 ->set_aux_attributes(std::move(aux_attributes)) |
202 ->set_driver_bug_workarounds(GetDriverBugWorkarounds()); | 203 ->set_feature_status(make_scoped_ptr(GetFeatureStatus())) |
| 204 ->set_driver_bug_workarounds(GetDriverBugWorkarounds()); |
203 | 205 |
204 client_->SendGetInfoResponse( | 206 client_->SendGetInfoResponse( |
205 command_id, | 207 command_id, |
206 GetInfoResponse::Create()->set_gpu(gpu) | 208 GetInfoResponse::Create()->set_gpu(gpu) |
207 ->set_model_name(gpu_info.machine_model_name) | 209 ->set_model_name(gpu_info.machine_model_name) |
208 ->set_model_version(gpu_info.machine_model_version)); | 210 ->set_model_version(gpu_info.machine_model_version)); |
209 } | 211 } |
210 | 212 |
211 void SystemInfoHandler::AddActiveObserverId(int observer_id) { | 213 void SystemInfoHandler::AddActiveObserverId(int observer_id) { |
212 base::AutoLock auto_lock(lock_); | 214 base::AutoLock auto_lock(lock_); |
(...skipping 13 matching lines...) Expand all Loading... |
226 SendGetInfoResponse(command_id); | 228 SendGetInfoResponse(command_id); |
227 // For the time being we want to know about this event in the test logs. | 229 // For the time being we want to know about this event in the test logs. |
228 LOG(ERROR) << "SystemInfoHandler: request for GPU info timed out!" | 230 LOG(ERROR) << "SystemInfoHandler: request for GPU info timed out!" |
229 << " Most recent info sent."; | 231 << " Most recent info sent."; |
230 } | 232 } |
231 } | 233 } |
232 | 234 |
233 } // namespace system_info | 235 } // namespace system_info |
234 } // namespace devtools | 236 } // namespace devtools |
235 } // namespace content | 237 } // namespace content |
OLD | NEW |