Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5104)

Unified Diff: chrome/browser/worker_host/worker_process_host.cc

Issue 5698008: Switch a bunch of remaining filters to derive from BrowserMessageFilters so t... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/worker_host/worker_process_host.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/worker_host/worker_process_host.cc
===================================================================
--- chrome/browser/worker_host/worker_process_host.cc (revision 68877)
+++ chrome/browser/worker_host/worker_process_host.cc (working copy)
@@ -17,12 +17,12 @@
#include "chrome/browser/child_process_security_policy.h"
#include "chrome/browser/content_settings/host_content_settings_map.h"
#include "chrome/browser/file_system/file_system_dispatcher_host.h"
-#include "chrome/browser/mime_registry_dispatcher.h"
+#include "chrome/browser/mime_registry_message_filter.h"
#include "chrome/browser/net/chrome_url_request_context.h"
#include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/renderer_host/blob_dispatcher_host.h"
+#include "chrome/browser/renderer_host/blob_message_filter.h"
#include "chrome/browser/renderer_host/database_dispatcher_host.h"
-#include "chrome/browser/renderer_host/file_utilities_dispatcher_host.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"
#include "chrome/browser/renderer_host/render_view_host_notification_task.h"
@@ -68,16 +68,7 @@
ResourceDispatcherHost* resource_dispatcher_host,
ChromeURLRequestContext *request_context)
: BrowserChildProcessHost(WORKER_PROCESS, resource_dispatcher_host),
- request_context_(request_context),
- ALLOW_THIS_IN_INITIALIZER_LIST(blob_dispatcher_host_(
- new BlobDispatcherHost(
- this->id(), request_context->blob_storage_context()))),
- ALLOW_THIS_IN_INITIALIZER_LIST(file_system_dispatcher_host_(
- new FileSystemDispatcherHost(this, request_context))),
- ALLOW_THIS_IN_INITIALIZER_LIST(file_utilities_dispatcher_host_(
- new FileUtilitiesDispatcherHost(this, this->id()))),
- ALLOW_THIS_IN_INITIALIZER_LIST(mime_registry_dispatcher_(
- new MimeRegistryDispatcher(this))) {
+ request_context_(request_context) {
next_route_id_callback_.reset(NewCallbackWithReturnValue(
WorkerService::GetInstance(), &WorkerService::next_worker_route_id));
db_dispatcher_host_ = new DatabaseDispatcherHost(
@@ -94,18 +85,6 @@
// Shut down the database dispatcher host.
db_dispatcher_host_->Shutdown();
- // Shut down the blob dispatcher host.
- blob_dispatcher_host_->Shutdown();
-
- // Shut down the file system dispatcher host.
- file_system_dispatcher_host_->Shutdown();
-
- // Shut down the file utilities dispatcher host.
- file_utilities_dispatcher_host_->Shutdown();
-
- // Shut down the mime registry dispatcher host.
- mime_registry_dispatcher_->Shutdown();
-
// Let interested observers know we are being deleted.
NotificationService::current()->Notify(
NotificationType::WORKER_PROCESS_HOST_SHUTDOWN,
@@ -224,6 +203,11 @@
void WorkerProcessHost::CreateMessageFilters() {
filters_.push_back(new AppCacheDispatcherHost(request_context_, id()));
+ filters_.push_back(new FileSystemDispatcherHost(request_context_));
+ filters_.push_back(new FileUtilitiesMessageFilter(id()));
+ filters_.push_back(
+ new BlobMessageFilter(id(), request_context_->blob_storage_context()));
+ filters_.push_back(new MimeRegistryMessageFilter());
for (size_t i = 0; i < filters_.size(); ++i)
filters_[i]->OnFilterAdded(channel());
@@ -299,10 +283,6 @@
bool msg_is_ok = true;
bool handled =
db_dispatcher_host_->OnMessageReceived(message, &msg_is_ok) ||
- blob_dispatcher_host_->OnMessageReceived(message, &msg_is_ok) ||
- file_system_dispatcher_host_->OnMessageReceived(message, &msg_is_ok) ||
- file_utilities_dispatcher_host_->OnMessageReceived(message) ||
- mime_registry_dispatcher_->OnMessageReceived(message) ||
MessagePortDispatcher::GetInstance()->OnMessageReceived(
message, this, next_route_id_callback_.get(), &msg_is_ok);
@@ -363,8 +343,6 @@
void WorkerProcessHost::OnProcessLaunched() {
db_dispatcher_host_->Init(handle());
- file_system_dispatcher_host_->Init(handle());
- file_utilities_dispatcher_host_->Init(handle());
}
CallbackWithReturnValue<int>::Type* WorkerProcessHost::GetNextRouteIdCallback(
« no previous file with comments | « chrome/browser/worker_host/worker_process_host.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698