summaryrefslogtreecommitdiffstats
path: root/chrome/browser/worker_host
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-13 19:35:05 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-13 19:35:05 +0000
commit26a9acf48d0c411045030f3e6bd70dca6ab90d83 (patch)
tree38eb22a1960cd4e05249975129dc94c9b56b7c52 /chrome/browser/worker_host
parent081b094efb32b0921e949655dfca9e92933a9d66 (diff)
downloadchromium_src-26a9acf48d0c411045030f3e6bd70dca6ab90d83.zip
chromium_src-26a9acf48d0c411045030f3e6bd70dca6ab90d83.tar.gz
chromium_src-26a9acf48d0c411045030f3e6bd70dca6ab90d83.tar.bz2
Make DatabaseDispatcherHost be a message filter so that ResourceMessageFilter doesn't have to know about it.
Review URL: http://codereview.chromium.org/5757002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69031 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/worker_host')
-rw-r--r--chrome/browser/worker_host/worker_process_host.cc13
-rw-r--r--chrome/browser/worker_host/worker_process_host.h4
2 files changed, 4 insertions, 13 deletions
diff --git a/chrome/browser/worker_host/worker_process_host.cc b/chrome/browser/worker_host/worker_process_host.cc
index 2ea0564..f26059d 100644
--- a/chrome/browser/worker_host/worker_process_host.cc
+++ b/chrome/browser/worker_host/worker_process_host.cc
@@ -21,7 +21,7 @@
#include "chrome/browser/net/chrome_url_request_context.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/renderer_host/blob_message_filter.h"
-#include "chrome/browser/renderer_host/database_dispatcher_host.h"
+#include "chrome/browser/renderer_host/database_message_filter.h"
#include "chrome/browser/renderer_host/file_utilities_message_filter.h"
#include "chrome/browser/renderer_host/render_view_host.h"
#include "chrome/browser/renderer_host/render_view_host_delegate.h"
@@ -71,9 +71,6 @@ WorkerProcessHost::WorkerProcessHost(
request_context_(request_context) {
next_route_id_callback_.reset(NewCallbackWithReturnValue(
WorkerService::GetInstance(), &WorkerService::next_worker_route_id));
- db_dispatcher_host_ = new DatabaseDispatcherHost(
- request_context->database_tracker(), this,
- request_context_->host_content_settings_map());
}
WorkerProcessHost::~WorkerProcessHost() {
@@ -82,9 +79,6 @@ WorkerProcessHost::~WorkerProcessHost() {
filters_[i]->OnFilterRemoved();
}
- // Shut down the database dispatcher host.
- db_dispatcher_host_->Shutdown();
-
// Let interested observers know we are being deleted.
NotificationService::current()->Notify(
NotificationType::WORKER_PROCESS_HOST_SHUTDOWN,
@@ -208,6 +202,9 @@ void WorkerProcessHost::CreateMessageFilters() {
filters_.push_back(
new BlobMessageFilter(id(), request_context_->blob_storage_context()));
filters_.push_back(new MimeRegistryMessageFilter());
+ filters_.push_back(new DatabaseMessageFilter(
+ request_context_->database_tracker(),
+ request_context_->host_content_settings_map()));
for (size_t i = 0; i < filters_.size(); ++i)
filters_[i]->OnFilterAdded(channel());
@@ -282,7 +279,6 @@ void WorkerProcessHost::OnMessageReceived(const IPC::Message& message) {
bool msg_is_ok = true;
bool handled =
- db_dispatcher_host_->OnMessageReceived(message, &msg_is_ok) ||
MessagePortDispatcher::GetInstance()->OnMessageReceived(
message, this, next_route_id_callback_.get(), &msg_is_ok);
@@ -342,7 +338,6 @@ void WorkerProcessHost::OnChannelError() {
}
void WorkerProcessHost::OnProcessLaunched() {
- db_dispatcher_host_->Init(handle());
}
CallbackWithReturnValue<int>::Type* WorkerProcessHost::GetNextRouteIdCallback(
diff --git a/chrome/browser/worker_host/worker_process_host.h b/chrome/browser/worker_host/worker_process_host.h
index b9307ec..f00e1d0 100644
--- a/chrome/browser/worker_host/worker_process_host.h
+++ b/chrome/browser/worker_host/worker_process_host.h
@@ -12,17 +12,14 @@
#include "base/basictypes.h"
#include "base/callback.h"
#include "base/file_path.h"
-#include "base/ref_counted.h"
#include "chrome/browser/browser_child_process_host.h"
#include "chrome/browser/browser_message_filter.h"
#include "chrome/browser/net/chrome_url_request_context.h"
#include "chrome/browser/worker_host/worker_document_set.h"
#include "googleurl/src/gurl.h"
-#include "ipc/ipc_channel.h"
class ChromeURLRequestContext;
class ChromeURLRequestContextGetter;
-class DatabaseDispatcherHost;
namespace webkit_database {
class DatabaseTracker;
} // namespace webkit_database
@@ -210,7 +207,6 @@ class WorkerProcessHost : public BrowserChildProcessHost {
Instances instances_;
scoped_refptr<ChromeURLRequestContext> request_context_;
- scoped_refptr<DatabaseDispatcherHost> db_dispatcher_host_;
// Holds all the IPC message filters. Since the worker process host is on the
// IO thread, we don't have a IPC::ChannelProxy and so we manage filters