summaryrefslogtreecommitdiffstats
path: root/chrome/browser/worker_host
diff options
context:
space:
mode:
authorsanjeevr@chromium.org <sanjeevr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-03 05:47:42 +0000
committersanjeevr@chromium.org <sanjeevr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-03 05:47:42 +0000
commitd27893f65dbd01a0d88dcda2a69f518e4b8a636d (patch)
tree7b0573f1158681243b6605bd9f67521c9ee3193c /chrome/browser/worker_host
parentdfe7f3288af471067ecd9117049e96aa39778da9 (diff)
downloadchromium_src-d27893f65dbd01a0d88dcda2a69f518e4b8a636d.zip
chromium_src-d27893f65dbd01a0d88dcda2a69f518e4b8a636d.tar.gz
chromium_src-d27893f65dbd01a0d88dcda2a69f518e4b8a636d.tar.bz2
Moved common parts of ChildProcessHost into chrome/common and created a BrowserChildProcessHost with browser-specific implementation. This is in preparation of creating a ServiceChildProcessHost.
BUG=None TEST=Test for regressions . Review URL: http://codereview.chromium.org/2885017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51593 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/worker_host')
-rw-r--r--chrome/browser/worker_host/worker_process_host.cc4
-rw-r--r--chrome/browser/worker_host/worker_process_host.h4
-rw-r--r--chrome/browser/worker_host/worker_service.cc20
3 files changed, 14 insertions, 14 deletions
diff --git a/chrome/browser/worker_host/worker_process_host.cc b/chrome/browser/worker_host/worker_process_host.cc
index ccb7e78..762a0c5 100644
--- a/chrome/browser/worker_host/worker_process_host.cc
+++ b/chrome/browser/worker_host/worker_process_host.cc
@@ -58,7 +58,7 @@ class WorkerCrashTask : public Task {
WorkerProcessHost::WorkerProcessHost(
ResourceDispatcherHost* resource_dispatcher_host,
ChromeURLRequestContext *request_context)
- : ChildProcessHost(WORKER_PROCESS, resource_dispatcher_host),
+ : BrowserChildProcessHost(WORKER_PROCESS, resource_dispatcher_host),
request_context_(request_context),
appcache_dispatcher_host_(
new AppCacheDispatcherHost(request_context)) {
@@ -322,7 +322,7 @@ CallbackWithReturnValue<int>::Type* WorkerProcessHost::GetNextRouteIdCallback(
// We don't keep callbacks for senders associated with workers, so figure out
// what kind of sender this is, and cast it to the correct class to get the
// callback.
- for (ChildProcessHost::Iterator iter(ChildProcessInfo::WORKER_PROCESS);
+ for (BrowserChildProcessHost::Iterator iter(ChildProcessInfo::WORKER_PROCESS);
!iter.Done(); ++iter) {
WorkerProcessHost* worker = static_cast<WorkerProcessHost*>(*iter);
if (static_cast<IPC::Message::Sender*>(worker) == sender)
diff --git a/chrome/browser/worker_host/worker_process_host.h b/chrome/browser/worker_host/worker_process_host.h
index edcfb05..6e95b3f 100644
--- a/chrome/browser/worker_host/worker_process_host.h
+++ b/chrome/browser/worker_host/worker_process_host.h
@@ -10,7 +10,7 @@
#include "base/basictypes.h"
#include "base/callback.h"
#include "base/ref_counted.h"
-#include "chrome/browser/child_process_host.h"
+#include "chrome/browser/browser_child_process_host.h"
#include "chrome/browser/net/chrome_url_request_context.h"
#include "chrome/browser/worker_host/worker_document_set.h"
#include "googleurl/src/gurl.h"
@@ -31,7 +31,7 @@ struct ViewHostMsg_CreateWorker_Params;
// WorkerProcessHost per worker process. Currently each worker runs in its own
// process, but that may change. However, we do assume [by storing a
// ChromeURLRequestContext] that a WorkerProcessHost serves a single Profile.
-class WorkerProcessHost : public ChildProcessHost {
+class WorkerProcessHost : public BrowserChildProcessHost {
public:
// Contains information about each worker instance, needed to forward messages
diff --git a/chrome/browser/worker_host/worker_service.cc b/chrome/browser/worker_host/worker_service.cc
index 73848d6..60fa03d 100644
--- a/chrome/browser/worker_host/worker_service.cc
+++ b/chrome/browser/worker_host/worker_service.cc
@@ -262,7 +262,7 @@ bool WorkerService::LookupSharedWorker(
void WorkerService::DocumentDetached(IPC::Message::Sender* sender,
unsigned long long document_id) {
- for (ChildProcessHost::Iterator iter(ChildProcessInfo::WORKER_PROCESS);
+ for (BrowserChildProcessHost::Iterator iter(ChildProcessInfo::WORKER_PROCESS);
!iter.Done(); ++iter) {
WorkerProcessHost* worker = static_cast<WorkerProcessHost*>(*iter);
worker->DocumentDetached(sender, document_id);
@@ -309,7 +309,7 @@ void WorkerService::CancelCreateDedicatedWorker(IPC::Message::Sender* sender,
// There could be a race condition where the WebWorkerProxy told us to cancel
// the worker right as we sent it a message say it's been created. Look at
// the running workers.
- for (ChildProcessHost::Iterator iter(ChildProcessInfo::WORKER_PROCESS);
+ for (BrowserChildProcessHost::Iterator iter(ChildProcessInfo::WORKER_PROCESS);
!iter.Done(); ++iter) {
WorkerProcessHost* worker = static_cast<WorkerProcessHost*>(*iter);
for (WorkerProcessHost::Instances::const_iterator instance =
@@ -330,7 +330,7 @@ void WorkerService::CancelCreateDedicatedWorker(IPC::Message::Sender* sender,
void WorkerService::ForwardMessage(const IPC::Message& message,
IPC::Message::Sender* sender) {
- for (ChildProcessHost::Iterator iter(ChildProcessInfo::WORKER_PROCESS);
+ for (BrowserChildProcessHost::Iterator iter(ChildProcessInfo::WORKER_PROCESS);
!iter.Done(); ++iter) {
WorkerProcessHost* worker = static_cast<WorkerProcessHost*>(*iter);
if (worker->FilterMessage(message, sender))
@@ -344,7 +344,7 @@ WorkerProcessHost* WorkerService::GetProcessForDomain(const GURL& url) {
int num_processes = 0;
std::string domain =
net::RegistryControlledDomainService::GetDomainAndRegistry(url);
- for (ChildProcessHost::Iterator iter(ChildProcessInfo::WORKER_PROCESS);
+ for (BrowserChildProcessHost::Iterator iter(ChildProcessInfo::WORKER_PROCESS);
!iter.Done(); ++iter) {
num_processes++;
WorkerProcessHost* worker = static_cast<WorkerProcessHost*>(*iter);
@@ -366,7 +366,7 @@ WorkerProcessHost* WorkerService::GetProcessForDomain(const GURL& url) {
WorkerProcessHost* WorkerService::GetProcessToFillUpCores() {
int num_processes = 0;
- ChildProcessHost::Iterator iter(ChildProcessInfo::WORKER_PROCESS);
+ BrowserChildProcessHost::Iterator iter(ChildProcessInfo::WORKER_PROCESS);
for (; !iter.Done(); ++iter)
num_processes++;
@@ -378,7 +378,7 @@ WorkerProcessHost* WorkerService::GetProcessToFillUpCores() {
WorkerProcessHost* WorkerService::GetLeastLoadedWorker() {
WorkerProcessHost* smallest = NULL;
- for (ChildProcessHost::Iterator iter(ChildProcessInfo::WORKER_PROCESS);
+ for (BrowserChildProcessHost::Iterator iter(ChildProcessInfo::WORKER_PROCESS);
!iter.Done(); ++iter) {
WorkerProcessHost* worker = static_cast<WorkerProcessHost*>(*iter);
if (!smallest || worker->instances().size() < smallest->instances().size())
@@ -419,7 +419,7 @@ bool WorkerService::TabCanCreateWorkerProcess(int renderer_id,
int total_workers = 0;
int workers_per_tab = 0;
*hit_total_worker_limit = false;
- for (ChildProcessHost::Iterator iter(ChildProcessInfo::WORKER_PROCESS);
+ for (BrowserChildProcessHost::Iterator iter(ChildProcessInfo::WORKER_PROCESS);
!iter.Done(); ++iter) {
WorkerProcessHost* worker = static_cast<WorkerProcessHost*>(*iter);
for (WorkerProcessHost::Instances::const_iterator cur_instance =
@@ -457,7 +457,7 @@ void WorkerService::Observe(NotificationType type,
}
void WorkerService::SenderShutdown(IPC::Message::Sender* sender) {
- for (ChildProcessHost::Iterator iter(ChildProcessInfo::WORKER_PROCESS);
+ for (BrowserChildProcessHost::Iterator iter(ChildProcessInfo::WORKER_PROCESS);
!iter.Done(); ++iter) {
WorkerProcessHost* worker = static_cast<WorkerProcessHost*>(*iter);
worker->SenderShutdown(sender);
@@ -512,7 +512,7 @@ void WorkerService::WorkerProcessDestroyed(WorkerProcessHost* process) {
const WorkerProcessHost::WorkerInstance* WorkerService::FindWorkerInstance(
int worker_process_id) {
- for (ChildProcessHost::Iterator iter(ChildProcessInfo::WORKER_PROCESS);
+ for (BrowserChildProcessHost::Iterator iter(ChildProcessInfo::WORKER_PROCESS);
!iter.Done(); ++iter) {
if (iter->id() != worker_process_id)
continue;
@@ -528,7 +528,7 @@ const WorkerProcessHost::WorkerInstance* WorkerService::FindWorkerInstance(
WorkerProcessHost::WorkerInstance*
WorkerService::FindSharedWorkerInstance(const GURL& url, const string16& name,
bool off_the_record) {
- for (ChildProcessHost::Iterator iter(ChildProcessInfo::WORKER_PROCESS);
+ for (BrowserChildProcessHost::Iterator iter(ChildProcessInfo::WORKER_PROCESS);
!iter.Done(); ++iter) {
WorkerProcessHost* worker = static_cast<WorkerProcessHost*>(*iter);
for (WorkerProcessHost::Instances::iterator instance_iter =