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

Unified Diff: content/child/child_thread.h

Issue 198073003: Remove some content_child dependency from content_common (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: d4f3d343 Initial. 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') | content/child/child_thread.cc » ('J')
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 89156baadccba8ad9015047f605f00ecb59d62d7..ccba2dc6b7edda7e1a9b64ec73eb6ac45e70da27 100644
--- a/content/child/child_thread.h
+++ b/content/child/child_thread.h
@@ -66,12 +66,10 @@ class CONTENT_EXPORT ChildThread : public IPC::Listener, public IPC::Sender {
// IPC::Sender implementation:
virtual bool Send(IPC::Message* msg) OVERRIDE;
- // See documentation on MessageRouter for AddRoute and RemoveRoute
- void AddRoute(int32 routing_id, IPC::Listener* listener);
- void RemoveRoute(int32 routing_id);
-
IPC::SyncChannel* channel() { return channel_.get(); }
+ MessageRouter* GetRouter() { return &router_; }
+
// Creates a ResourceLoaderBridge.
// Tests can override this method if they want a custom loading behavior.
virtual webkit_glue::ResourceLoaderBridge* CreateBridge(
@@ -164,6 +162,16 @@ class CONTENT_EXPORT ChildThread : public IPC::Listener, public IPC::Sender {
virtual void OnChannelError() OVERRIDE;
private:
+ class ChildThreadMessageRouter : public MessageRouter {
+ public:
+ // |sender| must outlive this object.
+ explicit ChildThreadMessageRouter(IPC::Sender* sender) : sender_(sender) {}
+ virtual bool Send(IPC::Message* msg) OVERRIDE { return sender_->Send(msg); }
+
+ private:
+ IPC::Sender* const sender_;
+ };
+
void Init();
// IPC message handlers.
@@ -189,7 +197,7 @@ class CONTENT_EXPORT ChildThread : public IPC::Listener, public IPC::Sender {
scoped_refptr<ThreadSafeSender> thread_safe_sender_;
// Implements message routing functionality to the consumers of ChildThread.
- MessageRouter router_;
+ ChildThreadMessageRouter router_;
// Handles resource loads for this process.
scoped_ptr<ResourceDispatcher> resource_dispatcher_;
« no previous file with comments | « no previous file | content/child/child_thread.cc » ('j') | content/child/child_thread.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698