summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-22 05:16:13 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-22 05:16:13 +0000
commitf3b3576935e25d8d4e6c244740a06a36b9dc9f8e (patch)
treea5e44168dc6631d47c58e1b9c6008e236581bcbe /content
parent0c472954a32a68e6d6cc7be6eb53b6b9e99b66d6 (diff)
downloadchromium_src-f3b3576935e25d8d4e6c244740a06a36b9dc9f8e.zip
chromium_src-f3b3576935e25d8d4e6c244740a06a36b9dc9f8e.tar.gz
chromium_src-f3b3576935e25d8d4e6c244740a06a36b9dc9f8e.tar.bz2
Split the ProcessType enum into process types that content knows about (which will remain in src\content) and those that are for chrome (which moved to src\chrome). This way we won't get any more layering violations where nacl code is in content.
Also move the NaCl command line switches to chrome. BUG=191682 Review URL: https://codereview.chromium.org/12662019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@189763 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r--content/browser/browser_child_process_host_impl.cc27
-rw-r--r--content/browser/browser_child_process_host_impl.h2
-rw-r--r--content/browser/histogram_controller.cc3
-rw-r--r--content/browser/loader/resource_dispatcher_host_impl.cc4
-rw-r--r--content/browser/loader/resource_dispatcher_host_unittest.cc1
-rw-r--r--content/browser/loader/resource_loader.cc1
-rw-r--r--content/browser/loader/resource_message_filter.cc2
-rw-r--r--content/browser/loader/resource_message_filter.h7
-rw-r--r--content/browser/loader/resource_request_info_impl.cc2
-rw-r--r--content/browser/loader/resource_request_info_impl.h9
-rw-r--r--content/browser/plugin_process_host.h1
-rw-r--r--content/browser/profiler_controller_impl.cc2
-rw-r--r--content/browser/profiler_controller_impl.h2
-rw-r--r--content/browser/profiler_message_filter.cc2
-rw-r--r--content/browser/profiler_message_filter.h5
-rw-r--r--content/browser/tcmalloc_internals_request_job.cc2
-rw-r--r--content/browser/tcmalloc_internals_request_job.h3
-rw-r--r--content/browser/worker_host/worker_process_host.h1
-rw-r--r--content/common/process_type.cc12
-rw-r--r--content/public/browser/browser_child_process_host.h4
-rw-r--r--content/public/browser/browser_child_process_host_iterator.cc11
-rw-r--r--content/public/browser/browser_child_process_host_iterator.h9
-rw-r--r--content/public/browser/child_process_data.h7
-rw-r--r--content/public/browser/profiler_subscriber.h3
-rw-r--r--content/public/common/content_client.cc5
-rw-r--r--content/public/common/content_client.h4
-rw-r--r--content/public/common/content_switches.cc7
-rw-r--r--content/public/common/content_switches.h3
-rw-r--r--content/public/common/process_type.h14
29 files changed, 75 insertions, 80 deletions
diff --git a/content/browser/browser_child_process_host_impl.cc b/content/browser/browser_child_process_host_impl.cc
index 606ca74..7979c36 100644
--- a/content/browser/browser_child_process_host_impl.cc
+++ b/content/browser/browser_child_process_host_impl.cc
@@ -28,6 +28,7 @@
#include "content/public/browser/child_process_data.h"
#include "content/public/browser/content_browser_client.h"
#include "content/public/common/content_switches.h"
+#include "content/public/common/process_type.h"
#include "content/public/common/result_codes.h"
#if defined(OS_MACOSX)
@@ -61,9 +62,9 @@ void NotifyProcessCrashed(const ChildProcessData& data) {
} // namespace
BrowserChildProcessHost* BrowserChildProcessHost::Create(
- ProcessType type,
+ int process_type,
BrowserChildProcessHostDelegate* delegate) {
- return new BrowserChildProcessHostImpl(type, delegate);
+ return new BrowserChildProcessHostImpl(process_type, delegate);
}
#if defined(OS_MACOSX)
@@ -93,15 +94,15 @@ void BrowserChildProcessHostImpl::RemoveObserver(
}
BrowserChildProcessHostImpl::BrowserChildProcessHostImpl(
- ProcessType type,
+ int process_type,
BrowserChildProcessHostDelegate* delegate)
- : data_(type),
+ : data_(process_type),
delegate_(delegate) {
data_.id = ChildProcessHostImpl::GenerateChildProcessUniqueId();
child_process_host_.reset(ChildProcessHost::Create(this));
child_process_host_->AddFilter(new TraceMessageFilter);
- child_process_host_->AddFilter(new ProfilerMessageFilter(type));
+ child_process_host_->AddFilter(new ProfilerMessageFilter(process_type));
child_process_host_->AddFilter(new HistogramMessageFilter());
g_child_process_list.Get().push_back(this);
@@ -265,29 +266,29 @@ void BrowserChildProcessHostImpl::OnChildDisconnected() {
delegate_->OnProcessCrashed(exit_code);
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
base::Bind(&NotifyProcessCrashed, data_));
- UMA_HISTOGRAM_ENUMERATION("ChildProcess.Crashed",
- data_.type,
+ UMA_HISTOGRAM_ENUMERATION("ChildProcess.Crashed2",
+ data_.process_type,
PROCESS_TYPE_MAX);
break;
}
case base::TERMINATION_STATUS_PROCESS_WAS_KILLED: {
delegate_->OnProcessCrashed(exit_code);
// Report that this child process was killed.
- UMA_HISTOGRAM_ENUMERATION("ChildProcess.Killed",
- data_.type,
+ UMA_HISTOGRAM_ENUMERATION("ChildProcess.Killed2",
+ data_.process_type,
PROCESS_TYPE_MAX);
break;
}
case base::TERMINATION_STATUS_STILL_RUNNING: {
- UMA_HISTOGRAM_ENUMERATION("ChildProcess.DisconnectedAlive",
- data_.type,
+ UMA_HISTOGRAM_ENUMERATION("ChildProcess.DisconnectedAlive2",
+ data_.process_type,
PROCESS_TYPE_MAX);
}
default:
break;
}
- UMA_HISTOGRAM_ENUMERATION("ChildProcess.Disconnected",
- data_.type,
+ UMA_HISTOGRAM_ENUMERATION("ChildProcess.Disconnected2",
+ data_.process_type,
PROCESS_TYPE_MAX);
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
base::Bind(&NotifyProcessHostDisconnected, data_));
diff --git a/content/browser/browser_child_process_host_impl.h b/content/browser/browser_child_process_host_impl.h
index 0f5cc5c..e3fdcb5 100644
--- a/content/browser/browser_child_process_host_impl.h
+++ b/content/browser/browser_child_process_host_impl.h
@@ -30,7 +30,7 @@ class CONTENT_EXPORT BrowserChildProcessHostImpl
public ChildProcessLauncher::Client {
public:
BrowserChildProcessHostImpl(
- ProcessType type,
+ int process_type,
BrowserChildProcessHostDelegate* delegate);
virtual ~BrowserChildProcessHostImpl();
diff --git a/content/browser/histogram_controller.cc b/content/browser/histogram_controller.cc
index 228e67f..54f760b 100644
--- a/content/browser/histogram_controller.cc
+++ b/content/browser/histogram_controller.cc
@@ -12,6 +12,7 @@
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/child_process_data.h"
#include "content/public/browser/render_process_host.h"
+#include "content/public/common/process_type.h"
namespace content {
@@ -71,7 +72,7 @@ void HistogramController::GetHistogramDataFromChildProcesses(
int pending_processes = 0;
for (BrowserChildProcessHostIterator iter; !iter.Done(); ++iter) {
- ProcessType type = iter.GetData().type;
+ int type = iter.GetData().process_type;
if (type != PROCESS_TYPE_PLUGIN && type != PROCESS_TYPE_GPU)
continue;
++pending_processes;
diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc
index 4c4f86c..d953bd4 100644
--- a/content/browser/loader/resource_dispatcher_host_impl.cc
+++ b/content/browser/loader/resource_dispatcher_host_impl.cc
@@ -160,7 +160,7 @@ GURL MaybeStripReferrer(const GURL& possible_referrer) {
// ResourceDispatcherHostImpl 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(ProcessType process_type,
+bool ShouldServiceRequest(int process_type,
int child_id,
const ResourceHostMsg_Request& request_data) {
if (process_type == PROCESS_TYPE_PLUGIN)
@@ -877,7 +877,7 @@ void ResourceDispatcherHostImpl::BeginRequest(
const ResourceHostMsg_Request& request_data,
IPC::Message* sync_result, // only valid for sync
int route_id) {
- ProcessType process_type = filter_->process_type();
+ int process_type = filter_->process_type();
int child_id = filter_->child_id();
// If we crash here, figure out what URL the renderer was requesting.
diff --git a/content/browser/loader/resource_dispatcher_host_unittest.cc b/content/browser/loader/resource_dispatcher_host_unittest.cc
index 139b416..329c939 100644
--- a/content/browser/loader/resource_dispatcher_host_unittest.cc
+++ b/content/browser/loader/resource_dispatcher_host_unittest.cc
@@ -23,6 +23,7 @@
#include "content/public/browser/resource_context.h"
#include "content/public/browser/resource_dispatcher_host_delegate.h"
#include "content/public/browser/resource_throttle.h"
+#include "content/public/common/process_type.h"
#include "content/public/common/resource_response.h"
#include "content/public/test/test_browser_context.h"
#include "content/test/test_content_browser_client.h"
diff --git a/content/browser/loader/resource_loader.cc b/content/browser/loader/resource_loader.cc
index 91e07a5..a88aa05 100644
--- a/content/browser/loader/resource_loader.cc
+++ b/content/browser/loader/resource_loader.cc
@@ -19,6 +19,7 @@
#include "content/public/browser/site_instance.h"
#include "content/public/common/content_client.h"
#include "content/public/common/content_switches.h"
+#include "content/public/common/process_type.h"
#include "content/public/common/resource_response.h"
#include "content/public/common/url_constants.h"
#include "net/base/load_flags.h"
diff --git a/content/browser/loader/resource_message_filter.cc b/content/browser/loader/resource_message_filter.cc
index 6f7c97c..47e86d5 100644
--- a/content/browser/loader/resource_message_filter.cc
+++ b/content/browser/loader/resource_message_filter.cc
@@ -14,7 +14,7 @@ namespace content {
ResourceMessageFilter::ResourceMessageFilter(
int child_id,
- ProcessType process_type,
+ int process_type,
ResourceContext* resource_context,
ChromeAppCacheService* appcache_service,
ChromeBlobStorageContext* blob_storage_context,
diff --git a/content/browser/loader/resource_message_filter.h b/content/browser/loader/resource_message_filter.h
index c7dd258..eb7d0f9 100644
--- a/content/browser/loader/resource_message_filter.h
+++ b/content/browser/loader/resource_message_filter.h
@@ -8,7 +8,6 @@
#include "base/memory/scoped_ptr.h"
#include "content/common/content_export.h"
#include "content/public/browser/browser_message_filter.h"
-#include "content/public/common/process_type.h"
#include "webkit/glue/resource_type.h"
namespace fileapi {
@@ -47,7 +46,7 @@ class CONTENT_EXPORT ResourceMessageFilter : public BrowserMessageFilter {
ResourceMessageFilter(
int child_id,
- ProcessType process_type,
+ int process_type,
ResourceContext* resource_context,
ChromeAppCacheService* appcache_service,
ChromeBlobStorageContext* blob_storage_context,
@@ -80,7 +79,7 @@ class CONTENT_EXPORT ResourceMessageFilter : public BrowserMessageFilter {
ResourceType::Type request_type);
int child_id() const { return child_id_; }
- ProcessType process_type() const { return process_type_; }
+ int process_type() const { return process_type_; }
protected:
// Protected destructor so that we can be overriden in tests.
@@ -90,7 +89,7 @@ class CONTENT_EXPORT ResourceMessageFilter : public BrowserMessageFilter {
// The ID of the child process.
int child_id_;
- ProcessType process_type_;
+ int process_type_;
// Owned by ProfileIOData* which is guaranteed to outlive us.
ResourceContext* resource_context_;
diff --git a/content/browser/loader/resource_request_info_impl.cc b/content/browser/loader/resource_request_info_impl.cc
index 98f346d..8039a12 100644
--- a/content/browser/loader/resource_request_info_impl.cc
+++ b/content/browser/loader/resource_request_info_impl.cc
@@ -81,7 +81,7 @@ const ResourceRequestInfoImpl* ResourceRequestInfoImpl::ForRequest(
}
ResourceRequestInfoImpl::ResourceRequestInfoImpl(
- ProcessType process_type,
+ int process_type,
int child_id,
int route_id,
int origin_pid,
diff --git a/content/browser/loader/resource_request_info_impl.h b/content/browser/loader/resource_request_info_impl.h
index bf0c6b9..f558203 100644
--- a/content/browser/loader/resource_request_info_impl.h
+++ b/content/browser/loader/resource_request_info_impl.h
@@ -12,7 +12,6 @@
#include "base/memory/scoped_ptr.h"
#include "base/supports_user_data.h"
#include "content/public/browser/resource_request_info.h"
-#include "content/public/common/process_type.h"
#include "content/public/common/referrer.h"
#include "net/base/load_states.h"
#include "webkit/glue/resource_type.h"
@@ -40,7 +39,7 @@ class ResourceRequestInfoImpl : public ResourceRequestInfo,
const net::URLRequest* request);
CONTENT_EXPORT ResourceRequestInfoImpl(
- ProcessType process_type,
+ int process_type,
int child_id,
int route_id,
int origin_pid,
@@ -93,9 +92,7 @@ class ResourceRequestInfoImpl : public ResourceRequestInfo,
}
// Identifies the type of process (renderer, plugin, etc.) making the request.
- ProcessType process_type() const {
- return process_type_;
- }
+ int process_type() const { return process_type_; }
// Downloads are allowed only as a top level request.
bool allow_download() const { return allow_download_; }
@@ -128,7 +125,7 @@ class ResourceRequestInfoImpl : public ResourceRequestInfo,
// Non-owning, may be NULL.
CrossSiteResourceHandler* cross_site_handler_;
- ProcessType process_type_;
+ int process_type_;
int child_id_;
int route_id_;
int origin_pid_;
diff --git a/content/browser/plugin_process_host.h b/content/browser/plugin_process_host.h
index 3795df3..63696ef 100644
--- a/content/browser/plugin_process_host.h
+++ b/content/browser/plugin_process_host.h
@@ -18,6 +18,7 @@
#include "content/common/content_export.h"
#include "content/public/browser/browser_child_process_host_delegate.h"
#include "content/public/browser/browser_child_process_host_iterator.h"
+#include "content/public/common/process_type.h"
#include "ipc/ipc_channel_proxy.h"
#include "webkit/plugins/webplugininfo.h"
#include "ui/gfx/native_widget_types.h"
diff --git a/content/browser/profiler_controller_impl.cc b/content/browser/profiler_controller_impl.cc
index fcf61ea..00088ce 100644
--- a/content/browser/profiler_controller_impl.cc
+++ b/content/browser/profiler_controller_impl.cc
@@ -40,7 +40,7 @@ void ProfilerControllerImpl::OnPendingProcesses(int sequence_number,
void ProfilerControllerImpl::OnProfilerDataCollected(
int sequence_number,
const tracked_objects::ProcessDataSnapshot& profiler_data,
- ProcessType process_type) {
+ int process_type) {
if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
diff --git a/content/browser/profiler_controller_impl.h b/content/browser/profiler_controller_impl.h
index efce32a..1efbafa 100644
--- a/content/browser/profiler_controller_impl.h
+++ b/content/browser/profiler_controller_impl.h
@@ -39,7 +39,7 @@ class ProfilerControllerImpl : public ProfilerController {
void OnProfilerDataCollected(
int sequence_number,
const tracked_objects::ProcessDataSnapshot& profiler_data,
- ProcessType process_type);
+ int process_type);
// ProfilerController implementation:
virtual void Register(ProfilerSubscriber* subscriber) OVERRIDE;
diff --git a/content/browser/profiler_message_filter.cc b/content/browser/profiler_message_filter.cc
index d1d3e8f..217a2f4 100644
--- a/content/browser/profiler_message_filter.cc
+++ b/content/browser/profiler_message_filter.cc
@@ -12,7 +12,7 @@
namespace content {
-ProfilerMessageFilter::ProfilerMessageFilter(ProcessType process_type)
+ProfilerMessageFilter::ProfilerMessageFilter(int process_type)
: process_type_(process_type) {
}
diff --git a/content/browser/profiler_message_filter.h b/content/browser/profiler_message_filter.h
index 99d7327..bbac0ba 100644
--- a/content/browser/profiler_message_filter.h
+++ b/content/browser/profiler_message_filter.h
@@ -8,7 +8,6 @@
#include <string>
#include "content/public/browser/browser_message_filter.h"
-#include "content/public/common/process_type.h"
namespace tracked_objects {
struct ProcessDataSnapshot;
@@ -19,7 +18,7 @@ namespace content {
// This class sends and receives profiler messages in the browser process.
class ProfilerMessageFilter : public BrowserMessageFilter {
public:
- explicit ProfilerMessageFilter(ProcessType process_type);
+ explicit ProfilerMessageFilter(int process_type);
// BrowserMessageFilter implementation.
virtual void OnChannelConnected(int32 peer_pid) OVERRIDE;
@@ -41,7 +40,7 @@ class ProfilerMessageFilter : public BrowserMessageFilter {
void OnTcmallocStats(const std::string& output);
#endif
- ProcessType process_type_;
+ int process_type_;
DISALLOW_COPY_AND_ASSIGN(ProfilerMessageFilter);
};
diff --git a/content/browser/tcmalloc_internals_request_job.cc b/content/browser/tcmalloc_internals_request_job.cc
index 87975b4..b155b2f 100644
--- a/content/browser/tcmalloc_internals_request_job.cc
+++ b/content/browser/tcmalloc_internals_request_job.cc
@@ -24,7 +24,7 @@ AboutTcmallocOutputs::AboutTcmallocOutputs() {}
AboutTcmallocOutputs::~AboutTcmallocOutputs() {}
void AboutTcmallocOutputs::OnStatsForChildProcess(
- base::ProcessId pid, ProcessType process_type,
+ base::ProcessId pid, int process_type,
const std::string& output) {
std::string header = GetProcessTypeNameInEnglish(process_type);
base::StringAppendF(&header, " PID %d", static_cast<int>(pid));
diff --git a/content/browser/tcmalloc_internals_request_job.h b/content/browser/tcmalloc_internals_request_job.h
index d74b656..03912d1 100644
--- a/content/browser/tcmalloc_internals_request_job.h
+++ b/content/browser/tcmalloc_internals_request_job.h
@@ -10,7 +10,6 @@
#include "base/memory/singleton.h"
#include "base/process.h"
#include "build/build_config.h" // USE_TCMALLOC
-#include "content/public/common/process_type.h"
#include "net/url_request/url_request_simple_job.h"
namespace content {
@@ -29,7 +28,7 @@ class AboutTcmallocOutputs {
// the output for a canonical process-specific header string that
// incorporates the pid.
void OnStatsForChildProcess(base::ProcessId pid,
- ProcessType process_type,
+ int process_type,
const std::string& output);
private:
diff --git a/content/browser/worker_host/worker_process_host.h b/content/browser/worker_host/worker_process_host.h
index 147348d..dd1d58f 100644
--- a/content/browser/worker_host/worker_process_host.h
+++ b/content/browser/worker_host/worker_process_host.h
@@ -17,6 +17,7 @@
#include "content/common/content_export.h"
#include "content/public/browser/browser_child_process_host_delegate.h"
#include "content/public/browser/browser_child_process_host_iterator.h"
+#include "content/public/common/process_type.h"
#include "googleurl/src/gurl.h"
#include "ipc/ipc_sender.h"
diff --git a/content/common/process_type.cc b/content/common/process_type.cc
index 65b561d..c4e293b 100644
--- a/content/common/process_type.cc
+++ b/content/common/process_type.cc
@@ -5,10 +5,11 @@
#include "content/public/common/process_type.h"
#include "base/logging.h"
+#include "content/public/common/content_client.h"
namespace content {
-std::string GetProcessTypeNameInEnglish(ProcessType type) {
+std::string GetProcessTypeNameInEnglish(int type) {
switch (type) {
case PROCESS_TYPE_BROWSER:
return "Browser";
@@ -20,16 +21,10 @@ std::string GetProcessTypeNameInEnglish(ProcessType type) {
return "Web Worker";
case PROCESS_TYPE_UTILITY:
return "Utility";
- case PROCESS_TYPE_PROFILE_IMPORT:
- return "Profile Import helper";
case PROCESS_TYPE_ZYGOTE:
return "Zygote";
case PROCESS_TYPE_SANDBOX_HELPER:
return "Sandbox helper";
- case PROCESS_TYPE_NACL_LOADER:
- return "Native Client module";
- case PROCESS_TYPE_NACL_BROKER:
- return "Native Client broker";
case PROCESS_TYPE_GPU:
return "GPU";
case PROCESS_TYPE_PPAPI_PLUGIN:
@@ -37,10 +32,11 @@ std::string GetProcessTypeNameInEnglish(ProcessType type) {
case PROCESS_TYPE_PPAPI_BROKER:
return "Pepper Plugin Broker";
case PROCESS_TYPE_UNKNOWN:
- default:
DCHECK(false) << "Unknown child process type!";
return "Unknown";
}
+
+ return content::GetContentClient()->GetProcessTypeNameInEnglish(type);
}
} // namespace content
diff --git a/content/public/browser/browser_child_process_host.h b/content/public/browser/browser_child_process_host.h
index ab0b37b..bafb027 100644
--- a/content/public/browser/browser_child_process_host.h
+++ b/content/public/browser/browser_child_process_host.h
@@ -30,8 +30,10 @@ struct ChildProcessData;
class CONTENT_EXPORT BrowserChildProcessHost : public IPC::Sender {
public:
// Used to create a child process host. The delegate must outlive this object.
+ // |process_type| needs to be either an enum value from ProcessType or an
+ // embedder-defined value.
static BrowserChildProcessHost* Create(
- ProcessType type,
+ int process_type,
BrowserChildProcessHostDelegate* delegate);
virtual ~BrowserChildProcessHost() {}
diff --git a/content/public/browser/browser_child_process_host_iterator.cc b/content/public/browser/browser_child_process_host_iterator.cc
index bda317e..19eaec3 100644
--- a/content/public/browser/browser_child_process_host_iterator.cc
+++ b/content/public/browser/browser_child_process_host_iterator.cc
@@ -11,19 +11,18 @@
namespace content {
BrowserChildProcessHostIterator::BrowserChildProcessHostIterator()
- : all_(true), type_(content::PROCESS_TYPE_UNKNOWN) {
+ : all_(true), process_type_(PROCESS_TYPE_UNKNOWN) {
CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)) <<
"BrowserChildProcessHostIterator must be used on the IO thread.";
iterator_ = BrowserChildProcessHostImpl::GetIterator()->begin();
}
-BrowserChildProcessHostIterator::BrowserChildProcessHostIterator(
- content::ProcessType type)
- : all_(false), type_(type) {
+BrowserChildProcessHostIterator::BrowserChildProcessHostIterator(int type)
+ : all_(false), process_type_(type) {
CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)) <<
"BrowserChildProcessHostIterator must be used on the IO thread.";
iterator_ = BrowserChildProcessHostImpl::GetIterator()->begin();
- if (!Done() && (*iterator_)->GetData().type != type_)
+ if (!Done() && (*iterator_)->GetData().process_type != process_type_)
++(*this);
}
@@ -34,7 +33,7 @@ bool BrowserChildProcessHostIterator::operator++() {
if (Done())
break;
- if (!all_ && (*iterator_)->GetData().type != type_)
+ if (!all_ && (*iterator_)->GetData().process_type != process_type_)
continue;
return true;
diff --git a/content/public/browser/browser_child_process_host_iterator.h b/content/public/browser/browser_child_process_host_iterator.h
index 5a0f4f8..c9e0d71 100644
--- a/content/public/browser/browser_child_process_host_iterator.h
+++ b/content/public/browser/browser_child_process_host_iterator.h
@@ -8,7 +8,6 @@
#include <list>
#include "content/common/content_export.h"
-#include "content/public/common/process_type.h"
namespace IPC {
class Message;
@@ -26,7 +25,7 @@ struct ChildProcessData;
class CONTENT_EXPORT BrowserChildProcessHostIterator {
public:
BrowserChildProcessHostIterator();
- explicit BrowserChildProcessHostIterator(content::ProcessType type);
+ explicit BrowserChildProcessHostIterator(int type);
// These methods work on the current iterator object. Only call them if
// Done() returns false.
@@ -38,7 +37,7 @@ class CONTENT_EXPORT BrowserChildProcessHostIterator {
private:
bool all_;
- content::ProcessType type_;
+ int process_type_;
std::list<BrowserChildProcessHostImpl*>::iterator iterator_;
};
@@ -50,8 +49,8 @@ template <class T>
class CONTENT_EXPORT BrowserChildProcessHostTypeIterator
: public BrowserChildProcessHostIterator {
public:
- explicit BrowserChildProcessHostTypeIterator(content::ProcessType type)
- : BrowserChildProcessHostIterator(type) {}
+ explicit BrowserChildProcessHostTypeIterator(int process_type)
+ : BrowserChildProcessHostIterator(process_type) {}
T* operator->() {
return static_cast<T*>(GetDelegate());
}
diff --git a/content/public/browser/child_process_data.h b/content/public/browser/child_process_data.h
index c6db180..adeff15 100644
--- a/content/public/browser/child_process_data.h
+++ b/content/public/browser/child_process_data.h
@@ -8,14 +8,13 @@
#include "base/process.h"
#include "base/string16.h"
#include "content/common/content_export.h"
-#include "content/public/common/process_type.h"
namespace content {
// Holds information about a child process.
struct ChildProcessData {
// The type of the process.
- content::ProcessType type;
+ int process_type;
// The name of the process. i.e. for plugins it might be Flash, while for
// for workers it might be the domain that it's from.
@@ -29,8 +28,8 @@ struct ChildProcessData {
// The handle to the process.
base::ProcessHandle handle;
- explicit ChildProcessData(content::ProcessType type)
- : type(type), id(0), handle(base::kNullProcessHandle) {
+ explicit ChildProcessData(int process_type)
+ : process_type(process_type), id(0), handle(base::kNullProcessHandle) {
}
};
diff --git a/content/public/browser/profiler_subscriber.h b/content/public/browser/profiler_subscriber.h
index ca83643..102de1a 100644
--- a/content/public/browser/profiler_subscriber.h
+++ b/content/public/browser/profiler_subscriber.h
@@ -6,7 +6,6 @@
#define CONTENT_PUBLIC_BROWSER_PROFILER_SUBSCRIBER_H_
#include "content/common/content_export.h"
-#include "content/public/common/process_type.h"
namespace tracked_objects {
struct ProcessDataSnapshot;
@@ -28,7 +27,7 @@ class CONTENT_EXPORT ProfilerSubscriber {
virtual void OnProfilerDataCollected(
int sequence_number,
const tracked_objects::ProcessDataSnapshot& profiler_data,
- ProcessType process_type) = 0;
+ int process_type) = 0;
protected:
virtual ~ProfilerSubscriber() {}
diff --git a/content/public/common/content_client.cc b/content/public/common/content_client.cc
index 9dee64e..31bbb8a 100644
--- a/content/public/common/content_client.cc
+++ b/content/public/common/content_client.cc
@@ -88,6 +88,11 @@ gfx::Image& ContentClient::GetNativeImageNamed(int resource_id) const {
return kEmptyImage;
}
+std::string ContentClient::GetProcessTypeNameInEnglish(int type) {
+ NOTIMPLEMENTED();
+ return std::string();
+}
+
#if defined(OS_MACOSX) && !defined(OS_IOS)
bool ContentClient::GetSandboxProfileForSandboxType(
int sandbox_type,
diff --git a/content/public/common/content_client.h b/content/public/common/content_client.h
index 77d084a..ab397b0 100644
--- a/content/public/common/content_client.h
+++ b/content/public/common/content_client.h
@@ -133,6 +133,10 @@ class CONTENT_EXPORT ContentClient {
// Returns a native image given its id.
virtual gfx::Image& GetNativeImageNamed(int resource_id) const;
+ // Called by content::GetProcessTypeNameInEnglish for process types that it
+ // doesn't know about because they're from the embedder.
+ virtual std::string GetProcessTypeNameInEnglish(int type);
+
#if defined(OS_MACOSX) && !defined(OS_IOS)
// Allows the embedder to define a new |sandbox_type| by mapping it to the
// resource ID corresponding to the sandbox profile to use. The legal values
diff --git a/content/public/common/content_switches.cc b/content/public/common/content_switches.cc
index 4892349..210b5b3 100644
--- a/content/public/common/content_switches.cc
+++ b/content/public/common/content_switches.cc
@@ -499,13 +499,6 @@ const char kLogPluginMessages[] = "log-plugin-messages";
// Renderer.Memory histogram. Used in memory tests.
const char kMemoryMetrics[] = "memory-metrics";
-// Causes the process to run as a NativeClient broker
-// (used for launching NaCl loader processes on 64-bit Windows).
-const char kNaClBrokerProcess[] = "nacl-broker";
-
-// Causes the process to run as a NativeClient loader.
-const char kNaClLoaderProcess[] = "nacl-loader";
-
// Don't send HTTP-Referer headers.
const char kNoReferrers[] = "no-referrers";
diff --git a/content/public/common/content_switches.h b/content/public/common/content_switches.h
index bdb279b..c9fc568 100644
--- a/content/public/common/content_switches.h
+++ b/content/public/common/content_switches.h
@@ -155,9 +155,6 @@ extern const char kLoadPlugin[];
CONTENT_EXPORT extern const char kLoggingLevel[];
extern const char kLogPluginMessages[];
extern const char kMemoryMetrics[];
-// TODO(jam): this doesn't belong in content.
-CONTENT_EXPORT extern const char kNaClBrokerProcess[];
-CONTENT_EXPORT extern const char kNaClLoaderProcess[];
CONTENT_EXPORT extern const char kNoReferrers[];
CONTENT_EXPORT extern const char kNoSandbox[];
CONTENT_EXPORT extern const char kAllowNoSandboxJob[];
diff --git a/content/public/common/process_type.h b/content/public/common/process_type.h
index 9e23583..495bef3 100644
--- a/content/public/common/process_type.h
+++ b/content/public/common/process_type.h
@@ -13,7 +13,7 @@ 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
+// items at the end, right before PROCESS_TYPE_MAX. We depend on these specific
// values in histograms.
enum ProcessType {
PROCESS_TYPE_UNKNOWN = 1,
@@ -21,21 +21,23 @@ enum ProcessType {
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
+ // Custom process types used by the embedder should start from here.
+ PROCESS_TYPE_CONTENT_END,
+ // If any embedder has more than 10 custom process types, update this.
+ // We can switch to getting it from ContentClient, but that seems like
+ // overkill at this time.
+ PROCESS_TYPE_MAX = PROCESS_TYPE_CONTENT_END + 10,
};
// Returns an English name of the process type, should only be used for non
// user-visible strings, or debugging pages like about:memory.
-CONTENT_EXPORT std::string GetProcessTypeNameInEnglish(ProcessType type);
+CONTENT_EXPORT std::string GetProcessTypeNameInEnglish(int type);
} // namespace content