| 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 <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| 11 #include <utility> | 11 #include <utility> |
| 12 | 12 |
| 13 #include "base/bind.h" | 13 #include "base/bind.h" |
| 14 #include "base/bind_helpers.h" | 14 #include "base/bind_helpers.h" |
| 15 #include "base/command_line.h" | 15 #include "base/command_line.h" |
| 16 #include "base/environment.h" | 16 #include "base/environment.h" |
| 17 #include "base/i18n/time_formatting.h" | 17 #include "base/i18n/time_formatting.h" |
| 18 #include "base/macros.h" | 18 #include "base/macros.h" |
| 19 #include "base/strings/string_number_conversions.h" | 19 #include "base/strings/string_number_conversions.h" |
| 20 #include "base/strings/stringize_macros.h" |
| 20 #include "base/strings/stringprintf.h" | 21 #include "base/strings/stringprintf.h" |
| 21 #include "base/sys_info.h" | 22 #include "base/sys_info.h" |
| 22 #include "base/values.h" | 23 #include "base/values.h" |
| 23 #include "build/build_config.h" | 24 #include "build/build_config.h" |
| 24 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h" | 25 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h" |
| 25 #include "content/browser/gpu/compositor_util.h" | 26 #include "content/browser/gpu/compositor_util.h" |
| 26 #include "content/browser/gpu/gpu_data_manager_impl.h" | 27 #include "content/browser/gpu/gpu_data_manager_impl.h" |
| 27 #include "content/grit/content_resources.h" | 28 #include "content/grit/content_resources.h" |
| 28 #include "content/public/browser/browser_thread.h" | 29 #include "content/public/browser/browser_thread.h" |
| 29 #include "content/public/browser/gpu_data_manager_observer.h" | 30 #include "content/public/browser/gpu_data_manager_observer.h" |
| 30 #include "content/public/browser/web_contents.h" | 31 #include "content/public/browser/web_contents.h" |
| 31 #include "content/public/browser/web_ui.h" | 32 #include "content/public/browser/web_ui.h" |
| 32 #include "content/public/browser/web_ui_data_source.h" | 33 #include "content/public/browser/web_ui_data_source.h" |
| 33 #include "content/public/browser/web_ui_message_handler.h" | 34 #include "content/public/browser/web_ui_message_handler.h" |
| 34 #include "content/public/common/content_client.h" | 35 #include "content/public/common/content_client.h" |
| 35 #include "content/public/common/content_switches.h" | 36 #include "content/public/common/content_switches.h" |
| 36 #include "content/public/common/url_constants.h" | 37 #include "content/public/common/url_constants.h" |
| 37 #include "gpu/config/gpu_feature_type.h" | 38 #include "gpu/config/gpu_feature_type.h" |
| 38 #include "gpu/config/gpu_info.h" | 39 #include "gpu/config/gpu_info.h" |
| 40 #include "skia/ext/skia_commit_hash.h" |
| 39 #include "third_party/angle/src/common/version.h" | 41 #include "third_party/angle/src/common/version.h" |
| 42 #include "third_party/skia/include/core/SkMilestone.h" |
| 40 #include "ui/gl/gpu_switching_manager.h" | 43 #include "ui/gl/gpu_switching_manager.h" |
| 41 | 44 |
| 42 #if defined(OS_LINUX) && defined(USE_X11) | 45 #if defined(OS_LINUX) && defined(USE_X11) |
| 43 #include <X11/Xlib.h> | 46 #include <X11/Xlib.h> |
| 44 #endif | 47 #endif |
| 45 #if defined(OS_WIN) | 48 #if defined(OS_WIN) |
| 46 #include "ui/base/win/shell.h" | 49 #include "ui/base/win/shell.h" |
| 47 #include "ui/gfx/win/physical_size.h" | 50 #include "ui/gfx/win/physical_size.h" |
| 48 #endif | 51 #endif |
| 49 | 52 |
| (...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 479 | 482 |
| 480 base::DictionaryValue* dict = new base::DictionaryValue(); | 483 base::DictionaryValue* dict = new base::DictionaryValue(); |
| 481 | 484 |
| 482 dict->SetString("version", GetContentClient()->GetProduct()); | 485 dict->SetString("version", GetContentClient()->GetProduct()); |
| 483 dict->SetString("command_line", | 486 dict->SetString("command_line", |
| 484 base::CommandLine::ForCurrentProcess()->GetCommandLineString()); | 487 base::CommandLine::ForCurrentProcess()->GetCommandLineString()); |
| 485 dict->SetString("operating_system", | 488 dict->SetString("operating_system", |
| 486 base::SysInfo::OperatingSystemName() + " " + | 489 base::SysInfo::OperatingSystemName() + " " + |
| 487 base::SysInfo::OperatingSystemVersion()); | 490 base::SysInfo::OperatingSystemVersion()); |
| 488 dict->SetString("angle_commit_id", ANGLE_COMMIT_HASH); | 491 dict->SetString("angle_commit_id", ANGLE_COMMIT_HASH); |
| 489 dict->SetString("graphics_backend", "Skia"); | 492 dict->SetString("graphics_backend", |
| 493 std::string("Skia/" STRINGIZE(SK_MILESTONE) " ") |
| 494 + skia::CommitHash()); |
| 490 dict->SetString("blacklist_version", | 495 dict->SetString("blacklist_version", |
| 491 GpuDataManagerImpl::GetInstance()->GetBlacklistVersion()); | 496 GpuDataManagerImpl::GetInstance()->GetBlacklistVersion()); |
| 492 dict->SetString("driver_bug_list_version", | 497 dict->SetString("driver_bug_list_version", |
| 493 GpuDataManagerImpl::GetInstance()->GetDriverBugListVersion()); | 498 GpuDataManagerImpl::GetInstance()->GetDriverBugListVersion()); |
| 494 | 499 |
| 495 return dict; | 500 return dict; |
| 496 } | 501 } |
| 497 | 502 |
| 498 base::Value* GpuMessageHandler::OnRequestLogMessages(const base::ListValue*) { | 503 base::Value* GpuMessageHandler::OnRequestLogMessages(const base::ListValue*) { |
| 499 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 504 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 540 : WebUIController(web_ui) { | 545 : WebUIController(web_ui) { |
| 541 web_ui->AddMessageHandler(new GpuMessageHandler()); | 546 web_ui->AddMessageHandler(new GpuMessageHandler()); |
| 542 | 547 |
| 543 // Set up the chrome://gpu/ source. | 548 // Set up the chrome://gpu/ source. |
| 544 BrowserContext* browser_context = | 549 BrowserContext* browser_context = |
| 545 web_ui->GetWebContents()->GetBrowserContext(); | 550 web_ui->GetWebContents()->GetBrowserContext(); |
| 546 WebUIDataSource::Add(browser_context, CreateGpuHTMLSource()); | 551 WebUIDataSource::Add(browser_context, CreateGpuHTMLSource()); |
| 547 } | 552 } |
| 548 | 553 |
| 549 } // namespace content | 554 } // namespace content |
| OLD | NEW |