diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-01 00:39:12 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-01 00:39:12 +0000 |
commit | bd5d6cfd0e09e2123b948083bdaa39b2637b5143 (patch) | |
tree | 33cf977ea21078b69d7600ec4a12412fa23dc342 /chrome/browser | |
parent | 8d85a4b93067def07388e577b5c9e95de27f06b6 (diff) | |
download | chromium_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
Diffstat (limited to 'chrome/browser')
23 files changed, 101 insertions, 92 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); |