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

Unified Diff: chrome/browser/browser_about_handler.cc

Issue 7983042: CrOS: Add Discard Tab command link to about:discards (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: revert tab_strip_model.h Created 9 years, 3 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/oom_priority_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browser_about_handler.cc
diff --git a/chrome/browser/browser_about_handler.cc b/chrome/browser/browser_about_handler.cc
index 9c5e5acdf7f1ce242ae66683b4053c6e5f38cd55..98a72aaa5f660b045b0a13c88e57694bb00f8b73 100644
--- a/chrome/browser/browser_about_handler.cc
+++ b/chrome/browser/browser_about_handler.cc
@@ -676,8 +676,13 @@ std::string AboutCryptohome(const std::string& query) {
return GetCryptohomeHtmlInfo(refresh);
}
-std::string AboutDiscards() {
+std::string AboutDiscards(const std::string& path) {
std::string output;
+ const std::string kRunCommand("run");
+ if (path == kRunCommand) {
+ output.append(WrapWithTag("p", "Discarding a tab..."));
+ g_browser_process->oom_priority_manager()->DiscardTab();
+ }
AppendHeader(&output, 0, "About discards");
AppendBody(&output);
output.append("<h3>About discards</h3>");
@@ -698,28 +703,30 @@ std::string AboutDiscards() {
} else {
output.append("<p>None found. Wait 10 seconds, then refresh.</p>");
}
+ output.append(
+ "<a href='chrome://discards/" + kRunCommand + "'>Discard tab now</a>");
base::SystemMemoryInfoKB meminfo;
base::GetSystemMemoryInfo(&meminfo);
output.append("<h3>System memory information in MB</h3>");
output.append("<table>");
output.append(AddStringRow(
- "Total Memory", base::IntToString(meminfo.total / 1024)));
+ "Total", base::IntToString(meminfo.total / 1024)));
output.append(AddStringRow(
- "Free Memory", base::IntToString(meminfo.free / 1024)));
+ "Free", base::IntToString(meminfo.free / 1024)));
output.append(AddStringRow(
- "Buffered Memory", base::IntToString(meminfo.buffers / 1024)));
+ "Buffered", base::IntToString(meminfo.buffers / 1024)));
output.append(AddStringRow(
- "Cached Memory", base::IntToString(meminfo.cached / 1024)));
+ "Cached", base::IntToString(meminfo.cached / 1024)));
output.append(AddStringRow(
- "Committed Memory", base::IntToString(
+ "Committed", base::IntToString(
(meminfo.total - meminfo.free - meminfo.buffers - meminfo.cached) / 1024)));
output.append(AddStringRow(
- "Active Anon Memory", base::IntToString(meminfo.active_anon / 1024)));
+ "Active Anon", base::IntToString(meminfo.active_anon / 1024)));
output.append(AddStringRow(
- "Inactive Anon Memory", base::IntToString(meminfo.inactive_anon / 1024)));
+ "Inactive Anon", base::IntToString(meminfo.inactive_anon / 1024)));
output.append(AddStringRow(
- "Shared Memory", base::IntToString(meminfo.shmem / 1024)));
+ "Shared", base::IntToString(meminfo.shmem / 1024)));
output.append("</table>");
AppendFooter(&output);
@@ -1406,7 +1413,7 @@ void AboutSource::StartDataRequest(const std::string& path,
} else if (host == chrome::kChromeUICryptohomeHost) {
response = AboutCryptohome(path);
} else if (host == chrome::kChromeUIDiscardsHost) {
- response = AboutDiscards();
+ response = AboutDiscards(path);
#endif
} else if (host == chrome::kChromeUIDNSHost) {
AboutDnsHandler::Start(this, request_id);
« no previous file with comments | « no previous file | chrome/browser/oom_priority_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698