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 "chrome/browser/ui/webui/about_ui.h" | 5 #include "chrome/browser/ui/webui/about_ui.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 12 matching lines...) Expand all Loading... |
23 #include "base/macros.h" | 23 #include "base/macros.h" |
24 #include "base/memory/singleton.h" | 24 #include "base/memory/singleton.h" |
25 #include "base/metrics/statistics_recorder.h" | 25 #include "base/metrics/statistics_recorder.h" |
26 #include "base/process/process_metrics.h" | 26 #include "base/process/process_metrics.h" |
27 #include "base/strings/string_number_conversions.h" | 27 #include "base/strings/string_number_conversions.h" |
28 #include "base/strings/string_piece.h" | 28 #include "base/strings/string_piece.h" |
29 #include "base/strings/string_split.h" | 29 #include "base/strings/string_split.h" |
30 #include "base/strings/string_util.h" | 30 #include "base/strings/string_util.h" |
31 #include "base/strings/stringprintf.h" | 31 #include "base/strings/stringprintf.h" |
32 #include "base/strings/utf_string_conversions.h" | 32 #include "base/strings/utf_string_conversions.h" |
33 #include "base/sys_info.h" | |
34 #include "base/task_scheduler/post_task.h" | 33 #include "base/task_scheduler/post_task.h" |
35 #include "base/threading/thread.h" | 34 #include "base/threading/thread.h" |
36 #include "base/values.h" | 35 #include "base/values.h" |
37 #include "build/build_config.h" | 36 #include "build/build_config.h" |
38 #include "chrome/browser/about_flags.h" | 37 #include "chrome/browser/about_flags.h" |
39 #include "chrome/browser/browser_process.h" | 38 #include "chrome/browser/browser_process.h" |
40 #include "chrome/browser/defaults.h" | 39 #include "chrome/browser/defaults.h" |
41 #include "chrome/browser/memory/tab_manager.h" | 40 #include "chrome/browser/memory/tab_manager.h" |
42 #include "chrome/browser/memory/tab_stats.h" | 41 #include "chrome/browser/memory/tab_stats.h" |
43 #include "chrome/browser/net/predictor.h" | 42 #include "chrome/browser/net/predictor.h" |
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
546 kAboutDiscardsRunCommand)); | 545 kAboutDiscardsRunCommand)); |
547 | 546 |
548 base::SystemMemoryInfoKB meminfo; | 547 base::SystemMemoryInfoKB meminfo; |
549 base::GetSystemMemoryInfo(&meminfo); | 548 base::GetSystemMemoryInfo(&meminfo); |
550 output.append("<h3>System memory information in MB</h3>"); | 549 output.append("<h3>System memory information in MB</h3>"); |
551 output.append("<table>"); | 550 output.append("<table>"); |
552 // Start with summary statistics. | 551 // Start with summary statistics. |
553 output.append(AddStringRow( | 552 output.append(AddStringRow( |
554 "Total", base::IntToString(meminfo.total / 1024))); | 553 "Total", base::IntToString(meminfo.total / 1024))); |
555 output.append(AddStringRow( | 554 output.append(AddStringRow( |
556 "Free", | 555 "Free", base::IntToString(meminfo.free / 1024))); |
557 base::IntToString(base::SysInfo::AmountOfAvailablePhysicalMemory() / | |
558 1024 / 1024))); | |
559 #if defined(OS_CHROMEOS) | 556 #if defined(OS_CHROMEOS) |
560 int mem_allocated_kb = meminfo.active_anon + meminfo.inactive_anon; | 557 int mem_allocated_kb = meminfo.active_anon + meminfo.inactive_anon; |
561 #if defined(ARCH_CPU_ARM_FAMILY) | 558 #if defined(ARCH_CPU_ARM_FAMILY) |
562 // ARM counts allocated graphics memory separately from anonymous. | 559 // ARM counts allocated graphics memory separately from anonymous. |
563 if (meminfo.gem_size != -1) | 560 if (meminfo.gem_size != -1) |
564 mem_allocated_kb += meminfo.gem_size / 1024; | 561 mem_allocated_kb += meminfo.gem_size / 1024; |
565 #endif | 562 #endif |
566 output.append(AddStringRow( | 563 output.append(AddStringRow( |
567 "Allocated", base::IntToString(mem_allocated_kb / 1024))); | 564 "Allocated", base::IntToString(mem_allocated_kb / 1024))); |
568 // Add some space, then detailed numbers. | 565 // Add some space, then detailed numbers. |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
866 Profile* profile = Profile::FromWebUI(web_ui); | 863 Profile* profile = Profile::FromWebUI(web_ui); |
867 | 864 |
868 #if !defined(OS_ANDROID) | 865 #if !defined(OS_ANDROID) |
869 // Set up the chrome://theme/ source. | 866 // Set up the chrome://theme/ source. |
870 ThemeSource* theme = new ThemeSource(profile); | 867 ThemeSource* theme = new ThemeSource(profile); |
871 content::URLDataSource::Add(profile, theme); | 868 content::URLDataSource::Add(profile, theme); |
872 #endif | 869 #endif |
873 | 870 |
874 content::URLDataSource::Add(profile, new AboutUIHTMLSource(name, profile)); | 871 content::URLDataSource::Add(profile, new AboutUIHTMLSource(name, profile)); |
875 } | 872 } |
OLD | NEW |