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

Unified Diff: content/child/quota_message_filter.h

Issue 63843002: Add ChildMessageFilter, a base class for renderer/worker cross-thread MessageFilter (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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
Index: content/child/quota_message_filter.h
diff --git a/content/child/quota_message_filter.h b/content/child/quota_message_filter.h
index eba63137dfe451b038281ae31f87d8008a9c7e95..dccadd5fd2068d8a0fecdb02af950612b4e6d2de 100644
--- a/content/child/quota_message_filter.h
+++ b/content/child/quota_message_filter.h
@@ -8,23 +8,16 @@
#include <map>
#include "base/synchronization/lock.h"
-#include "ipc/ipc_channel_proxy.h"
-
-namespace base {
-class MessageLoopProxy;
-}
+#include "content/child/cross_thread_message_filter.h"
namespace content {
class ThreadSafeSender;
-class QuotaMessageFilter : public IPC::ChannelProxy::MessageFilter {
+class QuotaMessageFilter : public CrossThreadMessageFilter {
public:
explicit QuotaMessageFilter(ThreadSafeSender* thread_safe_sender);
- // IPC::Listener implementation.
- virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE;
-
// Generates a new request_id, registers { request_id, thread_id } map to
// the message filter and returns the request_id.
// This method can be called on any thread.
@@ -37,11 +30,13 @@ class QuotaMessageFilter : public IPC::ChannelProxy::MessageFilter {
virtual ~QuotaMessageFilter();
private:
- typedef std::map<int, int> RequestIdToThreadId;
+ // CrossThreadMessageFilter implementation:
+ virtual bool OverrideThreadIDForMessage(const IPC::Message& msg,
+ int* thread_id) OVERRIDE;
+ virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE;
- void DispatchMessage(const IPC::Message& msg);
+ typedef std::map<int, int> RequestIdToThreadId;
- scoped_refptr<base::MessageLoopProxy> main_thread_loop_proxy_;
scoped_refptr<ThreadSafeSender> thread_safe_sender_;
base::Lock request_id_map_lock_;

Powered by Google App Engine
This is Rietveld 408576698