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 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
| 10 #include <utility> |
10 | 11 |
11 #include "base/bind.h" | 12 #include "base/bind.h" |
12 #include "base/bind_helpers.h" | 13 #include "base/bind_helpers.h" |
13 #include "base/command_line.h" | 14 #include "base/command_line.h" |
14 #include "base/environment.h" | 15 #include "base/environment.h" |
15 #include "base/i18n/time_formatting.h" | 16 #include "base/i18n/time_formatting.h" |
16 #include "base/macros.h" | 17 #include "base/macros.h" |
17 #include "base/strings/string_number_conversions.h" | 18 #include "base/strings/string_number_conversions.h" |
18 #include "base/strings/stringprintf.h" | 19 #include "base/strings/stringprintf.h" |
19 #include "base/sys_info.h" | 20 #include "base/sys_info.h" |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 "GPU process crash count", | 236 "GPU process crash count", |
236 new base::FundamentalValue(gpu_info.process_crash_count))); | 237 new base::FundamentalValue(gpu_info.process_crash_count))); |
237 | 238 |
238 base::DictionaryValue* info = new base::DictionaryValue(); | 239 base::DictionaryValue* info = new base::DictionaryValue(); |
239 info->Set("basic_info", basic_info); | 240 info->Set("basic_info", basic_info); |
240 | 241 |
241 #if defined(OS_WIN) | 242 #if defined(OS_WIN) |
242 scoped_ptr<base::Value> dx_info = base::Value::CreateNullValue(); | 243 scoped_ptr<base::Value> dx_info = base::Value::CreateNullValue(); |
243 if (gpu_info.dx_diagnostics.children.size()) | 244 if (gpu_info.dx_diagnostics.children.size()) |
244 dx_info.reset(DxDiagNodeToList(gpu_info.dx_diagnostics)); | 245 dx_info.reset(DxDiagNodeToList(gpu_info.dx_diagnostics)); |
245 info->Set("diagnostics", dx_info.Pass()); | 246 info->Set("diagnostics", std::move(dx_info)); |
246 #endif | 247 #endif |
247 | 248 |
248 return info; | 249 return info; |
249 } | 250 } |
250 | 251 |
251 const char* BufferFormatToString(gfx::BufferFormat format) { | 252 const char* BufferFormatToString(gfx::BufferFormat format) { |
252 switch (format) { | 253 switch (format) { |
253 case gfx::BufferFormat::ATC: | 254 case gfx::BufferFormat::ATC: |
254 return "ATC"; | 255 return "ATC"; |
255 case gfx::BufferFormat::ATCIA: | 256 case gfx::BufferFormat::ATCIA: |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
537 : WebUIController(web_ui) { | 538 : WebUIController(web_ui) { |
538 web_ui->AddMessageHandler(new GpuMessageHandler()); | 539 web_ui->AddMessageHandler(new GpuMessageHandler()); |
539 | 540 |
540 // Set up the chrome://gpu/ source. | 541 // Set up the chrome://gpu/ source. |
541 BrowserContext* browser_context = | 542 BrowserContext* browser_context = |
542 web_ui->GetWebContents()->GetBrowserContext(); | 543 web_ui->GetWebContents()->GetBrowserContext(); |
543 WebUIDataSource::Add(browser_context, CreateGpuHTMLSource()); | 544 WebUIDataSource::Add(browser_context, CreateGpuHTMLSource()); |
544 } | 545 } |
545 | 546 |
546 } // namespace content | 547 } // namespace content |
OLD | NEW |