Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(221)

Side by Side Diff: content/browser/gpu/gpu_internals_ui.cc

Issue 2476493003: Remove FundamentalValue
Patch Set: Fix Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/gpu/gpu_internals_ui.h" 5 #include "content/browser/gpu/gpu_internals_ui.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 vendor.c_str(), device.c_str(), gpu.active ? " *ACTIVE*" : ""); 119 vendor.c_str(), device.c_str(), gpu.active ? " *ACTIVE*" : "");
120 } 120 }
121 121
122 base::DictionaryValue* GpuInfoAsDictionaryValue() { 122 base::DictionaryValue* GpuInfoAsDictionaryValue() {
123 gpu::GPUInfo gpu_info = GpuDataManagerImpl::GetInstance()->GetGPUInfo(); 123 gpu::GPUInfo gpu_info = GpuDataManagerImpl::GetInstance()->GetGPUInfo();
124 base::ListValue* basic_info = new base::ListValue(); 124 base::ListValue* basic_info = new base::ListValue();
125 basic_info->Append(NewDescriptionValuePair( 125 basic_info->Append(NewDescriptionValuePair(
126 "Initialization time", 126 "Initialization time",
127 base::Int64ToString(gpu_info.initialization_time.InMilliseconds()))); 127 base::Int64ToString(gpu_info.initialization_time.InMilliseconds())));
128 basic_info->Append(NewDescriptionValuePair( 128 basic_info->Append(NewDescriptionValuePair(
129 "In-process GPU", new base::FundamentalValue(gpu_info.in_process_gpu))); 129 "In-process GPU", new base::Value(gpu_info.in_process_gpu)));
130 basic_info->Append(NewDescriptionValuePair( 130 basic_info->Append(NewDescriptionValuePair(
131 "Sandboxed", new base::FundamentalValue(gpu_info.sandboxed))); 131 "Sandboxed", new base::Value(gpu_info.sandboxed)));
132 basic_info->Append(NewDescriptionValuePair( 132 basic_info->Append(NewDescriptionValuePair(
133 "GPU0", GPUDeviceToString(gpu_info.gpu))); 133 "GPU0", GPUDeviceToString(gpu_info.gpu)));
134 for (size_t i = 0; i < gpu_info.secondary_gpus.size(); ++i) { 134 for (size_t i = 0; i < gpu_info.secondary_gpus.size(); ++i) {
135 basic_info->Append(NewDescriptionValuePair( 135 basic_info->Append(NewDescriptionValuePair(
136 base::StringPrintf("GPU%d", static_cast<int>(i + 1)), 136 base::StringPrintf("GPU%d", static_cast<int>(i + 1)),
137 GPUDeviceToString(gpu_info.secondary_gpus[i]))); 137 GPUDeviceToString(gpu_info.secondary_gpus[i])));
138 } 138 }
139 basic_info->Append(NewDescriptionValuePair( 139 basic_info->Append(NewDescriptionValuePair(
140 "Optimus", new base::FundamentalValue(gpu_info.optimus))); 140 "Optimus", new base::Value(gpu_info.optimus)));
141 basic_info->Append(NewDescriptionValuePair( 141 basic_info->Append(NewDescriptionValuePair(
142 "AMD switchable", new base::FundamentalValue(gpu_info.amd_switchable))); 142 "AMD switchable", new base::Value(gpu_info.amd_switchable)));
143 if (gpu_info.lenovo_dcute) { 143 if (gpu_info.lenovo_dcute) {
144 basic_info->Append(NewDescriptionValuePair( 144 basic_info->Append(NewDescriptionValuePair(
145 "Lenovo dCute", new base::FundamentalValue(true))); 145 "Lenovo dCute", new base::Value(true)));
146 } 146 }
147 if (gpu_info.display_link_version.IsValid()) { 147 if (gpu_info.display_link_version.IsValid()) {
148 basic_info->Append(NewDescriptionValuePair( 148 basic_info->Append(NewDescriptionValuePair(
149 "DisplayLink Version", gpu_info.display_link_version.GetString())); 149 "DisplayLink Version", gpu_info.display_link_version.GetString()));
150 } 150 }
151 #if defined(OS_WIN) 151 #if defined(OS_WIN)
152 std::string compositor = 152 std::string compositor =
153 ui::win::IsAeroGlassEnabled() ? "Aero Glass" : "none"; 153 ui::win::IsAeroGlassEnabled() ? "Aero Glass" : "none";
154 basic_info->Append( 154 basic_info->Append(
155 NewDescriptionValuePair("Desktop compositing", compositor)); 155 NewDescriptionValuePair("Desktop compositing", compositor));
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 basic_info->Append( 234 basic_info->Append(
235 NewDescriptionValuePair("Direct rendering", direct_rendering)); 235 NewDescriptionValuePair("Direct rendering", direct_rendering));
236 236
237 std::string reset_strategy = 237 std::string reset_strategy =
238 base::StringPrintf("0x%04x", gpu_info.gl_reset_notification_strategy); 238 base::StringPrintf("0x%04x", gpu_info.gl_reset_notification_strategy);
239 basic_info->Append(NewDescriptionValuePair( 239 basic_info->Append(NewDescriptionValuePair(
240 "Reset notification strategy", reset_strategy)); 240 "Reset notification strategy", reset_strategy));
241 241
242 basic_info->Append(NewDescriptionValuePair( 242 basic_info->Append(NewDescriptionValuePair(
243 "GPU process crash count", 243 "GPU process crash count",
244 new base::FundamentalValue(gpu_info.process_crash_count))); 244 new base::Value(gpu_info.process_crash_count)));
245 245
246 base::DictionaryValue* info = new base::DictionaryValue(); 246 base::DictionaryValue* info = new base::DictionaryValue();
247 info->Set("basic_info", basic_info); 247 info->Set("basic_info", basic_info);
248 248
249 #if defined(OS_WIN) 249 #if defined(OS_WIN)
250 std::unique_ptr<base::Value> dx_info = base::Value::CreateNullValue(); 250 std::unique_ptr<base::Value> dx_info = base::Value::CreateNullValue();
251 if (gpu_info.dx_diagnostics.children.size()) 251 if (gpu_info.dx_diagnostics.children.size())
252 dx_info.reset(DxDiagNodeToList(gpu_info.dx_diagnostics)); 252 dx_info.reset(DxDiagNodeToList(gpu_info.dx_diagnostics));
253 info->Set("diagnostics", std::move(dx_info)); 253 info->Set("diagnostics", std::move(dx_info));
254 #endif 254 #endif
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
556 : WebUIController(web_ui) { 556 : WebUIController(web_ui) {
557 web_ui->AddMessageHandler(new GpuMessageHandler()); 557 web_ui->AddMessageHandler(new GpuMessageHandler());
558 558
559 // Set up the chrome://gpu/ source. 559 // Set up the chrome://gpu/ source.
560 BrowserContext* browser_context = 560 BrowserContext* browser_context =
561 web_ui->GetWebContents()->GetBrowserContext(); 561 web_ui->GetWebContents()->GetBrowserContext();
562 WebUIDataSource::Add(browser_context, CreateGpuHTMLSource()); 562 WebUIDataSource::Add(browser_context, CreateGpuHTMLSource());
563 } 563 }
564 564
565 } // namespace content 565 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/devtools/protocol_string.cc ('k') | content/browser/indexed_db/indexed_db_internals_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698