OLD | NEW |
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 #if defined(OS_LINUX) && defined(USE_X11) | 7 #if defined(OS_LINUX) && defined(USE_X11) |
8 #include <X11/Xlib.h> | 8 #include <X11/Xlib.h> |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 vendor.c_str(), device.c_str(), gpu.active ? " *ACTIVE*" : ""); | 106 vendor.c_str(), device.c_str(), gpu.active ? " *ACTIVE*" : ""); |
107 } | 107 } |
108 | 108 |
109 base::DictionaryValue* GpuInfoAsDictionaryValue() { | 109 base::DictionaryValue* GpuInfoAsDictionaryValue() { |
110 gpu::GPUInfo gpu_info = GpuDataManagerImpl::GetInstance()->GetGPUInfo(); | 110 gpu::GPUInfo gpu_info = GpuDataManagerImpl::GetInstance()->GetGPUInfo(); |
111 base::ListValue* basic_info = new base::ListValue(); | 111 base::ListValue* basic_info = new base::ListValue(); |
112 basic_info->Append(NewDescriptionValuePair( | 112 basic_info->Append(NewDescriptionValuePair( |
113 "Initialization time", | 113 "Initialization time", |
114 base::Int64ToString(gpu_info.initialization_time.InMilliseconds()))); | 114 base::Int64ToString(gpu_info.initialization_time.InMilliseconds()))); |
115 basic_info->Append(NewDescriptionValuePair( | 115 basic_info->Append(NewDescriptionValuePair( |
116 "In-process GPU", new base::FundamentalValue(gpu_info.in_process_gpu))); | |
117 basic_info->Append(NewDescriptionValuePair( | |
118 "Sandboxed", new base::FundamentalValue(gpu_info.sandboxed))); | 116 "Sandboxed", new base::FundamentalValue(gpu_info.sandboxed))); |
119 basic_info->Append(NewDescriptionValuePair( | 117 basic_info->Append(NewDescriptionValuePair( |
120 "GPU0", GPUDeviceToString(gpu_info.gpu))); | 118 "GPU0", GPUDeviceToString(gpu_info.gpu))); |
121 for (size_t i = 0; i < gpu_info.secondary_gpus.size(); ++i) { | 119 for (size_t i = 0; i < gpu_info.secondary_gpus.size(); ++i) { |
122 basic_info->Append(NewDescriptionValuePair( | 120 basic_info->Append(NewDescriptionValuePair( |
123 base::StringPrintf("GPU%d", static_cast<int>(i + 1)), | 121 base::StringPrintf("GPU%d", static_cast<int>(i + 1)), |
124 GPUDeviceToString(gpu_info.secondary_gpus[i]))); | 122 GPUDeviceToString(gpu_info.secondary_gpus[i]))); |
125 } | 123 } |
126 basic_info->Append(NewDescriptionValuePair( | 124 basic_info->Append(NewDescriptionValuePair( |
127 "Optimus", new base::FundamentalValue(gpu_info.optimus))); | 125 "Optimus", new base::FundamentalValue(gpu_info.optimus))); |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
428 : WebUIController(web_ui) { | 426 : WebUIController(web_ui) { |
429 web_ui->AddMessageHandler(new GpuMessageHandler()); | 427 web_ui->AddMessageHandler(new GpuMessageHandler()); |
430 | 428 |
431 // Set up the chrome://gpu/ source. | 429 // Set up the chrome://gpu/ source. |
432 BrowserContext* browser_context = | 430 BrowserContext* browser_context = |
433 web_ui->GetWebContents()->GetBrowserContext(); | 431 web_ui->GetWebContents()->GetBrowserContext(); |
434 WebUIDataSource::Add(browser_context, CreateGpuHTMLSource()); | 432 WebUIDataSource::Add(browser_context, CreateGpuHTMLSource()); |
435 } | 433 } |
436 | 434 |
437 } // namespace content | 435 } // namespace content |
OLD | NEW |