| 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" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 base::Bind(&DevToolsSystemInfoHandler::OnGetInfo, | 94 base::Bind(&DevToolsSystemInfoHandler::OnGetInfo, |
| 95 base::Unretained(this))); | 95 base::Unretained(this))); |
| 96 } | 96 } |
| 97 | 97 |
| 98 DevToolsSystemInfoHandler::~DevToolsSystemInfoHandler() { | 98 DevToolsSystemInfoHandler::~DevToolsSystemInfoHandler() { |
| 99 } | 99 } |
| 100 | 100 |
| 101 scoped_refptr<DevToolsProtocol::Response> | 101 scoped_refptr<DevToolsProtocol::Response> |
| 102 DevToolsSystemInfoHandler::OnGetInfo( | 102 DevToolsSystemInfoHandler::OnGetInfo( |
| 103 scoped_refptr<DevToolsProtocol::Command> command) { | 103 scoped_refptr<DevToolsProtocol::Command> command) { |
| 104 VLOG(2) << "DevToolsSystemInfoHandler::OnGetInfo() : BEGIN"; | |
| 105 | |
| 106 gpu::GPUInfo gpu_info = GpuDataManagerImpl::GetInstance()->GetGPUInfo(); | 104 gpu::GPUInfo gpu_info = GpuDataManagerImpl::GetInstance()->GetGPUInfo(); |
| 107 base::DictionaryValue* gpu_dict = new base::DictionaryValue; | 105 base::DictionaryValue* gpu_dict = new base::DictionaryValue; |
| 108 | 106 |
| 109 base::ListValue* devices = new base::ListValue; | 107 base::ListValue* devices = new base::ListValue; |
| 110 devices->Append(GPUDeviceToDictionary(gpu_info.gpu)); | 108 devices->Append(GPUDeviceToDictionary(gpu_info.gpu)); |
| 111 for (size_t ii = 0; ii < gpu_info.secondary_gpus.size(); ++ii) { | 109 for (size_t ii = 0; ii < gpu_info.secondary_gpus.size(); ++ii) { |
| 112 devices->Append(GPUDeviceToDictionary(gpu_info.secondary_gpus[ii])); | 110 devices->Append(GPUDeviceToDictionary(gpu_info.secondary_gpus[ii])); |
| 113 } | 111 } |
| 114 gpu_dict->Set(kDevices, devices); | 112 gpu_dict->Set(kDevices, devices); |
| 115 | 113 |
| 116 base::DictionaryValue* aux_attributes = new base::DictionaryValue; | 114 base::DictionaryValue* aux_attributes = new base::DictionaryValue; |
| 117 AuxGPUInfoEnumerator enumerator(aux_attributes); | 115 AuxGPUInfoEnumerator enumerator(aux_attributes); |
| 118 gpu_info.EnumerateFields(&enumerator); | 116 gpu_info.EnumerateFields(&enumerator); |
| 119 gpu_dict->Set(kAuxAttributes, aux_attributes); | 117 gpu_dict->Set(kAuxAttributes, aux_attributes); |
| 120 | 118 |
| 121 gpu_dict->Set(kFeatureStatus, GetFeatureStatus()); | 119 gpu_dict->Set(kFeatureStatus, GetFeatureStatus()); |
| 122 | 120 |
| 123 gpu_dict->Set(kDriverBugWorkarounds, GetDriverBugWorkarounds()); | 121 gpu_dict->Set(kDriverBugWorkarounds, GetDriverBugWorkarounds()); |
| 124 | 122 |
| 125 base::DictionaryValue* system_dict = new base::DictionaryValue; | 123 base::DictionaryValue* system_dict = new base::DictionaryValue; |
| 126 system_dict->SetString(kModelName, gpu_info.machine_model_name); | 124 system_dict->SetString(kModelName, gpu_info.machine_model_name); |
| 127 system_dict->SetString(kModelVersion, gpu_info.machine_model_version); | 125 system_dict->SetString(kModelVersion, gpu_info.machine_model_version); |
| 128 system_dict->Set(kGPU, gpu_dict); | 126 system_dict->Set(kGPU, gpu_dict); |
| 129 | |
| 130 VLOG(2) << "DevToolsSystemInfoHandler::OnGetInfo() : END"; | |
| 131 return command->SuccessResponse(system_dict); | 127 return command->SuccessResponse(system_dict); |
| 132 } | 128 } |
| 133 | 129 |
| 134 } // namespace content | 130 } // namespace content |
| OLD | NEW |