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

Unified Diff: chrome/browser/memory_details.cc

Issue 12662019: Split the ProcessType enum into process types that content knows about (which will remain in src\co… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 9 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
Index: chrome/browser/memory_details.cc
===================================================================
--- chrome/browser/memory_details.cc (revision 189692)
+++ chrome/browser/memory_details.cc (working copy)
@@ -15,6 +15,7 @@
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/view_type_utils.h"
+#include "chrome/common/chrome_process_type.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/url_constants.h"
#include "content/public/browser/browser_child_process_host_iterator.h"
@@ -26,7 +27,6 @@
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/bindings_policy.h"
-#include "content/public/common/process_type.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h"
@@ -71,18 +71,18 @@
// static
std::string ProcessMemoryInformation::GetFullTypeNameInEnglish(
- content::ProcessType type,
+ int process_type,
RendererProcessType rtype) {
- if (type == content::PROCESS_TYPE_RENDERER)
+ if (process_type == content::PROCESS_TYPE_RENDERER)
return GetRendererTypeNameInEnglish(rtype);
- return content::GetProcessTypeNameInEnglish(type);
+ return content::GetProcessTypeNameInEnglish(process_type);
}
ProcessMemoryInformation::ProcessMemoryInformation()
: pid(0),
num_processes(0),
is_diagnostics(false),
- type(content::PROCESS_TYPE_UNKNOWN),
+ process_type(content::PROCESS_TYPE_UNKNOWN),
renderer_type(RENDERER_UNKNOWN) {
}
@@ -149,7 +149,7 @@
iter1 != processes.rend();
++iter1) {
log += ProcessMemoryInformation::GetFullTypeNameInEnglish(
- iter1->type, iter1->renderer_type);
+ iter1->process_type, iter1->renderer_type);
if (!iter1->titles.empty()) {
log += " [";
for (std::vector<string16>::const_iterator iter2 =
@@ -183,7 +183,7 @@
if (!info.pid)
continue;
- info.type = iter.GetData().type;
+ info.process_type = iter.GetData().process_type;
info.renderer_type = ProcessMemoryInformation::RENDERER_UNKNOWN;
info.titles.push_back(iter.GetData().name);
child_info.push_back(info);
@@ -225,7 +225,7 @@
process.pid != base::GetProcId(render_process_host->GetHandle())) {
continue;
}
- process.type = content::PROCESS_TYPE_RENDERER;
+ process.process_type = content::PROCESS_TYPE_RENDERER;
Profile* profile =
Profile::FromBrowserContext(
render_process_host->GetBrowserContext());
@@ -343,9 +343,9 @@
#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID)
if (process.pid == zygote_pid) {
- process.type = content::PROCESS_TYPE_ZYGOTE;
+ process.process_type = content::PROCESS_TYPE_ZYGOTE;
} else if (process.pid == sandbox_helper_pid) {
- process.type = content::PROCESS_TYPE_SANDBOX_HELPER;
+ process.process_type = content::PROCESS_TYPE_SANDBOX_HELPER;
}
#endif
}
@@ -353,7 +353,7 @@
// Get rid of other Chrome processes that are from a different profile.
for (size_t index = 0; index < chrome_browser->processes.size();
index++) {
- if (chrome_browser->processes[index].type ==
+ if (chrome_browser->processes[index].process_type ==
content::PROCESS_TYPE_UNKNOWN) {
chrome_browser->processes.erase(
chrome_browser->processes.begin() + index);
@@ -384,7 +384,7 @@
for (size_t index = 0; index < browser.processes.size(); index++) {
int sample = static_cast<int>(browser.processes[index].working_set.priv);
aggregate_memory += sample;
- switch (browser.processes[index].type) {
+ switch (browser.processes[index].process_type) {
case content::PROCESS_TYPE_BROWSER:
UMA_HISTOGRAM_MEMORY_KB("Memory.Browser", sample);
break;
@@ -432,14 +432,6 @@
UMA_HISTOGRAM_MEMORY_KB("Memory.SandboxHelper", sample);
other_count++;
break;
- case content::PROCESS_TYPE_NACL_LOADER:
- UMA_HISTOGRAM_MEMORY_KB("Memory.NativeClient", sample);
- other_count++;
- break;
- case content::PROCESS_TYPE_NACL_BROKER:
- UMA_HISTOGRAM_MEMORY_KB("Memory.NativeClientBroker", sample);
- other_count++;
- break;
case content::PROCESS_TYPE_GPU:
UMA_HISTOGRAM_MEMORY_KB("Memory.Gpu", sample);
other_count++;
@@ -452,6 +444,14 @@
UMA_HISTOGRAM_MEMORY_KB("Memory.PepperPluginBroker", sample);
pepper_plugin_broker_count++;
break;
+ case PROCESS_TYPE_NACL_LOADER:
+ UMA_HISTOGRAM_MEMORY_KB("Memory.NativeClient", sample);
+ other_count++;
+ break;
+ case PROCESS_TYPE_NACL_BROKER:
+ UMA_HISTOGRAM_MEMORY_KB("Memory.NativeClientBroker", sample);
+ other_count++;
+ break;
default:
NOTREACHED();
break;

Powered by Google App Engine
This is Rietveld 408576698