| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/devtools_system_info_handler.h" | 5 #include "content/browser/devtools/devtools_system_info_handler.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "content/browser/devtools/devtools_protocol_constants.h" | 10 #include "content/browser/devtools/devtools_protocol_constants.h" |
| 11 #include "content/browser/gpu/compositor_util.h" | 11 #include "content/browser/gpu/compositor_util.h" |
| 12 #include "content/browser/gpu/gpu_data_manager_impl.h" | 12 #include "content/browser/gpu/gpu_data_manager_impl.h" |
| 13 #include "gpu/config/gpu_info.h" | 13 #include "gpu/config/gpu_info.h" |
| 14 | 14 |
| 15 namespace content { | 15 namespace content { |
| 16 | 16 |
| 17 namespace { | 17 namespace { |
| 18 | 18 |
| 19 const char kAuxAttributes[] = "auxAttributes"; | 19 const char kAuxAttributes[] = "auxAttributes"; |
| 20 const char kDeviceId[] = "deviceId"; | 20 const char kDeviceId[] = "deviceId"; |
| 21 const char kDeviceString[] = "deviceString"; | 21 const char kDeviceString[] = "deviceString"; |
| 22 const char kDevices[] = "devices"; | 22 const char kDevices[] = "devices"; |
| 23 const char kDriverBugWorkarounds[] = "driverBugWorkarounds"; | 23 const char kDriverBugWorkarounds[] = "driverBugWorkarounds"; |
| 24 const char kFeatureStatus[] = "featureStatus"; | 24 const char kFeatureStatus[] = "featureStatus"; |
| 25 const char kGPU[] = "gpu"; | 25 const char kGPU[] = "gpu"; |
| 26 const char kModelName[] = "modelName"; | 26 const char kModelName[] = "modelName"; |
| 27 const char kModelVersion[] = "modelVersion"; |
| 27 const char kVendorId[] = "vendorId"; | 28 const char kVendorId[] = "vendorId"; |
| 28 const char kVendorString[] = "vendorString"; | 29 const char kVendorString[] = "vendorString"; |
| 29 | 30 |
| 30 class AuxGPUInfoEnumerator : public gpu::GPUInfo::Enumerator { | 31 class AuxGPUInfoEnumerator : public gpu::GPUInfo::Enumerator { |
| 31 public: | 32 public: |
| 32 AuxGPUInfoEnumerator(base::DictionaryValue* dictionary) | 33 AuxGPUInfoEnumerator(base::DictionaryValue* dictionary) |
| 33 : dictionary_(dictionary), | 34 : dictionary_(dictionary), |
| 34 in_aux_attributes_(false) { } | 35 in_aux_attributes_(false) { } |
| 35 | 36 |
| 36 virtual void AddInt64(const char* name, int64 value) OVERRIDE { | 37 virtual void AddInt64(const char* name, int64 value) OVERRIDE { |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 base::DictionaryValue* aux_attributes = new base::DictionaryValue; | 116 base::DictionaryValue* aux_attributes = new base::DictionaryValue; |
| 116 AuxGPUInfoEnumerator enumerator(aux_attributes); | 117 AuxGPUInfoEnumerator enumerator(aux_attributes); |
| 117 gpu_info.EnumerateFields(&enumerator); | 118 gpu_info.EnumerateFields(&enumerator); |
| 118 gpu_dict->Set(kAuxAttributes, aux_attributes); | 119 gpu_dict->Set(kAuxAttributes, aux_attributes); |
| 119 | 120 |
| 120 gpu_dict->Set(kFeatureStatus, GetFeatureStatus()); | 121 gpu_dict->Set(kFeatureStatus, GetFeatureStatus()); |
| 121 | 122 |
| 122 gpu_dict->Set(kDriverBugWorkarounds, GetDriverBugWorkarounds()); | 123 gpu_dict->Set(kDriverBugWorkarounds, GetDriverBugWorkarounds()); |
| 123 | 124 |
| 124 base::DictionaryValue* system_dict = new base::DictionaryValue; | 125 base::DictionaryValue* system_dict = new base::DictionaryValue; |
| 125 system_dict->SetString(kModelName, gpu_info.machine_model); | 126 system_dict->SetString(kModelName, gpu_info.machine_model_name); |
| 127 system_dict->SetString(kModelVersion, gpu_info.machine_model_version); |
| 126 system_dict->Set(kGPU, gpu_dict); | 128 system_dict->Set(kGPU, gpu_dict); |
| 127 return command->SuccessResponse(system_dict); | 129 return command->SuccessResponse(system_dict); |
| 128 } | 130 } |
| 129 | 131 |
| 130 } // namespace content | 132 } // namespace content |
| OLD | NEW |