summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-01 00:39:12 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-01 00:39:12 +0000
commitbd5d6cfd0e09e2123b948083bdaa39b2637b5143 (patch)
tree33cf977ea21078b69d7600ec4a12412fa23dc342
parent8d85a4b93067def07388e577b5c9e95de27f06b6 (diff)
downloadchromium_src-bd5d6cfd0e09e2123b948083bdaa39b2637b5143.zip
chromium_src-bd5d6cfd0e09e2123b948083bdaa39b2637b5143.tar.gz
chromium_src-bd5d6cfd0e09e2123b948083bdaa39b2637b5143.tar.bz2
Move the ProcessType enum out to its own file. This is in preparation for getting rid of ChildProcessInfo.
BUG=98716 Review URL: http://codereview.chromium.org/8760011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@112353 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/automation/automation_provider_observers.cc3
-rw-r--r--chrome/browser/chromeos/gview_request_interceptor_unittest.cc2
-rw-r--r--chrome/browser/debugger/devtools_sanity_unittest.cc5
-rw-r--r--chrome/browser/extensions/network_delay_listener_unittest.cc2
-rw-r--r--chrome/browser/extensions/user_script_listener_unittest.cc2
-rw-r--r--chrome/browser/memory_details.cc37
-rw-r--r--chrome/browser/memory_details.h6
-rw-r--r--chrome/browser/memory_details_linux.cc5
-rw-r--r--chrome/browser/memory_details_mac.cc7
-rw-r--r--chrome/browser/memory_details_win.cc5
-rw-r--r--chrome/browser/metrics/metrics_service.cc12
-rw-r--r--chrome/browser/metrics/metrics_service.h4
-rw-r--r--chrome/browser/metrics/metrics_service_unittest.cc6
-rw-r--r--chrome/browser/metrics/tracking_synchronizer.cc7
-rw-r--r--chrome/browser/metrics/tracking_synchronizer.h6
-rw-r--r--chrome/browser/nacl_host/nacl_broker_host_win.cc2
-rw-r--r--chrome/browser/nacl_host/nacl_broker_service_win.cc2
-rw-r--r--chrome/browser/nacl_host/nacl_process_host.cc2
-rw-r--r--chrome/browser/renderer_host/chrome_render_message_filter.cc4
-rw-r--r--chrome/browser/task_manager/task_manager_resource_providers.cc61
-rw-r--r--chrome/browser/task_manager/task_manager_worker_resource_provider.cc5
-rw-r--r--chrome/browser/ui/webui/about_ui.cc3
-rw-r--r--chrome/browser/ui/webui/workers_ui.cc5
-rw-r--r--chrome/test/automation/proxy_launcher.cc4
-rw-r--r--content/browser/browser_child_process_host.cc24
-rw-r--r--content/browser/browser_child_process_host.h7
-rw-r--r--content/browser/debugger/worker_devtools_manager.cc3
-rw-r--r--content/browser/gpu/gpu_process_host.cc2
-rw-r--r--content/browser/plugin_process_host.cc6
-rw-r--r--content/browser/plugin_service.cc10
-rw-r--r--content/browser/ppapi_plugin_process_host.cc5
-rw-r--r--content/browser/renderer_host/render_process_host_impl.cc3
-rw-r--r--content/browser/renderer_host/render_widget_host_view_win.cc3
-rw-r--r--content/browser/renderer_host/resource_dispatcher_host.cc15
-rw-r--r--content/browser/renderer_host/resource_dispatcher_host_request_info.cc2
-rw-r--r--content/browser/renderer_host/resource_dispatcher_host_request_info.h8
-rw-r--r--content/browser/renderer_host/resource_dispatcher_host_unittest.cc2
-rw-r--r--content/browser/renderer_host/resource_message_filter.cc2
-rw-r--r--content/browser/renderer_host/resource_message_filter.h8
-rw-r--r--content/browser/renderer_host/resource_queue_unittest.cc2
-rw-r--r--content/browser/utility_process_host.cc2
-rw-r--r--content/browser/worker_host/worker_process_host.cc4
-rw-r--r--content/browser/worker_host/worker_service.cc21
-rw-r--r--content/common/child_process_info.cc32
-rw-r--r--content/common/child_process_info.h32
-rw-r--r--content/common/debug_flags.cc14
-rw-r--r--content/common/debug_flags.h4
-rw-r--r--content/common/sandbox_policy.cc44
-rw-r--r--content/content_common.gypi1
-rw-r--r--content/public/common/process_type.h35
50 files changed, 264 insertions, 224 deletions
diff --git a/chrome/browser/automation/automation_provider_observers.cc b/chrome/browser/automation/automation_provider_observers.cc
index 8dde537..5f15c10 100644
--- a/chrome/browser/automation/automation_provider_observers.cc
+++ b/chrome/browser/automation/automation_provider_observers.cc
@@ -78,6 +78,7 @@
#include "content/common/child_process_info.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/render_process_host.h"
+#include "content/public/common/process_type.h"
#include "googleurl/src/gurl.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/gfx/codec/png_codec.h"
@@ -2866,7 +2867,7 @@ void ProcessInfoObserver::OnDetailsAvailable() {
std::string process_type = "Unknown";
// The following condition avoids a DCHECK in debug builds when the
// process type passed to |GetTypeNameInEnglish| is unknown.
- if (iterator->type != ChildProcessInfo::UNKNOWN_PROCESS)
+ if (iterator->type != content::PROCESS_TYPE_UNKNOWN)
process_type = ChildProcessInfo::GetTypeNameInEnglish(iterator->type);
proc_data->SetString("child_process_type", process_type);
diff --git a/chrome/browser/chromeos/gview_request_interceptor_unittest.cc b/chrome/browser/chromeos/gview_request_interceptor_unittest.cc
index 29726a6..c9184b5 100644
--- a/chrome/browser/chromeos/gview_request_interceptor_unittest.cc
+++ b/chrome/browser/chromeos/gview_request_interceptor_unittest.cc
@@ -165,7 +165,7 @@ class GViewRequestInterceptorTest : public testing::Test {
ResourceDispatcherHostRequestInfo* info =
new ResourceDispatcherHostRequestInfo(
handler_,
- ChildProcessInfo::RENDER_PROCESS,
+ content::PROCESS_TYPE_RENDERER,
-1, // child_id
MSG_ROUTING_NONE,
0, // origin_pid
diff --git a/chrome/browser/debugger/devtools_sanity_unittest.cc b/chrome/browser/debugger/devtools_sanity_unittest.cc
index ad7f2e4..9d8ceb6 100644
--- a/chrome/browser/debugger/devtools_sanity_unittest.cc
+++ b/chrome/browser/debugger/devtools_sanity_unittest.cc
@@ -331,8 +331,7 @@ class WorkerDevToolsSanityTest : public InProcessBrowserTest {
static void TerminateWorkerOnIOThread(
scoped_refptr<WorkerData> worker_data) {
- for (BrowserChildProcessHost::Iterator iter(
- ChildProcessInfo::WORKER_PROCESS);
+ for (BrowserChildProcessHost::Iterator iter(content::PROCESS_TYPE_WORKER);
!iter.Done(); ++iter) {
if (iter->id() == worker_data->worker_process_id) {
WorkerProcessHost* host = static_cast<WorkerProcessHost*>(*iter);
@@ -354,7 +353,7 @@ class WorkerDevToolsSanityTest : public InProcessBrowserTest {
static void WaitForFirstSharedWorkerOnIOThread(
scoped_refptr<WorkerData> worker_data) {
- BrowserChildProcessHost::Iterator iter(ChildProcessInfo::WORKER_PROCESS);
+ BrowserChildProcessHost::Iterator iter(content::PROCESS_TYPE_WORKER);
for (; !iter.Done(); ++iter) {
WorkerProcessHost* worker = static_cast<WorkerProcessHost*>(*iter);
const WorkerProcessHost::Instances& instances = worker->instances();
diff --git a/chrome/browser/extensions/network_delay_listener_unittest.cc b/chrome/browser/extensions/network_delay_listener_unittest.cc
index b65ad0f..74d0bc9 100644
--- a/chrome/browser/extensions/network_delay_listener_unittest.cc
+++ b/chrome/browser/extensions/network_delay_listener_unittest.cc
@@ -37,7 +37,7 @@ const char kTestExtensionNoNetworkDelay[] = "aocebcndggcnnmflapdklcmnfojmkmie";
ResourceDispatcherHostRequestInfo* CreateRequestInfo(int request_id) {
return new ResourceDispatcherHostRequestInfo(
- new DummyResourceHandler(), ChildProcessInfo::RENDER_PROCESS, 0, 0, 0,
+ new DummyResourceHandler(), content::PROCESS_TYPE_RENDERER, 0, 0, 0,
request_id, false, -1, false, -1, ResourceType::MAIN_FRAME,
content::PAGE_TRANSITION_LINK, 0, false, false, false,
content::MockResourceContext::GetInstance());
diff --git a/chrome/browser/extensions/user_script_listener_unittest.cc b/chrome/browser/extensions/user_script_listener_unittest.cc
index b7ea9e4..073448d 100644
--- a/chrome/browser/extensions/user_script_listener_unittest.cc
+++ b/chrome/browser/extensions/user_script_listener_unittest.cc
@@ -37,7 +37,7 @@ const char kTestData[] = "Hello, World!";
ResourceDispatcherHostRequestInfo* CreateRequestInfo(int request_id) {
return new ResourceDispatcherHostRequestInfo(
- new DummyResourceHandler(), ChildProcessInfo::RENDER_PROCESS, 0, 0, 0,
+ new DummyResourceHandler(), content::PROCESS_TYPE_RENDERER, 0, 0, 0,
request_id, false, -1, false, -1, ResourceType::MAIN_FRAME,
content::PAGE_TRANSITION_LINK, 0, false, false, false,
content::MockResourceContext::GetInstance());
diff --git a/chrome/browser/memory_details.cc b/chrome/browser/memory_details.cc
index 1cd7a27..62671c2 100644
--- a/chrome/browser/memory_details.cc
+++ b/chrome/browser/memory_details.cc
@@ -21,6 +21,7 @@
#include "content/browser/renderer_host/render_view_host.h"
#include "content/browser/tab_contents/navigation_entry.h"
#include "content/browser/tab_contents/tab_contents.h"
+#include "content/common/child_process_info.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/common/bindings_policy.h"
@@ -62,9 +63,9 @@ std::string ProcessMemoryInformation::GetRendererTypeNameInEnglish(
// static
std::string ProcessMemoryInformation::GetFullTypeNameInEnglish(
- ChildProcessInfo::ProcessType type,
+ content::ProcessType type,
RendererProcessType rtype) {
- if (type == ChildProcessInfo::RENDER_PROCESS)
+ if (type == content::PROCESS_TYPE_RENDERER)
return GetRendererTypeNameInEnglish(rtype);
return ChildProcessInfo::GetTypeNameInEnglish(type);
}
@@ -73,7 +74,7 @@ ProcessMemoryInformation::ProcessMemoryInformation()
: pid(0),
num_processes(0),
is_diagnostics(false),
- type(ChildProcessInfo::UNKNOWN_PROCESS),
+ type(content::PROCESS_TYPE_UNKNOWN),
renderer_type(RENDERER_UNKNOWN) {
}
@@ -175,7 +176,7 @@ void MemoryDetails::CollectChildInfoOnUIThread() {
process.pid != base::GetProcId(render_process_host->GetHandle())) {
continue;
}
- process.type = ChildProcessInfo::RENDER_PROCESS;
+ process.type = content::PROCESS_TYPE_RENDERER;
Profile* profile =
Profile::FromBrowserContext(
render_process_host->GetBrowserContext());
@@ -299,9 +300,9 @@ void MemoryDetails::CollectChildInfoOnUIThread() {
#if defined(OS_POSIX) && !defined(OS_MACOSX)
if (process.pid == zygote_pid) {
- process.type = ChildProcessInfo::ZYGOTE_PROCESS;
+ process.type = content::PROCESS_TYPE_ZYGOTE;
} else if (process.pid == sandbox_helper_pid) {
- process.type = ChildProcessInfo::SANDBOX_HELPER_PROCESS;
+ process.type = content::PROCESS_TYPE_SANDBOX_HELPER;
}
#endif
}
@@ -310,7 +311,7 @@ void MemoryDetails::CollectChildInfoOnUIThread() {
for (size_t index = 0; index < chrome_browser->processes.size();
index++) {
if (chrome_browser->processes[index].type ==
- ChildProcessInfo::UNKNOWN_PROCESS) {
+ content::PROCESS_TYPE_UNKNOWN) {
chrome_browser->processes.erase(
chrome_browser->processes.begin() + index);
index--;
@@ -339,10 +340,10 @@ void MemoryDetails::UpdateHistograms() {
int sample = static_cast<int>(browser.processes[index].working_set.priv);
aggregate_memory += sample;
switch (browser.processes[index].type) {
- case ChildProcessInfo::BROWSER_PROCESS:
+ case content::PROCESS_TYPE_BROWSER:
UMA_HISTOGRAM_MEMORY_KB("Memory.Browser", sample);
break;
- case ChildProcessInfo::RENDER_PROCESS: {
+ case content::PROCESS_TYPE_RENDERER: {
ProcessMemoryInformation::RendererProcessType renderer_type =
browser.processes[index].renderer_type;
switch (renderer_type) {
@@ -366,39 +367,39 @@ void MemoryDetails::UpdateHistograms() {
}
break;
}
- case ChildProcessInfo::PLUGIN_PROCESS:
+ case content::PROCESS_TYPE_PLUGIN:
UMA_HISTOGRAM_MEMORY_KB("Memory.Plugin", sample);
plugin_count++;
break;
- case ChildProcessInfo::WORKER_PROCESS:
+ case content::PROCESS_TYPE_WORKER:
UMA_HISTOGRAM_MEMORY_KB("Memory.Worker", sample);
worker_count++;
break;
- case ChildProcessInfo::UTILITY_PROCESS:
+ case content::PROCESS_TYPE_UTILITY:
UMA_HISTOGRAM_MEMORY_KB("Memory.Utility", sample);
other_count++;
break;
- case ChildProcessInfo::ZYGOTE_PROCESS:
+ case content::PROCESS_TYPE_ZYGOTE:
UMA_HISTOGRAM_MEMORY_KB("Memory.Zygote", sample);
other_count++;
break;
- case ChildProcessInfo::SANDBOX_HELPER_PROCESS:
+ case content::PROCESS_TYPE_SANDBOX_HELPER:
UMA_HISTOGRAM_MEMORY_KB("Memory.SandboxHelper", sample);
other_count++;
break;
- case ChildProcessInfo::NACL_LOADER_PROCESS:
+ case content::PROCESS_TYPE_NACL_LOADER:
UMA_HISTOGRAM_MEMORY_KB("Memory.NativeClient", sample);
other_count++;
break;
- case ChildProcessInfo::NACL_BROKER_PROCESS:
+ case content::PROCESS_TYPE_NACL_BROKER:
UMA_HISTOGRAM_MEMORY_KB("Memory.NativeClientBroker", sample);
other_count++;
break;
- case ChildProcessInfo::GPU_PROCESS:
+ case content::PROCESS_TYPE_GPU:
UMA_HISTOGRAM_MEMORY_KB("Memory.Gpu", sample);
other_count++;
break;
- case ChildProcessInfo::PPAPI_PLUGIN_PROCESS:
+ case content::PROCESS_TYPE_PPAPI_PLUGIN:
UMA_HISTOGRAM_MEMORY_KB("Memory.PepperPlugin", sample);
pepper_plugin_count++;
break;
diff --git a/chrome/browser/memory_details.h b/chrome/browser/memory_details.h
index da62580..568f591 100644
--- a/chrome/browser/memory_details.h
+++ b/chrome/browser/memory_details.h
@@ -11,7 +11,7 @@
#include "base/memory/ref_counted.h"
#include "base/process_util.h"
#include "base/string16.h"
-#include "content/common/child_process_info.h"
+#include "content/public/common/process_type.h"
// We collect data about each browser process. A browser may
// have multiple processes (of course!). Even IE has multiple
@@ -32,7 +32,7 @@ struct ProcessMemoryInformation {
static std::string GetRendererTypeNameInEnglish(RendererProcessType type);
static std::string GetFullTypeNameInEnglish(
- ChildProcessInfo::ProcessType type,
+ content::ProcessType type,
RendererProcessType rtype);
ProcessMemoryInformation();
@@ -55,7 +55,7 @@ struct ProcessMemoryInformation {
// results.
bool is_diagnostics;
// If this is a child process of Chrome, what type (i.e. plugin) it is.
- ChildProcessInfo::ProcessType type;
+ content::ProcessType type;
// If this is a renderer process, what type it is.
RendererProcessType renderer_type;
// A collection of titles used, i.e. for a tab it'll show all the page titles.
diff --git a/chrome/browser/memory_details_linux.cc b/chrome/browser/memory_details_linux.cc
index afa1994..d4baa68 100644
--- a/chrome/browser/memory_details_linux.cc
+++ b/chrome/browser/memory_details_linux.cc
@@ -21,6 +21,7 @@
#include "content/browser/browser_child_process_host.h"
#include "content/browser/zygote_host_linux.h"
#include "content/public/browser/browser_thread.h"
+#include "content/public/common/process_type.h"
#include "grit/chromium_strings.h"
using content::BrowserThread;
@@ -158,9 +159,9 @@ static void GetProcessDataMemoryInformation(
pmi.num_processes = 1;
if (pmi.pid == base::GetCurrentProcId())
- pmi.type = ChildProcessInfo::BROWSER_PROCESS;
+ pmi.type = content::PROCESS_TYPE_BROWSER;
else
- pmi.type = ChildProcessInfo::UNKNOWN_PROCESS;
+ pmi.type = content::PROCESS_TYPE_UNKNOWN;
base::ProcessMetrics* metrics =
base::ProcessMetrics::CreateProcessMetrics(*i);
diff --git a/chrome/browser/memory_details_mac.cc b/chrome/browser/memory_details_mac.cc
index 0b1fb12..04919bd 100644
--- a/chrome/browser/memory_details_mac.cc
+++ b/chrome/browser/memory_details_mac.cc
@@ -24,6 +24,7 @@
#include "content/browser/renderer_host/backing_store_manager.h"
#include "content/browser/tab_contents/navigation_entry.h"
#include "content/public/browser/browser_thread.h"
+#include "content/public/common/process_type.h"
#include "grit/chromium_strings.h"
#include "ui/base/l10n/l10n_util.h"
@@ -150,7 +151,7 @@ void MemoryDetails::CollectProcessData(
it != pids_by_browser[index].end(); ++it) {
ProcessMemoryInformation info;
info.pid = *it;
- info.type = ChildProcessInfo::UNKNOWN_PROCESS;
+ info.type = content::PROCESS_TYPE_UNKNOWN;
// Try to get version information. To do this, we need first to get the
// executable's name (we can only believe |proc_info.command| if it looks
@@ -211,9 +212,9 @@ void MemoryDetails::CollectProcessDataChrome(
ProcessMemoryInformation info;
info.pid = pid;
if (info.pid == base::GetCurrentProcId())
- info.type = ChildProcessInfo::BROWSER_PROCESS;
+ info.type = content::PROCESS_TYPE_BROWSER;
else
- info.type = ChildProcessInfo::UNKNOWN_PROCESS;
+ info.type = content::PROCESS_TYPE_UNKNOWN;
chrome::VersionInfo version_info;
if (version_info.is_valid()) {
diff --git a/chrome/browser/memory_details_win.cc b/chrome/browser/memory_details_win.cc
index b4e1656..a3aa02b 100644
--- a/chrome/browser/memory_details_win.cc
+++ b/chrome/browser/memory_details_win.cc
@@ -19,6 +19,7 @@
#include "content/browser/renderer_host/backing_store_manager.h"
#include "content/browser/tab_contents/navigation_entry.h"
#include "content/public/browser/browser_thread.h"
+#include "content/public/common/process_type.h"
#include "grit/chromium_strings.h"
#include "ui/base/l10n/l10n_util.h"
@@ -109,9 +110,9 @@ void MemoryDetails::CollectProcessData(
ProcessMemoryInformation info;
info.pid = pid;
if (info.pid == GetCurrentProcessId())
- info.type = ChildProcessInfo::BROWSER_PROCESS;
+ info.type = content::PROCESS_TYPE_BROWSER;
else
- info.type = ChildProcessInfo::UNKNOWN_PROCESS;
+ info.type = content::PROCESS_TYPE_UNKNOWN;
scoped_ptr<base::ProcessMetrics> metrics;
metrics.reset(base::ProcessMetrics::CreateProcessMetrics(process_handle));
diff --git a/chrome/browser/metrics/metrics_service.cc b/chrome/browser/metrics/metrics_service.cc
index 4191d5c..51afe17 100644
--- a/chrome/browser/metrics/metrics_service.cc
+++ b/chrome/browser/metrics/metrics_service.cc
@@ -232,7 +232,7 @@ MetricsService::ShutdownCleanliness MetricsService::clean_shutdown_status_ =
// reported to the UMA server on next launch.
struct MetricsService::ChildProcessStats {
public:
- explicit ChildProcessStats(ChildProcessInfo::ProcessType type)
+ explicit ChildProcessStats(content::ProcessType type)
: process_launches(0),
process_crashes(0),
instances(0),
@@ -244,7 +244,7 @@ struct MetricsService::ChildProcessStats {
: process_launches(0),
process_crashes(0),
instances(0),
- process_type(ChildProcessInfo::UNKNOWN_PROCESS) {}
+ process_type(content::PROCESS_TYPE_UNKNOWN) {}
// The number of times that the given child process has been launched
int process_launches;
@@ -257,7 +257,7 @@ struct MetricsService::ChildProcessStats {
// load.
int instances;
- ChildProcessInfo::ProcessType process_type;
+ content::ProcessType process_type;
};
// Handles asynchronous fetching of memory details.
@@ -1526,9 +1526,9 @@ void MetricsService::RecordCurrentState(PrefService* pref) {
}
// static
-bool MetricsService::IsPluginProcess(ChildProcessInfo::ProcessType type) {
- return (type == ChildProcessInfo::PLUGIN_PROCESS ||
- type == ChildProcessInfo::PPAPI_PLUGIN_PROCESS);
+bool MetricsService::IsPluginProcess(content::ProcessType type) {
+ return (type == content::PROCESS_TYPE_PLUGIN||
+ type == content::PROCESS_TYPE_PPAPI_PLUGIN);
}
static bool IsSingleThreaded() {
diff --git a/chrome/browser/metrics/metrics_service.h b/chrome/browser/metrics/metrics_service.h
index b2199ee..5fa6292 100644
--- a/chrome/browser/metrics/metrics_service.h
+++ b/chrome/browser/metrics/metrics_service.h
@@ -21,7 +21,7 @@
#include "base/process_util.h"
#include "chrome/browser/io_thread.h"
#include "chrome/common/metrics_helpers.h"
-#include "content/common/child_process_info.h"
+#include "content/public/common/process_type.h"
#include "content/public/common/url_fetcher_delegate.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
@@ -311,7 +311,7 @@ class MetricsService : public content::NotificationObserver,
// Returns true if process of type |type| should be counted as a plugin
// process, and false otherwise.
- static bool IsPluginProcess(ChildProcessInfo::ProcessType type);
+ static bool IsPluginProcess(content::ProcessType type);
content::NotificationRegistrar registrar_;
diff --git a/chrome/browser/metrics/metrics_service_unittest.cc b/chrome/browser/metrics/metrics_service_unittest.cc
index bb97bc3..3c063d5 100644
--- a/chrome/browser/metrics/metrics_service_unittest.cc
+++ b/chrome/browser/metrics/metrics_service_unittest.cc
@@ -30,9 +30,9 @@ TEST(MetricsServiceTest, ClientIdCorrectlyFormatted) {
TEST(MetricsServiceTest, IsPluginProcess) {
EXPECT_TRUE(
- MetricsService::IsPluginProcess(ChildProcessInfo::PLUGIN_PROCESS));
+ MetricsService::IsPluginProcess(content::PROCESS_TYPE_PLUGIN));
EXPECT_TRUE(
- MetricsService::IsPluginProcess(ChildProcessInfo::PPAPI_PLUGIN_PROCESS));
+ MetricsService::IsPluginProcess(content::PROCESS_TYPE_PPAPI_PLUGIN));
EXPECT_FALSE(
- MetricsService::IsPluginProcess(ChildProcessInfo::GPU_PROCESS));
+ MetricsService::IsPluginProcess(content::PROCESS_TYPE_GPU));
}
diff --git a/chrome/browser/metrics/tracking_synchronizer.cc b/chrome/browser/metrics/tracking_synchronizer.cc
index a12ad92..4607824 100644
--- a/chrome/browser/metrics/tracking_synchronizer.cc
+++ b/chrome/browser/metrics/tracking_synchronizer.cc
@@ -14,6 +14,7 @@
#include "chrome/browser/ui/webui/tracing_ui.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/render_messages.h"
+#include "content/common/child_process_info.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_process_host.h"
@@ -128,7 +129,7 @@ void TrackingSynchronizer::SetTrackingStatusInProcess(int process_id) {
void TrackingSynchronizer::DeserializeTrackingList(
int sequence_number,
const std::string& tracking_data,
- ChildProcessInfo::ProcessType process_type) {
+ content::ProcessType process_type) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
@@ -141,7 +142,7 @@ void TrackingSynchronizer::DeserializeTrackingList(
void TrackingSynchronizer::DeserializeTrackingListOnUI(
int sequence_number,
const std::string& tracking_data,
- ChildProcessInfo::ProcessType process_type) {
+ content::ProcessType process_type) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
TrackingSynchronizer* current_synchronizer = CurrentSynchronizer();
@@ -194,7 +195,7 @@ int TrackingSynchronizer::RegisterAndNotifyAllProcesses(
// Get the ThreadData for the browser process and send it back.
base::DictionaryValue* value = tracked_objects::ThreadData::ToValue();
const std::string process_type =
- ChildProcessInfo::GetTypeNameInEnglish(ChildProcessInfo::BROWSER_PROCESS);
+ ChildProcessInfo::GetTypeNameInEnglish(content::PROCESS_TYPE_BROWSER);
value->SetString("process_type", process_type);
value->SetInteger("process_id", base::GetCurrentProcId());
DCHECK_GT(request->processes_pending_, 0);
diff --git a/chrome/browser/metrics/tracking_synchronizer.h b/chrome/browser/metrics/tracking_synchronizer.h
index fda547f..2647512 100644
--- a/chrome/browser/metrics/tracking_synchronizer.h
+++ b/chrome/browser/metrics/tracking_synchronizer.h
@@ -16,8 +16,8 @@
#include "base/time.h"
#include "base/values.h"
#include "chrome/browser/ui/webui/profiler_ui.h"
-#include "content/common/child_process_info.h"
#include "content/public/browser/browser_thread.h"
+#include "content/public/common/process_type.h"
// This class maintains state that is used to upload tracking data from the
// various processes, into the browser process. Such transactions are usually
@@ -110,14 +110,14 @@ class TrackingSynchronizer : public
static void DeserializeTrackingList(
int sequence_number,
const std::string& tracking_data,
- ChildProcessInfo::ProcessType process_type);
+ content::ProcessType process_type);
// Deserialize the tracking data and record that we have received tracking
// data from a process. This method is accessible on UI thread.
static void DeserializeTrackingListOnUI(
int sequence_number,
const std::string& tracking_data,
- ChildProcessInfo::ProcessType process_type);
+ content::ProcessType process_type);
private:
friend class base::RefCountedThreadSafe<TrackingSynchronizer>;
diff --git a/chrome/browser/nacl_host/nacl_broker_host_win.cc b/chrome/browser/nacl_host/nacl_broker_host_win.cc
index dc1bb7f..8bd6077 100644
--- a/chrome/browser/nacl_host/nacl_broker_host_win.cc
+++ b/chrome/browser/nacl_host/nacl_broker_host_win.cc
@@ -16,7 +16,7 @@
#include "chrome/common/nacl_messages.h"
NaClBrokerHost::NaClBrokerHost()
- : BrowserChildProcessHost(NACL_BROKER_PROCESS),
+ : BrowserChildProcessHost(content::PROCESS_TYPE_NACL_BROKER),
stopping_(false) {
}
diff --git a/chrome/browser/nacl_host/nacl_broker_service_win.cc b/chrome/browser/nacl_host/nacl_broker_service_win.cc
index 5923f42..7e93e3e 100644
--- a/chrome/browser/nacl_host/nacl_broker_service_win.cc
+++ b/chrome/browser/nacl_host/nacl_broker_service_win.cc
@@ -62,7 +62,7 @@ void NaClBrokerService::OnLoaderDied() {
}
NaClBrokerHost* NaClBrokerService::GetBrokerHost() {
- BrowserChildProcessHost::Iterator iter(ChildProcessInfo::NACL_BROKER_PROCESS);
+ BrowserChildProcessHost::Iterator iter(content::PROCESS_TYPE_NACL_BROKER);
if (iter.Done())
return NULL;
NaClBrokerHost* broker_host = static_cast<NaClBrokerHost*>(*iter);
diff --git a/chrome/browser/nacl_host/nacl_process_host.cc b/chrome/browser/nacl_host/nacl_process_host.cc
index 22429b5..8bc8b99 100644
--- a/chrome/browser/nacl_host/nacl_process_host.cc
+++ b/chrome/browser/nacl_host/nacl_process_host.cc
@@ -108,7 +108,7 @@ static bool RunningOnWOW64() {
}
NaClProcessHost::NaClProcessHost(const std::wstring& url)
- : BrowserChildProcessHost(NACL_LOADER_PROCESS),
+ : BrowserChildProcessHost(content::PROCESS_TYPE_NACL_LOADER),
reply_msg_(NULL),
internal_(new NaClInternal()),
ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) {
diff --git a/chrome/browser/renderer_host/chrome_render_message_filter.cc b/chrome/browser/renderer_host/chrome_render_message_filter.cc
index d4b98b1..94b12c7 100644
--- a/chrome/browser/renderer_host/chrome_render_message_filter.cc
+++ b/chrome/browser/renderer_host/chrome_render_message_filter.cc
@@ -31,8 +31,8 @@
#include "chrome/common/chrome_switches.h"
#include "chrome/common/url_constants.h"
#include "content/browser/renderer_host/resource_dispatcher_host.h"
-#include "content/common/child_process_info.h"
#include "content/public/browser/render_process_host.h"
+#include "content/public/common/process_type.h"
#include "googleurl/src/gurl.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h"
@@ -173,7 +173,7 @@ void ChromeRenderMessageFilter::OnRendererTrackedData(
const std::string& tracked_data) {
// TODO(rtenneti): Add support for other process types.
chrome_browser_metrics::TrackingSynchronizer::DeserializeTrackingList(
- sequence_number, tracked_data, ChildProcessInfo::RENDER_PROCESS);
+ sequence_number, tracked_data, content::PROCESS_TYPE_RENDERER);
}
void ChromeRenderMessageFilter::OnIsTrackingEnabled() {
diff --git a/chrome/browser/task_manager/task_manager_resource_providers.cc b/chrome/browser/task_manager/task_manager_resource_providers.cc
index 42e0fc1..7c23e17 100644
--- a/chrome/browser/task_manager/task_manager_resource_providers.cc
+++ b/chrome/browser/task_manager/task_manager_resource_providers.cc
@@ -47,6 +47,7 @@
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/render_process_host.h"
+#include "content/public/common/process_type.h"
#include "grit/generated_resources.h"
#include "grit/theme_resources.h"
#include "grit/theme_resources_standard.h"
@@ -786,22 +787,22 @@ TaskManager::Resource::Type TaskManagerChildProcessResource::GetType() const {
// Translate types to TaskManager::ResourceType, since ChildProcessInfo's type
// is not available for all TaskManager resources.
switch (child_process_.type()) {
- case ChildProcessInfo::PLUGIN_PROCESS:
- case ChildProcessInfo::PPAPI_PLUGIN_PROCESS:
- case ChildProcessInfo::PPAPI_BROKER_PROCESS:
+ case content::PROCESS_TYPE_PLUGIN:
+ case content::PROCESS_TYPE_PPAPI_PLUGIN:
+ case content::PROCESS_TYPE_PPAPI_BROKER:
return TaskManager::Resource::PLUGIN;
- case ChildProcessInfo::NACL_LOADER_PROCESS:
- case ChildProcessInfo::NACL_BROKER_PROCESS:
+ case content::PROCESS_TYPE_NACL_LOADER:
+ case content::PROCESS_TYPE_NACL_BROKER:
return TaskManager::Resource::NACL;
- case ChildProcessInfo::UTILITY_PROCESS:
+ case content::PROCESS_TYPE_UTILITY:
return TaskManager::Resource::UTILITY;
- case ChildProcessInfo::PROFILE_IMPORT_PROCESS:
+ case content::PROCESS_TYPE_PROFILE_IMPORT:
return TaskManager::Resource::PROFILE_IMPORT;
- case ChildProcessInfo::ZYGOTE_PROCESS:
+ case content::PROCESS_TYPE_ZYGOTE:
return TaskManager::Resource::ZYGOTE;
- case ChildProcessInfo::SANDBOX_HELPER_PROCESS:
+ case content::PROCESS_TYPE_SANDBOX_HELPER:
return TaskManager::Resource::SANDBOX_HELPER;
- case ChildProcessInfo::GPU_PROCESS:
+ case content::PROCESS_TYPE_GPU:
return TaskManager::Resource::GPU;
default:
return TaskManager::Resource::UNKNOWN;
@@ -820,9 +821,9 @@ string16 TaskManagerChildProcessResource::GetLocalizedTitle() const {
string16 title = child_process_.name();
if (title.empty()) {
switch (child_process_.type()) {
- case ChildProcessInfo::PLUGIN_PROCESS:
- case ChildProcessInfo::PPAPI_PLUGIN_PROCESS:
- case ChildProcessInfo::PPAPI_BROKER_PROCESS:
+ case content::PROCESS_TYPE_PLUGIN:
+ case content::PROCESS_TYPE_PPAPI_PLUGIN:
+ case content::PROCESS_TYPE_PPAPI_BROKER:
title = l10n_util::GetStringUTF16(IDS_TASK_MANAGER_UNKNOWN_PLUGIN_NAME);
break;
default:
@@ -838,44 +839,44 @@ string16 TaskManagerChildProcessResource::GetLocalizedTitle() const {
base::i18n::AdjustStringForLocaleDirection(&title);
switch (child_process_.type()) {
- case ChildProcessInfo::UTILITY_PROCESS:
+ case content::PROCESS_TYPE_UTILITY:
return l10n_util::GetStringUTF16(IDS_TASK_MANAGER_UTILITY_PREFIX);
- case ChildProcessInfo::PROFILE_IMPORT_PROCESS:
+ case content::PROCESS_TYPE_PROFILE_IMPORT:
return l10n_util::GetStringUTF16(IDS_TASK_MANAGER_UTILITY_PREFIX);
- case ChildProcessInfo::GPU_PROCESS:
+ case content::PROCESS_TYPE_GPU:
return l10n_util::GetStringUTF16(IDS_TASK_MANAGER_GPU_PREFIX);
- case ChildProcessInfo::NACL_BROKER_PROCESS:
+ case content::PROCESS_TYPE_NACL_BROKER:
return l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NACL_BROKER_PREFIX);
- case ChildProcessInfo::PLUGIN_PROCESS:
- case ChildProcessInfo::PPAPI_PLUGIN_PROCESS:
+ case content::PROCESS_TYPE_PLUGIN:
+ case content::PROCESS_TYPE_PPAPI_PLUGIN:
return l10n_util::GetStringFUTF16(
IDS_TASK_MANAGER_PLUGIN_PREFIX, title, child_process_.version());
- case ChildProcessInfo::PPAPI_BROKER_PROCESS:
+ case content::PROCESS_TYPE_PPAPI_BROKER:
return l10n_util::GetStringFUTF16(IDS_TASK_MANAGER_PLUGIN_BROKER_PREFIX,
title, child_process_.version());
- case ChildProcessInfo::NACL_LOADER_PROCESS:
+ case content::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 ChildProcessInfo::BROWSER_PROCESS:
- case ChildProcessInfo::RENDER_PROCESS:
- case ChildProcessInfo::ZYGOTE_PROCESS:
- case ChildProcessInfo::SANDBOX_HELPER_PROCESS:
- case ChildProcessInfo::MAX_PROCESS:
+ case content::PROCESS_TYPE_BROWSER:
+ case content::PROCESS_TYPE_RENDERER:
+ case content::PROCESS_TYPE_ZYGOTE:
+ case content::PROCESS_TYPE_SANDBOX_HELPER:
+ case content::PROCESS_TYPE_MAX:
NOTREACHED();
break;
- case ChildProcessInfo::WORKER_PROCESS:
+ case content::PROCESS_TYPE_WORKER:
NOTREACHED() << "Workers are not handled by this provider.";
break;
- case ChildProcessInfo::UNKNOWN_PROCESS:
+ case content::PROCESS_TYPE_UNKNOWN:
NOTREACHED() << "Need localized name for child process type.";
}
@@ -969,7 +970,7 @@ void TaskManagerChildProcessResourceProvider::Add(
if (!updating_)
return;
// Workers are handled by TaskManagerWorkerResourceProvider.
- if (child_process_info.type() == ChildProcessInfo::WORKER_PROCESS)
+ if (child_process_info.type() == content::PROCESS_TYPE_WORKER)
return;
std::map<ChildProcessInfo, TaskManagerChildProcessResource*>::
const_iterator iter = resources_.find(child_process_info);
@@ -987,7 +988,7 @@ void TaskManagerChildProcessResourceProvider::Remove(
const ChildProcessInfo& child_process_info) {
if (!updating_)
return;
- if (child_process_info.type() == ChildProcessInfo::WORKER_PROCESS)
+ if (child_process_info.type() == content::PROCESS_TYPE_WORKER)
return;
std::map<ChildProcessInfo, TaskManagerChildProcessResource*>
::iterator iter = resources_.find(child_process_info);
diff --git a/chrome/browser/task_manager/task_manager_worker_resource_provider.cc b/chrome/browser/task_manager/task_manager_worker_resource_provider.cc
index 24d8d37..4380ed8 100644
--- a/chrome/browser/task_manager/task_manager_worker_resource_provider.cc
+++ b/chrome/browser/task_manager/task_manager_worker_resource_provider.cc
@@ -19,6 +19,7 @@
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_types.h"
+#include "content/public/common/process_type.h"
#include "grit/generated_resources.h"
#include "grit/theme_resources_standard.h"
#include "ui/base/l10n/l10n_util.h"
@@ -237,7 +238,7 @@ void TaskManagerWorkerResourceProvider::Observe(
const content::NotificationDetails& details) {
ChildProcessInfo* process_info =
content::Details<ChildProcessInfo>(details).ptr();
- if (process_info->type() != ChildProcessInfo::WORKER_PROCESS)
+ if (process_info->type() != content::PROCESS_TYPE_WORKER)
return;
if (type == content::NOTIFICATION_CHILD_PROCESS_HOST_CONNECTED) {
ProcessIdToWorkerResources::iterator it =
@@ -299,7 +300,7 @@ void TaskManagerWorkerResourceProvider::StartObservingWorkers() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
scoped_ptr<WorkerResourceListHolder> holder(new WorkerResourceListHolder);
- BrowserChildProcessHost::Iterator iter(ChildProcessInfo::WORKER_PROCESS);
+ BrowserChildProcessHost::Iterator iter(content::PROCESS_TYPE_WORKER);
for (; !iter.Done(); ++iter) {
WorkerProcessHost* worker = static_cast<WorkerProcessHost*>(*iter);
const WorkerProcessHost::Instances& instances = worker->instances();
diff --git a/chrome/browser/ui/webui/about_ui.cc b/chrome/browser/ui/webui/about_ui.cc
index 0772078..0aa747d 100644
--- a/chrome/browser/ui/webui/about_ui.cc
+++ b/chrome/browser/ui/webui/about_ui.cc
@@ -54,6 +54,7 @@
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/common/content_client.h"
+#include "content/public/common/process_type.h"
#include "crypto/nss_util.h"
#include "googleurl/src/gurl.h"
#include "grit/browser_resources.h"
@@ -1226,7 +1227,7 @@ void AboutMemoryHandler::OnDetailsAvailable() {
root.SetString("current_browser_name", process.name);
for (size_t index = 0; index < process.processes.size(); index++) {
- if (process.processes[index].type == ChildProcessInfo::BROWSER_PROCESS)
+ if (process.processes[index].type == content::PROCESS_TYPE_BROWSER)
BindProcessMetrics(browser_data, &process.processes[index]);
else
AppendProcess(child_data, &process.processes[index]);
diff --git a/chrome/browser/ui/webui/workers_ui.cc b/chrome/browser/ui/webui/workers_ui.cc
index 4c5a3e7..d8ad254 100644
--- a/chrome/browser/ui/webui/workers_ui.cc
+++ b/chrome/browser/ui/webui/workers_ui.cc
@@ -21,6 +21,7 @@
#include "content/browser/worker_host/worker_process_host.h"
#include "content/browser/worker_host/worker_service.h"
#include "content/browser/worker_host/worker_service_observer.h"
+#include "content/public/common/process_type.h"
#include "grit/generated_resources.h"
#include "grit/workers_resources.h"
#include "ui/base/resource/resource_bundle.h"
@@ -84,7 +85,7 @@ void WorkersUIHTMLSource::StartDataRequest(const std::string& path,
void WorkersUIHTMLSource::SendSharedWorkersData(int request_id) {
ListValue workers_list;
- BrowserChildProcessHost::Iterator iter(ChildProcessInfo::WORKER_PROCESS);
+ BrowserChildProcessHost::Iterator iter(content::PROCESS_TYPE_WORKER);
for (; !iter.Done(); ++iter) {
WorkerProcessHost* worker = static_cast<WorkerProcessHost*>(*iter);
const WorkerProcessHost::Instances& instances = worker->instances();
@@ -148,7 +149,7 @@ void WorkersDOMHandler::HandleOpenDevTools(const ListValue* args) {
}
static void TerminateWorker(int worker_process_id, int worker_route_id) {
- for (BrowserChildProcessHost::Iterator iter(ChildProcessInfo::WORKER_PROCESS);
+ for (BrowserChildProcessHost::Iterator iter(content::PROCESS_TYPE_WORKER);
!iter.Done(); ++iter) {
if (iter->id() == worker_process_id) {
WorkerProcessHost* worker = static_cast<WorkerProcessHost*>(*iter);
diff --git a/chrome/test/automation/proxy_launcher.cc b/chrome/test/automation/proxy_launcher.cc
index e815b82..8cdc42ae 100644
--- a/chrome/test/automation/proxy_launcher.cc
+++ b/chrome/test/automation/proxy_launcher.cc
@@ -23,8 +23,8 @@
#include "chrome/test/base/test_launcher_utils.h"
#include "chrome/test/base/test_switches.h"
#include "chrome/test/ui/ui_test.h"
-#include "content/common/child_process_info.h"
#include "content/common/debug_flags.h"
+#include "content/public/common/process_type.h"
#include "ipc/ipc_channel.h"
#include "ipc/ipc_descriptors.h"
#include "sql/connection.h"
@@ -443,7 +443,7 @@ bool ProxyLauncher::LaunchBrowserHelper(const LaunchState& state,
// Add command line arguments that should be applied to all UI tests.
PrepareTestCommandline(&command_line, state.include_testing_id);
DebugFlags::ProcessDebugFlags(
- &command_line, ChildProcessInfo::UNKNOWN_PROCESS, false);
+ &command_line, content::PROCESS_TYPE_UNKNOWN, false);
// Sometimes one needs to run the browser under a special environment
// (e.g. valgrind) without also running the test harness (e.g. python)
diff --git a/content/browser/browser_child_process_host.cc b/content/browser/browser_child_process_host.cc
index 2268486..35ed45c 100644
--- a/content/browser/browser_child_process_host.cc
+++ b/content/browser/browser_child_process_host.cc
@@ -60,7 +60,7 @@ class ChildNotificationTask : public Task {
} // namespace
BrowserChildProcessHost::BrowserChildProcessHost(
- ChildProcessInfo::ProcessType type)
+ content::ProcessType type)
: ChildProcessInfo(type, -1),
ALLOW_THIS_IN_INITIALIZER_LIST(client_(this)),
#if !defined(OS_WIN)
@@ -157,10 +157,12 @@ void BrowserChildProcessHost::OnChildDisconnected() {
// Report that this child process crashed.
Notify(content::NOTIFICATION_CHILD_PROCESS_CRASHED);
UMA_HISTOGRAM_ENUMERATION("ChildProcess.Crashed",
- this->type(), MAX_PROCESS);
+ this->type(),
+ content::PROCESS_TYPE_MAX);
if (disconnect_was_alive_) {
UMA_HISTOGRAM_ENUMERATION("ChildProcess.CrashedWasAlive",
- this->type(), MAX_PROCESS);
+ this->type(),
+ content::PROCESS_TYPE_MAX);
}
break;
}
@@ -169,10 +171,12 @@ void BrowserChildProcessHost::OnChildDisconnected() {
// Report that this child process was killed.
Notify(content::NOTIFICATION_CHILD_PROCESS_WAS_KILLED);
UMA_HISTOGRAM_ENUMERATION("ChildProcess.Killed",
- this->type(), MAX_PROCESS);
+ this->type(),
+ content::PROCESS_TYPE_MAX);
if (disconnect_was_alive_) {
UMA_HISTOGRAM_ENUMERATION("ChildProcess.KilledWasAlive",
- this->type(), MAX_PROCESS);
+ this->type(),
+ content::PROCESS_TYPE_MAX);
}
break;
}
@@ -181,7 +185,8 @@ void BrowserChildProcessHost::OnChildDisconnected() {
// code.
if (disconnect_was_alive_) {
UMA_HISTOGRAM_ENUMERATION("ChildProcess.DisconnectedAlive",
- this->type(), MAX_PROCESS);
+ this->type(),
+ content::PROCESS_TYPE_MAX);
break;
}
disconnect_was_alive_ = true;
@@ -206,7 +211,8 @@ void BrowserChildProcessHost::OnChildDisconnected() {
break;
}
UMA_HISTOGRAM_ENUMERATION("ChildProcess.Disconnected",
- this->type(), MAX_PROCESS);
+ this->type(),
+ content::PROCESS_TYPE_MAX);
// Notify in the main loop of the disconnection.
Notify(content::NOTIFICATION_CHILD_PROCESS_HOST_DISCONNECTED);
OnChildDied();
@@ -248,13 +254,13 @@ void BrowserChildProcessHost::ClientHook::OnProcessLaunched() {
}
BrowserChildProcessHost::Iterator::Iterator()
- : all_(true), type_(UNKNOWN_PROCESS) {
+ : all_(true), type_(content::PROCESS_TYPE_UNKNOWN) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)) <<
"ChildProcessInfo::Iterator must be used on the IO thread.";
iterator_ = g_child_process_list.Get().begin();
}
-BrowserChildProcessHost::Iterator::Iterator(ChildProcessInfo::ProcessType type)
+BrowserChildProcessHost::Iterator::Iterator(content::ProcessType type)
: all_(false), type_(type) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)) <<
"ChildProcessInfo::Iterator must be used on the IO thread.";
diff --git a/content/browser/browser_child_process_host.h b/content/browser/browser_child_process_host.h
index 1dbcb56..f256669 100644
--- a/content/browser/browser_child_process_host.h
+++ b/content/browser/browser_child_process_host.h
@@ -14,6 +14,7 @@
#include "content/common/child_process_host.h"
#include "content/common/child_process_info.h"
#include "content/common/content_export.h"
+#include "content/public/common/process_type.h"
namespace base {
class WaitableEvent;
@@ -46,7 +47,7 @@ class CONTENT_EXPORT BrowserChildProcessHost :
class CONTENT_EXPORT Iterator {
public:
Iterator();
- explicit Iterator(ChildProcessInfo::ProcessType type);
+ explicit Iterator(content::ProcessType type);
BrowserChildProcessHost* operator->() { return *iterator_; }
BrowserChildProcessHost* operator*() { return *iterator_; }
BrowserChildProcessHost* operator++();
@@ -54,12 +55,12 @@ class CONTENT_EXPORT BrowserChildProcessHost :
private:
bool all_;
- ChildProcessInfo::ProcessType type_;
+ content::ProcessType type_;
std::list<BrowserChildProcessHost*>::iterator iterator_;
};
protected:
- explicit BrowserChildProcessHost(ChildProcessInfo::ProcessType type);
+ explicit BrowserChildProcessHost(content::ProcessType type);
// Derived classes call this to launch the child process asynchronously.
void Launch(
diff --git a/content/browser/debugger/worker_devtools_manager.cc b/content/browser/debugger/worker_devtools_manager.cc
index 371314c..6d6b366 100644
--- a/content/browser/debugger/worker_devtools_manager.cc
+++ b/content/browser/debugger/worker_devtools_manager.cc
@@ -19,6 +19,7 @@
#include "content/public/browser/notification_registrar.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_types.h"
+#include "content/public/common/process_type.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebCString.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebDevToolsAgent.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h"
@@ -355,7 +356,7 @@ WorkerDevToolsManager::FindInspectedWorker(
}
static WorkerProcessHost* FindWorkerProcess(int worker_process_id) {
- BrowserChildProcessHost::Iterator iter(ChildProcessInfo::WORKER_PROCESS);
+ BrowserChildProcessHost::Iterator iter(content::PROCESS_TYPE_WORKER);
for (; !iter.Done(); ++iter) {
if (iter->id() == worker_process_id)
return static_cast<WorkerProcessHost*>(*iter);
diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc
index fd2d218..ae45cad 100644
--- a/content/browser/gpu/gpu_process_host.cc
+++ b/content/browser/gpu/gpu_process_host.cc
@@ -251,7 +251,7 @@ GpuProcessHost* GpuProcessHost::FromID(int host_id) {
}
GpuProcessHost::GpuProcessHost(int host_id)
- : BrowserChildProcessHost(GPU_PROCESS),
+ : BrowserChildProcessHost(content::PROCESS_TYPE_GPU),
host_id_(host_id),
gpu_process_(base::kNullProcessHandle),
in_process_(false),
diff --git a/content/browser/plugin_process_host.cc b/content/browser/plugin_process_host.cc
index e31d161..afba6ab 100644
--- a/content/browser/plugin_process_host.cc
+++ b/content/browser/plugin_process_host.cc
@@ -28,6 +28,7 @@
#include "content/public/browser/content_browser_client.h"
#include "content/public/browser/notification_types.h"
#include "content/public/common/content_switches.h"
+#include "content/public/common/process_type.h"
#include "ipc/ipc_switches.h"
#include "ui/base/ui_base_switches.h"
#include "ui/gfx/gl/gl_switches.h"
@@ -111,7 +112,7 @@ void PluginProcessHost::OnMapNativeViewId(gfx::NativeViewId id,
#endif // defined(TOOLKIT_USES_GTK)
PluginProcessHost::PluginProcessHost()
- : BrowserChildProcessHost(PLUGIN_PROCESS)
+ : BrowserChildProcessHost(content::PROCESS_TYPE_PLUGIN)
#if defined(OS_MACOSX)
, plugin_cursor_visible_(true)
#endif
@@ -343,8 +344,7 @@ void PluginProcessHost::CancelRequests() {
// static
void PluginProcessHost::CancelPendingRequestsForResourceContext(
const content::ResourceContext* context) {
- for (BrowserChildProcessHost::Iterator host_it(
- ChildProcessInfo::PLUGIN_PROCESS);
+ for (BrowserChildProcessHost::Iterator host_it(content::PROCESS_TYPE_PLUGIN);
!host_it.Done(); ++host_it) {
PluginProcessHost* host = static_cast<PluginProcessHost*>(*host_it);
for (size_t i = 0; i < host->pending_requests_.size(); ++i) {
diff --git a/content/browser/plugin_service.cc b/content/browser/plugin_service.cc
index 6b72d40..be0f97d 100644
--- a/content/browser/plugin_service.cc
+++ b/content/browser/plugin_service.cc
@@ -32,6 +32,7 @@
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_types.h"
#include "content/public/common/content_switches.h"
+#include "content/public/common/process_type.h"
#include "webkit/plugins/npapi/plugin_constants_win.h"
#include "webkit/plugins/npapi/plugin_group.h"
#include "webkit/plugins/npapi/plugin_list.h"
@@ -80,7 +81,8 @@ void WillLoadPluginsCallback() {
static void NotifyPluginsOfActivation() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
- for (BrowserChildProcessHost::Iterator iter(ChildProcessInfo::PLUGIN_PROCESS);
+ for (BrowserChildProcessHost::Iterator iter(
+ content::PROCESS_TYPE_PLUGIN);
!iter.Done(); ++iter) {
PluginProcessHost* plugin = static_cast<PluginProcessHost*>(*iter);
plugin->OnAppActivation();
@@ -221,7 +223,7 @@ PluginProcessHost* PluginService::FindNpapiPluginProcess(
const FilePath& plugin_path) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
- for (BrowserChildProcessHost::Iterator iter(ChildProcessInfo::PLUGIN_PROCESS);
+ for (BrowserChildProcessHost::Iterator iter(content::PROCESS_TYPE_PLUGIN);
!iter.Done(); ++iter) {
PluginProcessHost* plugin = static_cast<PluginProcessHost*>(*iter);
if (plugin->info().path == plugin_path)
@@ -236,7 +238,7 @@ PpapiPluginProcessHost* PluginService::FindPpapiPluginProcess(
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
for (BrowserChildProcessHost::Iterator iter(
- ChildProcessInfo::PPAPI_PLUGIN_PROCESS);
+ content::PROCESS_TYPE_PPAPI_PLUGIN);
!iter.Done(); ++iter) {
PpapiPluginProcessHost* plugin =
static_cast<PpapiPluginProcessHost*>(*iter);
@@ -252,7 +254,7 @@ PpapiPluginProcessHost* PluginService::FindPpapiBrokerProcess(
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
for (BrowserChildProcessHost::Iterator iter(
- ChildProcessInfo::PPAPI_BROKER_PROCESS);
+ content::PROCESS_TYPE_PPAPI_BROKER);
!iter.Done(); ++iter) {
PpapiPluginProcessHost* broker =
static_cast<PpapiPluginProcessHost*>(*iter);
diff --git a/content/browser/ppapi_plugin_process_host.cc b/content/browser/ppapi_plugin_process_host.cc
index cd6abc5..1131483 100644
--- a/content/browser/ppapi_plugin_process_host.cc
+++ b/content/browser/ppapi_plugin_process_host.cc
@@ -14,6 +14,7 @@
#include "content/common/child_process_messages.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/pepper_plugin_info.h"
+#include "content/public/common/process_type.h"
#include "ipc/ipc_switches.h"
#include "net/base/network_change_notifier.h"
#include "ppapi/proxy/ppapi_messages.h"
@@ -100,7 +101,7 @@ void PpapiPluginProcessHost::OpenChannelToPlugin(Client* client) {
}
PpapiPluginProcessHost::PpapiPluginProcessHost(net::HostResolver* host_resolver)
- : BrowserChildProcessHost(ChildProcessInfo::PPAPI_PLUGIN_PROCESS),
+ : BrowserChildProcessHost(content::PROCESS_TYPE_PPAPI_PLUGIN),
filter_(new PepperMessageFilter(host_resolver)),
network_observer_(new PluginNetworkObserver(this)),
is_broker_(false),
@@ -109,7 +110,7 @@ PpapiPluginProcessHost::PpapiPluginProcessHost(net::HostResolver* host_resolver)
}
PpapiPluginProcessHost::PpapiPluginProcessHost()
- : BrowserChildProcessHost(ChildProcessInfo::PPAPI_BROKER_PROCESS),
+ : BrowserChildProcessHost(content::PROCESS_TYPE_PPAPI_BROKER),
is_broker_(true),
process_id_(ChildProcessInfo::GenerateChildProcessUniqueId()) {
}
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index 3dca1b3..2118fcc 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -85,6 +85,7 @@
#include "content/public/browser/content_browser_client.h"
#include "content/public/common/content_constants.h"
#include "content/public/common/content_switches.h"
+#include "content/public/common/process_type.h"
#include "content/public/common/result_codes.h"
#include "content/renderer/render_process_impl.h"
#include "content/renderer/render_thread_impl.h"
@@ -456,7 +457,7 @@ void RenderProcessHostImpl::CreateMessageFilters() {
channel_->AddFilter(render_message_filter);
ResourceMessageFilter* resource_message_filter = new ResourceMessageFilter(
- GetID(), ChildProcessInfo::RENDER_PROCESS,
+ GetID(), content::PROCESS_TYPE_RENDERER,
&GetBrowserContext()->GetResourceContext(),
new RendererURLRequestContextSelector(GetBrowserContext(), GetID()),
content::GetContentClient()->browser()->GetResourceDispatcherHost());
diff --git a/content/browser/renderer_host/render_widget_host_view_win.cc b/content/browser/renderer_host/render_widget_host_view_win.cc
index b8f04b1..be206c3 100644
--- a/content/browser/renderer_host/render_widget_host_view_win.cc
+++ b/content/browser/renderer_host/render_widget_host_view_win.cc
@@ -38,6 +38,7 @@
#include "content/public/browser/notification_types.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/page_zoom.h"
+#include "content/public/common/process_type.h"
#include "skia/ext/skia_utils_win.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositionUnderline.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h"
@@ -111,7 +112,7 @@ void NotifyPluginProcessHostHelper(HWND window, HWND parent, int tries) {
DWORD plugin_process_id;
bool found_starting_plugin_process = false;
GetWindowThreadProcessId(window, &plugin_process_id);
- for (BrowserChildProcessHost::Iterator iter(ChildProcessInfo::PLUGIN_PROCESS);
+ for (BrowserChildProcessHost::Iterator iter(content::PROCESS_TYPE_PLUGIN);
!iter.Done(); ++iter) {
PluginProcessHost* plugin = static_cast<PluginProcessHost*>(*iter);
if (!plugin->handle()) {
diff --git a/content/browser/renderer_host/resource_dispatcher_host.cc b/content/browser/renderer_host/resource_dispatcher_host.cc
index 7830924..053ae4b 100644
--- a/content/browser/renderer_host/resource_dispatcher_host.cc
+++ b/content/browser/renderer_host/resource_dispatcher_host.cc
@@ -58,6 +58,7 @@
#include "content/public/browser/notification_service.h"
#include "content/public/browser/resource_dispatcher_host_delegate.h"
#include "content/public/common/content_switches.h"
+#include "content/public/common/process_type.h"
#include "content/public/common/url_constants.h"
#include "net/base/auth.h"
#include "net/base/cert_status_flags.h"
@@ -152,10 +153,10 @@ GURL MaybeStripReferrer(const GURL& possible_referrer) {
// ResourceDispatcherHost should service this request. A request might be
// disallowed if the renderer is not authorized to retrieve the request URL or
// if the renderer is attempting to upload an unauthorized file.
-bool ShouldServiceRequest(ChildProcessInfo::ProcessType process_type,
+bool ShouldServiceRequest(content::ProcessType process_type,
int child_id,
const ResourceHostMsg_Request& request_data) {
- if (process_type == ChildProcessInfo::PLUGIN_PROCESS)
+ if (process_type == content::PROCESS_TYPE_PLUGIN)
return true;
ChildProcessSecurityPolicy* policy =
@@ -450,7 +451,7 @@ void ResourceDispatcherHost::BeginRequest(
const ResourceHostMsg_Request& request_data,
IPC::Message* sync_result, // only valid for sync
int route_id) {
- ChildProcessInfo::ProcessType process_type = filter_->process_type();
+ content::ProcessType process_type = filter_->process_type();
int child_id = filter_->child_id();
// If we crash here, figure out what URL the renderer was requesting.
@@ -570,7 +571,7 @@ void ResourceDispatcherHost::BeginRequest(
// MAIN_FRAME requests. Unblock requests only come from a blocked page, do
// not count as cross-site, otherwise it gets blocked indefinitely.
if (request_data.resource_type == ResourceType::MAIN_FRAME &&
- process_type == ChildProcessInfo::RENDER_PROCESS &&
+ process_type == content::PROCESS_TYPE_RENDERER &&
CrossSiteRequestManager::GetInstance()->
HasPendingCrossSiteRequest(child_id, route_id)) {
// Wrap the event handler to be sure the current page's onunload handler
@@ -754,7 +755,7 @@ ResourceDispatcherHostRequestInfo* ResourceDispatcherHost::CreateRequestInfo(
const content::ResourceContext& context) {
return new ResourceDispatcherHostRequestInfo(
handler,
- ChildProcessInfo::RENDER_PROCESS,
+ content::PROCESS_TYPE_RENDERER,
child_id,
route_id,
0,
@@ -1218,7 +1219,7 @@ void ResourceDispatcherHost::OnReceivedRedirect(net::URLRequest* request,
DCHECK(request->status().is_success());
- if (info->process_type() != ChildProcessInfo::PLUGIN_PROCESS &&
+ if (info->process_type() != content::PROCESS_TYPE_PLUGIN &&
!ChildProcessSecurityPolicy::GetInstance()->
CanRequestURL(info->child_id(), new_url)) {
VLOG(1) << "Denied unauthorized request for "
@@ -1838,7 +1839,7 @@ bool ResourceDispatcherHost::RenderViewForRequest(
}
// If the request is from the worker process, find a tab that owns the worker.
- if (info->process_type() == ChildProcessInfo::WORKER_PROCESS) {
+ if (info->process_type() == content::PROCESS_TYPE_WORKER) {
// Need to display some related UI for this network request - pick an
// arbitrary parent to do so.
if (!WorkerService::GetInstance()->GetRendererForWorker(
diff --git a/content/browser/renderer_host/resource_dispatcher_host_request_info.cc b/content/browser/renderer_host/resource_dispatcher_host_request_info.cc
index 4e4e85e..49dd23b 100644
--- a/content/browser/renderer_host/resource_dispatcher_host_request_info.cc
+++ b/content/browser/renderer_host/resource_dispatcher_host_request_info.cc
@@ -11,7 +11,7 @@
ResourceDispatcherHostRequestInfo::ResourceDispatcherHostRequestInfo(
ResourceHandler* handler,
- ChildProcessInfo::ProcessType process_type,
+ content::ProcessType process_type,
int child_id,
int route_id,
int origin_pid,
diff --git a/content/browser/renderer_host/resource_dispatcher_host_request_info.h b/content/browser/renderer_host/resource_dispatcher_host_request_info.h
index 7b2c261..e5ec4e2 100644
--- a/content/browser/renderer_host/resource_dispatcher_host_request_info.h
+++ b/content/browser/renderer_host/resource_dispatcher_host_request_info.h
@@ -10,9 +10,9 @@
#include "base/basictypes.h"
#include "base/time.h"
-#include "content/common/child_process_info.h"
#include "content/common/content_export.h"
#include "content/public/common/page_transition_types.h"
+#include "content/public/common/process_type.h"
#include "net/base/load_states.h"
#include "net/url_request/url_request.h"
#include "webkit/glue/resource_type.h"
@@ -38,7 +38,7 @@ class ResourceDispatcherHostRequestInfo : public net::URLRequest::UserData {
// This will take a reference to the handler.
CONTENT_EXPORT ResourceDispatcherHostRequestInfo(
ResourceHandler* handler,
- ChildProcessInfo::ProcessType process_type,
+ content::ProcessType process_type,
int child_id,
int route_id,
int origin_pid,
@@ -83,7 +83,7 @@ class ResourceDispatcherHostRequestInfo : public net::URLRequest::UserData {
void set_ssl_client_auth_handler(SSLClientAuthHandler* s);
// Identifies the type of process (renderer, plugin, etc.) making the request.
- ChildProcessInfo::ProcessType process_type() const {
+ content::ProcessType process_type() const {
return process_type_;
}
@@ -221,7 +221,7 @@ class ResourceDispatcherHostRequestInfo : public net::URLRequest::UserData {
CrossSiteResourceHandler* cross_site_handler_; // Non-owning, may be NULL.
scoped_refptr<ResourceDispatcherHostLoginDelegate> login_delegate_;
scoped_refptr<SSLClientAuthHandler> ssl_client_auth_handler_;
- ChildProcessInfo::ProcessType process_type_;
+ content::ProcessType process_type_;
int child_id_;
int route_id_;
int origin_pid_;
diff --git a/content/browser/renderer_host/resource_dispatcher_host_unittest.cc b/content/browser/renderer_host/resource_dispatcher_host_unittest.cc
index b8a5726..a3c7736 100644
--- a/content/browser/renderer_host/resource_dispatcher_host_unittest.cc
+++ b/content/browser/renderer_host/resource_dispatcher_host_unittest.cc
@@ -162,7 +162,7 @@ class ForwardingFilter : public ResourceMessageFilter {
explicit ForwardingFilter(IPC::Message::Sender* dest)
: ResourceMessageFilter(
ChildProcessInfo::GenerateChildProcessUniqueId(),
- ChildProcessInfo::RENDER_PROCESS,
+ content::PROCESS_TYPE_RENDERER,
content::MockResourceContext::GetInstance(),
new MockURLRequestContextSelector(
content::MockResourceContext::GetInstance()->request_context()),
diff --git a/content/browser/renderer_host/resource_message_filter.cc b/content/browser/renderer_host/resource_message_filter.cc
index ba5b7c4..5e482a8 100644
--- a/content/browser/renderer_host/resource_message_filter.cc
+++ b/content/browser/renderer_host/resource_message_filter.cc
@@ -10,7 +10,7 @@
ResourceMessageFilter::ResourceMessageFilter(
int child_id,
- ChildProcessInfo::ProcessType process_type,
+ content::ProcessType process_type,
const content::ResourceContext* resource_context,
URLRequestContextSelector* url_request_context_selector,
ResourceDispatcherHost* resource_dispatcher_host)
diff --git a/content/browser/renderer_host/resource_message_filter.h b/content/browser/renderer_host/resource_message_filter.h
index 3c14ddd..e808353 100644
--- a/content/browser/renderer_host/resource_message_filter.h
+++ b/content/browser/renderer_host/resource_message_filter.h
@@ -8,7 +8,7 @@
#include "base/memory/scoped_ptr.h"
#include "content/browser/browser_message_filter.h"
#include "content/common/content_export.h"
-#include "content/common/child_process_info.h"
+#include "content/public/common/process_type.h"
#include "webkit/glue/resource_type.h"
class ResourceDispatcherHost;
@@ -42,7 +42,7 @@ class CONTENT_EXPORT ResourceMessageFilter : public BrowserMessageFilter {
};
ResourceMessageFilter(int child_id,
- ChildProcessInfo::ProcessType process_type,
+ content::ProcessType process_type,
const content::ResourceContext* resource_context,
URLRequestContextSelector* url_request_context_selector,
ResourceDispatcherHost* resource_dispatcher_host);
@@ -61,7 +61,7 @@ class CONTENT_EXPORT ResourceMessageFilter : public BrowserMessageFilter {
ResourceType::Type request_type);
int child_id() const { return child_id_; }
- ChildProcessInfo::ProcessType process_type() const { return process_type_; }
+ content::ProcessType process_type() const { return process_type_; }
protected:
// Protected destructor so that we can be overriden in tests.
@@ -71,7 +71,7 @@ class CONTENT_EXPORT ResourceMessageFilter : public BrowserMessageFilter {
// The ID of the child process.
int child_id_;
- ChildProcessInfo::ProcessType process_type_;
+ content::ProcessType process_type_;
// Owned by ProfileIOData* which is guaranteed to outlive us.
const content::ResourceContext* const resource_context_;
diff --git a/content/browser/renderer_host/resource_queue_unittest.cc b/content/browser/renderer_host/resource_queue_unittest.cc
index 2f9e496..ee66cb6 100644
--- a/content/browser/renderer_host/resource_queue_unittest.cc
+++ b/content/browser/renderer_host/resource_queue_unittest.cc
@@ -24,7 +24,7 @@ const char kTestUrl[] = "data:text/plain,Hello World!";
ResourceDispatcherHostRequestInfo* GetRequestInfo(int request_id) {
return new ResourceDispatcherHostRequestInfo(
- new DummyResourceHandler(), ChildProcessInfo::RENDER_PROCESS, 0, 0, 0,
+ new DummyResourceHandler(), content::PROCESS_TYPE_RENDERER, 0, 0, 0,
request_id, false, -1, false, -1, ResourceType::MAIN_FRAME,
content::PAGE_TRANSITION_LINK, 0, false, false, false,
content::MockResourceContext::GetInstance());
diff --git a/content/browser/utility_process_host.cc b/content/browser/utility_process_host.cc
index f2173ca..65a7e70 100644
--- a/content/browser/utility_process_host.cc
+++ b/content/browser/utility_process_host.cc
@@ -34,7 +34,7 @@ bool UtilityProcessHost::Client::OnMessageReceived(
UtilityProcessHost::UtilityProcessHost(Client* client,
BrowserThread::ID client_thread_id)
- : BrowserChildProcessHost(UTILITY_PROCESS),
+ : BrowserChildProcessHost(content::PROCESS_TYPE_UTILITY),
client_(client),
client_thread_id_(client_thread_id),
is_batch_mode_(false),
diff --git a/content/browser/worker_host/worker_process_host.cc b/content/browser/worker_host/worker_process_host.cc
index 2b68d55..79f0dc2 100644
--- a/content/browser/worker_host/worker_process_host.cc
+++ b/content/browser/worker_host/worker_process_host.cc
@@ -84,7 +84,7 @@ void WorkerCrashCallback(int render_process_unique_id, int render_view_id) {
WorkerProcessHost::WorkerProcessHost(
const content::ResourceContext* resource_context,
ResourceDispatcherHost* resource_dispatcher_host)
- : BrowserChildProcessHost(WORKER_PROCESS),
+ : BrowserChildProcessHost(content::PROCESS_TYPE_WORKER),
resource_context_(resource_context),
resource_dispatcher_host_(resource_dispatcher_host) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
@@ -234,7 +234,7 @@ void WorkerProcessHost::CreateMessageFilters(int render_process_id) {
resource_context_->request_context();
ResourceMessageFilter* resource_message_filter = new ResourceMessageFilter(
- id(), WORKER_PROCESS, resource_context_,
+ id(), content::PROCESS_TYPE_WORKER, resource_context_,
new URLRequestContextSelector(request_context),
resource_dispatcher_host_);
AddFilter(resource_message_filter);
diff --git a/content/browser/worker_host/worker_service.cc b/content/browser/worker_host/worker_service.cc
index f14f478..27b0f2b 100644
--- a/content/browser/worker_host/worker_service.cc
+++ b/content/browser/worker_host/worker_service.cc
@@ -17,6 +17,7 @@
#include "content/common/view_messages.h"
#include "content/common/worker_messages.h"
#include "content/public/common/content_switches.h"
+#include "content/public/common/process_type.h"
#include "net/base/registry_controlled_domain.h"
using content::BrowserThread;
@@ -39,7 +40,7 @@ WorkerService::~WorkerService() {
}
void WorkerService::OnWorkerMessageFilterClosing(WorkerMessageFilter* filter) {
- for (BrowserChildProcessHost::Iterator iter(ChildProcessInfo::WORKER_PROCESS);
+ for (BrowserChildProcessHost::Iterator iter(content::PROCESS_TYPE_WORKER);
!iter.Done(); ++iter) {
WorkerProcessHost* worker = static_cast<WorkerProcessHost*>(*iter);
worker->FilterShutdown(filter);
@@ -150,7 +151,7 @@ void WorkerService::CancelCreateDedicatedWorker(
void WorkerService::ForwardToWorker(const IPC::Message& message,
WorkerMessageFilter* filter) {
- for (BrowserChildProcessHost::Iterator iter(ChildProcessInfo::WORKER_PROCESS);
+ for (BrowserChildProcessHost::Iterator iter(content::PROCESS_TYPE_WORKER);
!iter.Done(); ++iter) {
WorkerProcessHost* worker = static_cast<WorkerProcessHost*>(*iter);
if (worker->FilterMessage(message, filter))
@@ -163,7 +164,7 @@ void WorkerService::ForwardToWorker(const IPC::Message& message,
void WorkerService::DocumentDetached(unsigned long long document_id,
WorkerMessageFilter* filter) {
// Any associated shared workers can be shut down.
- for (BrowserChildProcessHost::Iterator iter(ChildProcessInfo::WORKER_PROCESS);
+ for (BrowserChildProcessHost::Iterator iter(content::PROCESS_TYPE_WORKER);
!iter.Done(); ++iter) {
WorkerProcessHost* worker = static_cast<WorkerProcessHost*>(*iter);
worker->DocumentDetached(filter, document_id);
@@ -305,7 +306,7 @@ WorkerProcessHost* WorkerService::GetProcessForDomain(const GURL& url) {
int num_processes = 0;
std::string domain =
net::RegistryControlledDomainService::GetDomainAndRegistry(url);
- for (BrowserChildProcessHost::Iterator iter(ChildProcessInfo::WORKER_PROCESS);
+ for (BrowserChildProcessHost::Iterator iter(content::PROCESS_TYPE_WORKER);
!iter.Done(); ++iter) {
num_processes++;
WorkerProcessHost* worker = static_cast<WorkerProcessHost*>(*iter);
@@ -327,7 +328,7 @@ WorkerProcessHost* WorkerService::GetProcessForDomain(const GURL& url) {
WorkerProcessHost* WorkerService::GetProcessToFillUpCores() {
int num_processes = 0;
- BrowserChildProcessHost::Iterator iter(ChildProcessInfo::WORKER_PROCESS);
+ BrowserChildProcessHost::Iterator iter(content::PROCESS_TYPE_WORKER);
for (; !iter.Done(); ++iter)
num_processes++;
@@ -339,7 +340,7 @@ WorkerProcessHost* WorkerService::GetProcessToFillUpCores() {
WorkerProcessHost* WorkerService::GetLeastLoadedWorker() {
WorkerProcessHost* smallest = NULL;
- for (BrowserChildProcessHost::Iterator iter(ChildProcessInfo::WORKER_PROCESS);
+ for (BrowserChildProcessHost::Iterator iter(content::PROCESS_TYPE_WORKER);
!iter.Done(); ++iter) {
WorkerProcessHost* worker = static_cast<WorkerProcessHost*>(*iter);
if (!smallest || worker->instances().size() < smallest->instances().size())
@@ -380,7 +381,7 @@ bool WorkerService::TabCanCreateWorkerProcess(int render_process_id,
int total_workers = 0;
int workers_per_tab = 0;
*hit_total_worker_limit = false;
- for (BrowserChildProcessHost::Iterator iter(ChildProcessInfo::WORKER_PROCESS);
+ for (BrowserChildProcessHost::Iterator iter(content::PROCESS_TYPE_WORKER);
!iter.Done(); ++iter) {
WorkerProcessHost* worker = static_cast<WorkerProcessHost*>(*iter);
for (WorkerProcessHost::Instances::const_iterator cur_instance =
@@ -428,7 +429,7 @@ void WorkerService::TryStartingQueuedWorker() {
bool WorkerService::GetRendererForWorker(int worker_process_id,
int* render_process_id,
int* render_view_id) const {
- for (BrowserChildProcessHost::Iterator iter(ChildProcessInfo::WORKER_PROCESS);
+ for (BrowserChildProcessHost::Iterator iter(content::PROCESS_TYPE_WORKER);
!iter.Done(); ++iter) {
if (iter->id() != worker_process_id)
continue;
@@ -451,7 +452,7 @@ bool WorkerService::GetRendererForWorker(int worker_process_id,
const WorkerProcessHost::WorkerInstance* WorkerService::FindWorkerInstance(
int worker_process_id) {
- for (BrowserChildProcessHost::Iterator iter(ChildProcessInfo::WORKER_PROCESS);
+ for (BrowserChildProcessHost::Iterator iter(content::PROCESS_TYPE_WORKER);
!iter.Done(); ++iter) {
if (iter->id() != worker_process_id)
continue;
@@ -492,7 +493,7 @@ WorkerService::FindSharedWorkerInstance(
const GURL& url,
const string16& name,
const content::ResourceContext* resource_context) {
- for (BrowserChildProcessHost::Iterator iter(ChildProcessInfo::WORKER_PROCESS);
+ for (BrowserChildProcessHost::Iterator iter(content::PROCESS_TYPE_WORKER);
!iter.Done(); ++iter) {
WorkerProcessHost* worker = static_cast<WorkerProcessHost*>(*iter);
for (WorkerProcessHost::Instances::iterator instance_iter =
diff --git a/content/common/child_process_info.cc b/content/common/child_process_info.cc
index 3af852d..a473b52 100644
--- a/content/common/child_process_info.cc
+++ b/content/common/child_process_info.cc
@@ -14,7 +14,7 @@
#include "base/stringprintf.h"
#include "base/utf_string_conversions.h"
-ChildProcessInfo::ChildProcessInfo(ProcessType type, int id) :
+ChildProcessInfo::ChildProcessInfo(content::ProcessType type, int id) :
type_(type) {
if (id == -1)
id_ = GenerateChildProcessUniqueId();
@@ -47,35 +47,35 @@ ChildProcessInfo& ChildProcessInfo::operator=(
// static
std::string ChildProcessInfo::GetTypeNameInEnglish(
- ChildProcessInfo::ProcessType type) {
+ content::ProcessType type) {
switch (type) {
- case BROWSER_PROCESS:
+ case content::PROCESS_TYPE_BROWSER:
return "Browser";
- case RENDER_PROCESS:
+ case content::PROCESS_TYPE_RENDERER:
return "Tab";
- case PLUGIN_PROCESS:
+ case content::PROCESS_TYPE_PLUGIN:
return "Plug-in";
- case WORKER_PROCESS:
+ case content::PROCESS_TYPE_WORKER:
return "Web Worker";
- case UTILITY_PROCESS:
+ case content::PROCESS_TYPE_UTILITY:
return "Utility";
- case PROFILE_IMPORT_PROCESS:
+ case content::PROCESS_TYPE_PROFILE_IMPORT:
return "Profile Import helper";
- case ZYGOTE_PROCESS:
+ case content::PROCESS_TYPE_ZYGOTE:
return "Zygote";
- case SANDBOX_HELPER_PROCESS:
+ case content::PROCESS_TYPE_SANDBOX_HELPER:
return "Sandbox helper";
- case NACL_LOADER_PROCESS:
+ case content::PROCESS_TYPE_NACL_LOADER:
return "Native Client module";
- case NACL_BROKER_PROCESS:
+ case content::PROCESS_TYPE_NACL_BROKER:
return "Native Client broker";
- case GPU_PROCESS:
+ case content::PROCESS_TYPE_GPU:
return "GPU";
- case PPAPI_PLUGIN_PROCESS:
+ case content::PROCESS_TYPE_PPAPI_PLUGIN:
return "Pepper Plugin";
- case PPAPI_BROKER_PROCESS:
+ case content::PROCESS_TYPE_PPAPI_BROKER:
return "Pepper Plugin Broker";
- case UNKNOWN_PROCESS:
+ case content::PROCESS_TYPE_UNKNOWN:
default:
DCHECK(false) << "Unknown child process type!";
return "Unknown";
diff --git a/content/common/child_process_info.h b/content/common/child_process_info.h
index e71b0c2..fa0b37a 100644
--- a/content/common/child_process_info.h
+++ b/content/common/child_process_info.h
@@ -11,38 +11,18 @@
#include "base/process.h"
#include "base/string16.h"
#include "content/common/content_export.h"
+#include "content/public/common/process_type.h"
// Holds information about a child process.
class CONTENT_EXPORT ChildProcessInfo {
public:
- // NOTE: Do not remove or reorder the elements in this enum, and only add new
- // items at the end, right before MAX_PROCESS. We depend on these specific
- // values in histograms.
- enum ProcessType {
- UNKNOWN_PROCESS = 1,
- BROWSER_PROCESS,
- RENDER_PROCESS,
- PLUGIN_PROCESS,
- WORKER_PROCESS,
- NACL_LOADER_PROCESS,
- UTILITY_PROCESS,
- PROFILE_IMPORT_PROCESS,
- ZYGOTE_PROCESS,
- SANDBOX_HELPER_PROCESS,
- NACL_BROKER_PROCESS,
- GPU_PROCESS,
- PPAPI_PLUGIN_PROCESS,
- PPAPI_BROKER_PROCESS,
- MAX_PROCESS
- };
-
ChildProcessInfo(const ChildProcessInfo& original);
virtual ~ChildProcessInfo();
ChildProcessInfo& operator=(const ChildProcessInfo& original);
// Returns the type of the process.
- ProcessType type() const { return type_; }
+ content::ProcessType type() const { return type_; }
// Returns the name of the process. i.e. for plugins it might be Flash, while
// for workers it might be the domain that it's from.
@@ -67,7 +47,7 @@ class CONTENT_EXPORT ChildProcessInfo {
// Returns an English name of the process type, should only be used for non
// user-visible strings, or debugging pages like about:memory.
- static std::string GetTypeNameInEnglish(ProcessType type);
+ static std::string GetTypeNameInEnglish(content::ProcessType type);
// We define the < operator so that the ChildProcessInfo can be used as a key
// in a std::map.
@@ -99,15 +79,15 @@ class CONTENT_EXPORT ChildProcessInfo {
// If the caller has already generated a unique ID for this child process,
// it should pass it as the second argument. Otherwise, -1 should be passed
// and a unique ID will be automatically generated.
- ChildProcessInfo(ProcessType type, int id);
+ ChildProcessInfo(content::ProcessType type, int id);
- void set_type(ProcessType type) { type_ = type; }
+ void set_type(content::ProcessType type) { type_ = type; }
void set_name(const string16& name) { name_ = name; }
void set_version(const string16& ver) { version_ = ver; }
void set_handle(base::ProcessHandle handle) { process_.set_handle(handle); }
private:
- ProcessType type_;
+ content::ProcessType type_;
string16 name_;
string16 version_;
int id_;
diff --git a/content/common/debug_flags.cc b/content/common/debug_flags.cc
index aec7a5f..a64edd4 100644
--- a/content/common/debug_flags.cc
+++ b/content/common/debug_flags.cc
@@ -11,7 +11,7 @@
#include "ipc/ipc_switches.h"
bool DebugFlags::ProcessDebugFlags(CommandLine* command_line,
- ChildProcessInfo::ProcessType type,
+ content::ProcessType type,
bool is_in_sandbox) {
bool should_help_child = false;
const CommandLine& current_cmd_line = *CommandLine::ForCurrentProcess();
@@ -20,11 +20,11 @@ bool DebugFlags::ProcessDebugFlags(CommandLine* command_line,
std::string value = current_cmd_line.GetSwitchValueASCII(
switches::kDebugChildren);
if (value.empty() ||
- (type == ChildProcessInfo::WORKER_PROCESS &&
+ (type == content::PROCESS_TYPE_WORKER &&
value == switches::kWorkerProcess) ||
- (type == ChildProcessInfo::RENDER_PROCESS &&
+ (type == content::PROCESS_TYPE_RENDERER &&
value == switches::kRendererProcess) ||
- (type == ChildProcessInfo::PLUGIN_PROCESS &&
+ (type == content::PROCESS_TYPE_PLUGIN &&
value == switches::kPluginProcess)) {
command_line->AppendSwitch(switches::kDebugOnStart);
should_help_child = true;
@@ -35,11 +35,11 @@ bool DebugFlags::ProcessDebugFlags(CommandLine* command_line,
std::string value = current_cmd_line.GetSwitchValueASCII(
switches::kWaitForDebuggerChildren);
if (value.empty() ||
- (type == ChildProcessInfo::WORKER_PROCESS &&
+ (type == content::PROCESS_TYPE_WORKER &&
value == switches::kWorkerProcess) ||
- (type == ChildProcessInfo::RENDER_PROCESS &&
+ (type == content::PROCESS_TYPE_RENDERER &&
value == switches::kRendererProcess) ||
- (type == ChildProcessInfo::PLUGIN_PROCESS &&
+ (type == content::PROCESS_TYPE_PLUGIN &&
value == switches::kPluginProcess)) {
command_line->AppendSwitch(switches::kWaitForDebugger);
}
diff --git a/content/common/debug_flags.h b/content/common/debug_flags.h
index d6cf062..8bc85e5 100644
--- a/content/common/debug_flags.h
+++ b/content/common/debug_flags.h
@@ -6,8 +6,8 @@
#define CONTENT_COMMON_DEBUG_FLAGS_H_
#pragma once
-#include "content/common/child_process_info.h"
#include "content/common/content_export.h"
+#include "content/public/common/process_type.h"
class CommandLine;
@@ -23,7 +23,7 @@ class CONTENT_EXPORT DebugFlags {
// calling the JIT debugger on it. It may only happen if
// is_in_sandbox is true.
static bool ProcessDebugFlags(CommandLine* command_line,
- ChildProcessInfo::ProcessType type,
+ content::ProcessType type,
bool is_in_sandbox);
};
diff --git a/content/common/sandbox_policy.cc b/content/common/sandbox_policy.cc
index 3d839a7..4b1593d 100644
--- a/content/common/sandbox_policy.cc
+++ b/content/common/sandbox_policy.cc
@@ -16,10 +16,10 @@
#include "base/stringprintf.h"
#include "base/string_util.h"
#include "base/win/windows_version.h"
-#include "content/common/child_process_info.h"
#include "content/common/debug_flags.h"
#include "content/public/common/content_client.h"
#include "content/public/common/content_switches.h"
+#include "content/public/common/process_type.h"
#include "sandbox/src/sandbox.h"
#include "ui/gfx/gl/gl_switches.h"
@@ -384,26 +384,26 @@ base::ProcessHandle StartProcessWithAccess(CommandLine* cmd_line,
const FilePath& exposed_dir) {
base::ProcessHandle process = 0;
const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess();
- ChildProcessInfo::ProcessType type;
+ content::ProcessType type;
std::string type_str = cmd_line->GetSwitchValueASCII(switches::kProcessType);
if (type_str == switches::kRendererProcess) {
- type = ChildProcessInfo::RENDER_PROCESS;
+ type = content::PROCESS_TYPE_RENDERER;
} else if (type_str == switches::kPluginProcess) {
- type = ChildProcessInfo::PLUGIN_PROCESS;
+ type = content::PROCESS_TYPE_PLUGIN;
} else if (type_str == switches::kWorkerProcess) {
- type = ChildProcessInfo::WORKER_PROCESS;
+ type = content::PROCESS_TYPE_WORKER;
} else if (type_str == switches::kNaClLoaderProcess) {
- type = ChildProcessInfo::NACL_LOADER_PROCESS;
+ type = content::PROCESS_TYPE_NACL_LOADER;
} else if (type_str == switches::kUtilityProcess) {
- type = ChildProcessInfo::UTILITY_PROCESS;
+ type = content::PROCESS_TYPE_UTILITY;
} else if (type_str == switches::kNaClBrokerProcess) {
- type = ChildProcessInfo::NACL_BROKER_PROCESS;
+ type = content::PROCESS_TYPE_NACL_BROKER;
} else if (type_str == switches::kGpuProcess) {
- type = ChildProcessInfo::GPU_PROCESS;
+ type = content::PROCESS_TYPE_GPU;
} else if (type_str == switches::kPpapiPluginProcess) {
- type = ChildProcessInfo::PPAPI_PLUGIN_PROCESS;
+ type = content::PROCESS_TYPE_PPAPI_PLUGIN;
} else if (type_str == switches::kPpapiBrokerProcess) {
- type = ChildProcessInfo::PPAPI_BROKER_PROCESS;
+ type = content::PROCESS_TYPE_PPAPI_BROKER;
} else {
NOTREACHED();
return 0;
@@ -415,12 +415,12 @@ base::ProcessHandle StartProcessWithAccess(CommandLine* cmd_line,
// First case: all process types except the nacl broker, and the plugin
// process are sandboxed by default.
bool in_sandbox =
- (type != ChildProcessInfo::NACL_BROKER_PROCESS) &&
- (type != ChildProcessInfo::PLUGIN_PROCESS) &&
- (type != ChildProcessInfo::PPAPI_BROKER_PROCESS);
+ (type != content::PROCESS_TYPE_NACL_BROKER) &&
+ (type != content::PROCESS_TYPE_PLUGIN) &&
+ (type != content::PROCESS_TYPE_PPAPI_BROKER);
// If it is the GPU process then it can be disabled by a command line flag.
- if ((type == ChildProcessInfo::GPU_PROCESS) &&
+ if ((type == content::PROCESS_TYPE_GPU) &&
(browser_command_line.HasSwitch(switches::kDisableGpuSandbox))) {
in_sandbox = false;
DVLOG(1) << "GPU sandbox is disabled";
@@ -465,7 +465,7 @@ base::ProcessHandle StartProcessWithAccess(CommandLine* cmd_line,
sandbox::TargetPolicy* policy = g_broker_services->CreatePolicy();
#if !defined(NACL_WIN64) // We don't need this code on win nacl64.
- if (type == ChildProcessInfo::PLUGIN_PROCESS &&
+ if (type == content::PROCESS_TYPE_PLUGIN &&
!browser_command_line.HasSwitch(switches::kNoSandbox) &&
content::GetContentClient()->SandboxPlugin(cmd_line, policy)) {
in_sandbox = true;
@@ -478,21 +478,21 @@ base::ProcessHandle StartProcessWithAccess(CommandLine* cmd_line,
return process;
}
- if (type == ChildProcessInfo::PLUGIN_PROCESS) {
+ if (type == content::PROCESS_TYPE_PLUGIN) {
AddGenericDllEvictionPolicy(policy);
AddPluginDllEvictionPolicy(policy);
- } else if (type == ChildProcessInfo::GPU_PROCESS) {
+ } else if (type == content::PROCESS_TYPE_GPU) {
if (!AddPolicyForGPU(cmd_line, policy))
return 0;
- } else if (type == ChildProcessInfo::PPAPI_PLUGIN_PROCESS) {
+ } else if (type == content::PROCESS_TYPE_PPAPI_PLUGIN) {
if (!AddPolicyForPepperPlugin(policy))
return 0;
} else {
AddPolicyForRenderer(policy);
// TODO(jschuh): Need get these restrictions applied to NaCl and Pepper.
// Just have to figure out what needs to be warmed up first.
- if (type == ChildProcessInfo::RENDER_PROCESS ||
- type == ChildProcessInfo::WORKER_PROCESS) {
+ if (type == content::PROCESS_TYPE_RENDERER ||
+ type == content::PROCESS_TYPE_WORKER) {
AddBaseHandleClosePolicy(policy);
}
@@ -545,7 +545,7 @@ base::ProcessHandle StartProcessWithAccess(CommandLine* cmd_line,
// scanning the address space using VirtualQuery.
// TODO(bbudge) Handle the --no-sandbox case.
// http://code.google.com/p/nativeclient/issues/detail?id=2131
- if (type == ChildProcessInfo::NACL_LOADER_PROCESS &&
+ if (type == content::PROCESS_TYPE_NACL_LOADER &&
(base::win::OSInfo::GetInstance()->wow64_status() ==
base::win::OSInfo::WOW64_DISABLED)) {
const SIZE_T kOneGigabyte = 1 << 30;
diff --git a/content/content_common.gypi b/content/content_common.gypi
index 6cd80a6..4dfdcf9 100644
--- a/content/content_common.gypi
+++ b/content/content_common.gypi
@@ -51,6 +51,7 @@
'public/common/page_zoom.h',
'public/common/pepper_plugin_info.cc',
'public/common/pepper_plugin_info.h',
+ 'public/common/process_type.h',
'public/common/renderer_preferences.cc',
'public/common/renderer_preferences.h',
'public/common/resource_dispatcher_delegate.h',
diff --git a/content/public/common/process_type.h b/content/public/common/process_type.h
new file mode 100644
index 0000000..c5a0cb0
--- /dev/null
+++ b/content/public/common/process_type.h
@@ -0,0 +1,35 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_PUBLIC_COMMON_PROCESS_TYPE_H_
+#define CONTENT_PUBLIC_COMMON_PROCESS_TYPE_H_
+#pragma once
+
+namespace content {
+
+// Defines the different process types.
+// NOTE: Do not remove or reorder the elements in this enum, and only add new
+// items at the end, right before MAX_PROCESS. We depend on these specific
+// values in histograms.
+enum ProcessType {
+ PROCESS_TYPE_UNKNOWN = 1,
+ PROCESS_TYPE_BROWSER,
+ PROCESS_TYPE_RENDERER,
+ PROCESS_TYPE_PLUGIN,
+ PROCESS_TYPE_WORKER,
+ PROCESS_TYPE_NACL_LOADER,
+ PROCESS_TYPE_UTILITY,
+ PROCESS_TYPE_PROFILE_IMPORT,
+ PROCESS_TYPE_ZYGOTE,
+ PROCESS_TYPE_SANDBOX_HELPER,
+ PROCESS_TYPE_NACL_BROKER,
+ PROCESS_TYPE_GPU,
+ PROCESS_TYPE_PPAPI_PLUGIN,
+ PROCESS_TYPE_PPAPI_BROKER,
+ PROCESS_TYPE_MAX
+};
+
+} // namespace content
+
+#endif // CONTENT_PUBLIC_COMMON_PROCESS_TYPE_H_