| 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 16 matching lines...) Expand all Loading... |
| 27 const char kModelVersion[] = "modelVersion"; | 27 const char kModelVersion[] = "modelVersion"; |
| 28 const char kVendorId[] = "vendorId"; | 28 const char kVendorId[] = "vendorId"; |
| 29 const char kVendorString[] = "vendorString"; | 29 const char kVendorString[] = "vendorString"; |
| 30 | 30 |
| 31 class AuxGPUInfoEnumerator : public gpu::GPUInfo::Enumerator { | 31 class AuxGPUInfoEnumerator : public gpu::GPUInfo::Enumerator { |
| 32 public: | 32 public: |
| 33 AuxGPUInfoEnumerator(base::DictionaryValue* dictionary) | 33 AuxGPUInfoEnumerator(base::DictionaryValue* dictionary) |
| 34 : dictionary_(dictionary), | 34 : dictionary_(dictionary), |
| 35 in_aux_attributes_(false) { } | 35 in_aux_attributes_(false) { } |
| 36 | 36 |
| 37 virtual void AddInt64(const char* name, int64 value) OVERRIDE { | 37 virtual void AddInt64(const char* name, int64 value) override { |
| 38 if (in_aux_attributes_) | 38 if (in_aux_attributes_) |
| 39 dictionary_->SetDouble(name, value); | 39 dictionary_->SetDouble(name, value); |
| 40 } | 40 } |
| 41 | 41 |
| 42 virtual void AddInt(const char* name, int value) OVERRIDE { | 42 virtual void AddInt(const char* name, int value) override { |
| 43 if (in_aux_attributes_) | 43 if (in_aux_attributes_) |
| 44 dictionary_->SetInteger(name, value); | 44 dictionary_->SetInteger(name, value); |
| 45 } | 45 } |
| 46 | 46 |
| 47 virtual void AddString(const char* name, const std::string& value) OVERRIDE { | 47 virtual void AddString(const char* name, const std::string& value) override { |
| 48 if (in_aux_attributes_) | 48 if (in_aux_attributes_) |
| 49 dictionary_->SetString(name, value); | 49 dictionary_->SetString(name, value); |
| 50 } | 50 } |
| 51 | 51 |
| 52 virtual void AddBool(const char* name, bool value) OVERRIDE { | 52 virtual void AddBool(const char* name, bool value) override { |
| 53 if (in_aux_attributes_) | 53 if (in_aux_attributes_) |
| 54 dictionary_->SetBoolean(name, value); | 54 dictionary_->SetBoolean(name, value); |
| 55 } | 55 } |
| 56 | 56 |
| 57 virtual void AddTimeDeltaInSecondsF(const char* name, | 57 virtual void AddTimeDeltaInSecondsF(const char* name, |
| 58 const base::TimeDelta& value) OVERRIDE { | 58 const base::TimeDelta& value) override { |
| 59 if (in_aux_attributes_) | 59 if (in_aux_attributes_) |
| 60 dictionary_->SetDouble(name, value.InSecondsF()); | 60 dictionary_->SetDouble(name, value.InSecondsF()); |
| 61 } | 61 } |
| 62 | 62 |
| 63 virtual void BeginGPUDevice() OVERRIDE { | 63 virtual void BeginGPUDevice() override { |
| 64 } | 64 } |
| 65 | 65 |
| 66 virtual void EndGPUDevice() OVERRIDE { | 66 virtual void EndGPUDevice() override { |
| 67 } | 67 } |
| 68 | 68 |
| 69 virtual void BeginVideoEncodeAcceleratorSupportedProfile() OVERRIDE {} | 69 virtual void BeginVideoEncodeAcceleratorSupportedProfile() override {} |
| 70 | 70 |
| 71 virtual void EndVideoEncodeAcceleratorSupportedProfile() OVERRIDE {} | 71 virtual void EndVideoEncodeAcceleratorSupportedProfile() override {} |
| 72 | 72 |
| 73 virtual void BeginAuxAttributes() OVERRIDE { | 73 virtual void BeginAuxAttributes() override { |
| 74 in_aux_attributes_ = true; | 74 in_aux_attributes_ = true; |
| 75 } | 75 } |
| 76 | 76 |
| 77 virtual void EndAuxAttributes() OVERRIDE { | 77 virtual void EndAuxAttributes() override { |
| 78 in_aux_attributes_ = false; | 78 in_aux_attributes_ = false; |
| 79 } | 79 } |
| 80 | 80 |
| 81 private: | 81 private: |
| 82 base::DictionaryValue* dictionary_; | 82 base::DictionaryValue* dictionary_; |
| 83 bool in_aux_attributes_; | 83 bool in_aux_attributes_; |
| 84 }; | 84 }; |
| 85 | 85 |
| 86 base::DictionaryValue* GPUDeviceToDictionary( | 86 base::DictionaryValue* GPUDeviceToDictionary( |
| 87 const gpu::GPUInfo::GPUDevice& device) { | 87 const gpu::GPUInfo::GPUDevice& device) { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 gpu_dict->Set(kDriverBugWorkarounds, GetDriverBugWorkarounds()); | 127 gpu_dict->Set(kDriverBugWorkarounds, GetDriverBugWorkarounds()); |
| 128 | 128 |
| 129 base::DictionaryValue* system_dict = new base::DictionaryValue; | 129 base::DictionaryValue* system_dict = new base::DictionaryValue; |
| 130 system_dict->SetString(kModelName, gpu_info.machine_model_name); | 130 system_dict->SetString(kModelName, gpu_info.machine_model_name); |
| 131 system_dict->SetString(kModelVersion, gpu_info.machine_model_version); | 131 system_dict->SetString(kModelVersion, gpu_info.machine_model_version); |
| 132 system_dict->Set(kGPU, gpu_dict); | 132 system_dict->Set(kGPU, gpu_dict); |
| 133 return command->SuccessResponse(system_dict); | 133 return command->SuccessResponse(system_dict); |
| 134 } | 134 } |
| 135 | 135 |
| 136 } // namespace content | 136 } // namespace content |
| OLD | NEW |