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

Unified Diff: chrome/browser/task_manager/task_manager_resource_providers.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/task_manager/task_manager_resource_providers.cc
===================================================================
--- chrome/browser/task_manager/task_manager_resource_providers.cc (revision 189692)
+++ chrome/browser/task_manager/task_manager_resource_providers.cc (working copy)
@@ -44,6 +44,7 @@
#include "chrome/browser/ui/panels/panel_manager.h"
#include "chrome/browser/ui/tab_contents/tab_contents_iterator.h"
#include "chrome/browser/view_type_utils.h"
+#include "chrome/common/chrome_process_type.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/extensions/extension.h"
@@ -1046,11 +1047,11 @@
gfx::ImageSkia* TaskManagerChildProcessResource::default_icon_ = NULL;
TaskManagerChildProcessResource::TaskManagerChildProcessResource(
- content::ProcessType type,
+ int process_type,
const string16& name,
base::ProcessHandle handle,
int unique_process_id)
- : type_(type),
+ : process_type_(process_type),
name_(name),
handle_(handle),
unique_process_id_(unique_process_id),
@@ -1095,24 +1096,24 @@
TaskManager::Resource::Type TaskManagerChildProcessResource::GetType() const {
// Translate types to TaskManager::ResourceType, since ChildProcessData's type
// is not available for all TaskManager resources.
- switch (type_) {
+ switch (process_type_) {
case content::PROCESS_TYPE_PLUGIN:
case content::PROCESS_TYPE_PPAPI_PLUGIN:
case content::PROCESS_TYPE_PPAPI_BROKER:
return TaskManager::Resource::PLUGIN;
- case content::PROCESS_TYPE_NACL_LOADER:
- case content::PROCESS_TYPE_NACL_BROKER:
- return TaskManager::Resource::NACL;
case content::PROCESS_TYPE_UTILITY:
return TaskManager::Resource::UTILITY;
- case content::PROCESS_TYPE_PROFILE_IMPORT:
- return TaskManager::Resource::PROFILE_IMPORT;
case content::PROCESS_TYPE_ZYGOTE:
return TaskManager::Resource::ZYGOTE;
case content::PROCESS_TYPE_SANDBOX_HELPER:
return TaskManager::Resource::SANDBOX_HELPER;
case content::PROCESS_TYPE_GPU:
return TaskManager::Resource::GPU;
+ case PROCESS_TYPE_PROFILE_IMPORT:
+ return TaskManager::Resource::PROFILE_IMPORT;
+ case PROCESS_TYPE_NACL_LOADER:
+ case PROCESS_TYPE_NACL_BROKER:
+ return TaskManager::Resource::NACL;
default:
return TaskManager::Resource::UNKNOWN;
}
@@ -1129,7 +1130,7 @@
string16 TaskManagerChildProcessResource::GetLocalizedTitle() const {
string16 title = name_;
if (title.empty()) {
- switch (type_) {
+ switch (process_type_) {
case content::PROCESS_TYPE_PLUGIN:
case content::PROCESS_TYPE_PPAPI_PLUGIN:
case content::PROCESS_TYPE_PPAPI_BROKER:
@@ -1147,30 +1148,23 @@
// or Arabic word for "plugin".
base::i18n::AdjustStringForLocaleDirection(&title);
- switch (type_) {
+ switch (process_type_) {
case content::PROCESS_TYPE_UTILITY:
return l10n_util::GetStringUTF16(IDS_TASK_MANAGER_UTILITY_PREFIX);
-
- case content::PROCESS_TYPE_PROFILE_IMPORT:
- return l10n_util::GetStringUTF16(IDS_TASK_MANAGER_UTILITY_PREFIX);
-
case content::PROCESS_TYPE_GPU:
return l10n_util::GetStringUTF16(IDS_TASK_MANAGER_GPU_PREFIX);
-
- case content::PROCESS_TYPE_NACL_BROKER:
- return l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NACL_BROKER_PREFIX);
-
case content::PROCESS_TYPE_PLUGIN:
case content::PROCESS_TYPE_PPAPI_PLUGIN:
return l10n_util::GetStringFUTF16(IDS_TASK_MANAGER_PLUGIN_PREFIX, title);
-
case content::PROCESS_TYPE_PPAPI_BROKER:
return l10n_util::GetStringFUTF16(IDS_TASK_MANAGER_PLUGIN_BROKER_PREFIX,
title);
-
- case content::PROCESS_TYPE_NACL_LOADER:
+ case PROCESS_TYPE_PROFILE_IMPORT:
+ return l10n_util::GetStringUTF16(IDS_TASK_MANAGER_UTILITY_PREFIX);
+ case PROCESS_TYPE_NACL_BROKER:
+ return l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NACL_BROKER_PREFIX);
+ case PROCESS_TYPE_NACL_LOADER:
return l10n_util::GetStringFUTF16(IDS_TASK_MANAGER_NACL_PREFIX, title);
-
// These types don't need display names or get them from elsewhere.
case content::PROCESS_TYPE_BROWSER:
case content::PROCESS_TYPE_RENDERER:
@@ -1183,7 +1177,6 @@
case content::PROCESS_TYPE_WORKER:
NOTREACHED() << "Workers are not handled by this provider.";
break;
-
case content::PROCESS_TYPE_UNKNOWN:
NOTREACHED() << "Need localized name for child process type.";
}
@@ -1248,7 +1241,7 @@
DCHECK(updating_);
// Workers are handled by TaskManagerWorkerResourceProvider.
- if (data.type == content::PROCESS_TYPE_WORKER)
+ if (data.process_type == content::PROCESS_TYPE_WORKER)
return;
if (resources_.count(data.handle)) {
// The case may happen that we have added a child_process_info as part of
@@ -1264,7 +1257,7 @@
BrowserChildProcessHostDisconnected(const content::ChildProcessData& data) {
DCHECK(updating_);
- if (data.type == content::PROCESS_TYPE_WORKER)
+ if (data.process_type == content::PROCESS_TYPE_WORKER)
return;
ChildProcessMap::iterator iter = resources_.find(data.handle);
if (iter == resources_.end()) {
@@ -1293,7 +1286,7 @@
const content::ChildProcessData& child_process_data) {
TaskManagerChildProcessResource* resource =
new TaskManagerChildProcessResource(
- child_process_data.type,
+ child_process_data.process_type,
child_process_data.name,
child_process_data.handle,
child_process_data.id);
@@ -1309,7 +1302,7 @@
// Only add processes which are already started, since we need their handle.
if (iter.GetData().handle == base::kNullProcessHandle)
continue;
- if (iter.GetData().type == content::PROCESS_TYPE_WORKER)
+ if (iter.GetData().process_type == content::PROCESS_TYPE_WORKER)
continue;
child_processes.push_back(iter.GetData());
}

Powered by Google App Engine
This is Rietveld 408576698