Index: content/child/child_thread.cc |
diff --git a/content/child/child_thread.cc b/content/child/child_thread.cc |
index eefa4c5a5c04cabbcc17ac812e97083864e008ab..d41c5aeeddf12c9a851d9daee69ef54a1c0d53bd 100644 |
--- a/content/child/child_thread.cc |
+++ b/content/child/child_thread.cc |
@@ -20,6 +20,7 @@ |
#include "content/child/child_resource_message_filter.h" |
#include "content/child/fileapi/file_system_dispatcher.h" |
#include "content/child/quota_dispatcher.h" |
+#include "content/child/quota_message_filter.h" |
#include "content/child/resource_dispatcher.h" |
#include "content/child/socket_stream_dispatcher.h" |
#include "content/child/thread_safe_sender.h" |
@@ -129,24 +130,30 @@ void ChildThread::Init() { |
IPC::Logging::GetInstance()->SetIPCSender(this); |
#endif |
- resource_dispatcher_.reset(new ResourceDispatcher(this)); |
- socket_stream_dispatcher_.reset(new SocketStreamDispatcher()); |
- file_system_dispatcher_.reset(new FileSystemDispatcher()); |
- quota_dispatcher_.reset(new QuotaDispatcher()); |
- |
sync_message_filter_ = |
new IPC::SyncMessageFilter(ChildProcess::current()->GetShutDownEvent()); |
thread_safe_sender_ = new ThreadSafeSender( |
base::MessageLoopProxy::current().get(), sync_message_filter_.get()); |
+ |
+ resource_dispatcher_.reset(new ResourceDispatcher(this)); |
+ socket_stream_dispatcher_.reset(new SocketStreamDispatcher()); |
+ file_system_dispatcher_.reset(new FileSystemDispatcher()); |
+ |
histogram_message_filter_ = new ChildHistogramMessageFilter(); |
resource_message_filter_ = |
new ChildResourceMessageFilter(resource_dispatcher()); |
+ quota_message_filter_ = |
+ new QuotaMessageFilter(thread_safe_sender_.get()); |
+ quota_dispatcher_.reset(new QuotaDispatcher(thread_safe_sender_.get(), |
+ quota_message_filter_.get())); |
+ |
channel_->AddFilter(histogram_message_filter_.get()); |
channel_->AddFilter(sync_message_filter_.get()); |
channel_->AddFilter(new tracing::ChildTraceMessageFilter( |
ChildProcess::current()->io_message_loop_proxy())); |
channel_->AddFilter(resource_message_filter_.get()); |
+ channel_->AddFilter(quota_message_filter_.get()); |
#if defined(OS_POSIX) |
// Check that --process-type is specified so we don't do this in unit tests |
@@ -192,6 +199,7 @@ ChildThread::~ChildThread() { |
IPC::Logging::GetInstance()->SetIPCSender(NULL); |
#endif |
+ channel_->RemoveFilter(quota_message_filter_.get()); |
channel_->RemoveFilter(histogram_message_filter_.get()); |
channel_->RemoveFilter(sync_message_filter_.get()); |
@@ -296,8 +304,6 @@ bool ChildThread::OnMessageReceived(const IPC::Message& msg) { |
return true; |
if (file_system_dispatcher_->OnMessageReceived(msg)) |
return true; |
- if (quota_dispatcher_->OnMessageReceived(msg)) |
- return true; |
bool handled = true; |
IPC_BEGIN_MESSAGE_MAP(ChildThread, msg) |