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

Unified Diff: content/child/child_thread.h

Issue 203073005: (NOT READY FOR REVIEW) Introduce MessagePortBypassFilter. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 9 months 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 | « no previous file | content/child/child_thread.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/child_thread.h
diff --git a/content/child/child_thread.h b/content/child/child_thread.h
index 233e9c8cf1a0e32133e15bc24d695293e6492ebd..4b32114cb1893bb826f5018448bfeabb53257c5a 100644
--- a/content/child/child_thread.h
+++ b/content/child/child_thread.h
@@ -15,6 +15,7 @@
#include "base/tracked_objects.h"
#include "content/common/content_export.h"
#include "content/common/message_router.h"
+#include "ipc/ipc_channel_proxy.h"
#include "ipc/ipc_message.h" // For IPC_MESSAGE_LOG_ENABLED.
#include "webkit/child/resource_loader_bridge.h"
@@ -49,6 +50,28 @@ class SocketStreamDispatcher;
class ThreadSafeSender;
class WebSocketDispatcher;
+class MessagePortBypassFilter : public IPC::ChannelProxy::MessageFilter {
+ public:
+ MessagePortBypassFilter(base::SingleThreadTaskRunner* ipc_task_runner);
+ virtual ~MessagePortBypassFilter();
+
+ // IPC::ChannelProxy::MessageFilter implementation.
+ virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
+ virtual bool GetSupportedMessageClasses(
+ std::vector<uint32>* supported_message_classes) const OVERRIDE;
+
+ void AddRoute(int32 routing_id, IPC::Listener* listener);
+ void RemoveRoute(int32 routing_id, const base::Closure& callback);
+
+ private:
+ void AddRouteOnIO(int32 routing_id, IPC::Listener* listener);
+ void RemoveRouteOnIO(int32 routing_id, const base::Closure& callback);
+
+ IDMap<IPC::Listener> routes_;
+ scoped_refptr<base::SingleThreadTaskRunner> ipc_task_runner_;
+ scoped_refptr<base::MessageLoopProxy> child_thread_loop_;
+};
+
// The main thread of a child process derives from this class.
class CONTENT_EXPORT ChildThread : public IPC::Listener, public IPC::Sender {
public:
@@ -119,6 +142,10 @@ class CONTENT_EXPORT ChildThread : public IPC::Listener, public IPC::Sender {
return sync_message_filter_.get();
}
+ MessagePortBypassFilter* message_port_bypass_filter() const {
+ return message_port_bypass_filter_.get();
+ }
+
// The getter should only be called on the main thread, however the
// IPC::Sender it returns may be safely called on any thread including
// the main thread.
@@ -232,6 +259,8 @@ class CONTENT_EXPORT ChildThread : public IPC::Listener, public IPC::Sender {
scoped_refptr<QuotaMessageFilter> quota_message_filter_;
+ scoped_refptr<MessagePortBypassFilter> message_port_bypass_filter_;
+
scoped_ptr<ChildSharedBitmapManager> shared_bitmap_manager_;
base::WeakPtrFactory<ChildThread> channel_connected_factory_;
« no previous file with comments | « no previous file | content/child/child_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698