OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_COMMON_CHILD_THREAD_H_ | 5 #ifndef CONTENT_COMMON_CHILD_THREAD_H_ |
6 #define CONTENT_COMMON_CHILD_THREAD_H_ | 6 #define CONTENT_COMMON_CHILD_THREAD_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 class CONTENT_EXPORT ChildThread : public IPC::Channel::Listener, | 28 class CONTENT_EXPORT ChildThread : public IPC::Channel::Listener, |
29 public IPC::Message::Sender { | 29 public IPC::Message::Sender { |
30 public: | 30 public: |
31 // Creates the thread. | 31 // Creates the thread. |
32 ChildThread(); | 32 ChildThread(); |
33 // Used for single-process mode. | 33 // Used for single-process mode. |
34 explicit ChildThread(const std::string& channel_name); | 34 explicit ChildThread(const std::string& channel_name); |
35 virtual ~ChildThread(); | 35 virtual ~ChildThread(); |
36 | 36 |
37 // IPC::Message::Sender implementation: | 37 // IPC::Message::Sender implementation: |
38 virtual bool Send(IPC::Message* msg); | 38 virtual bool Send(IPC::Message* msg) OVERRIDE; |
39 | 39 |
40 // See documentation on MessageRouter for AddRoute and RemoveRoute | 40 // See documentation on MessageRouter for AddRoute and RemoveRoute |
41 void AddRoute(int32 routing_id, IPC::Channel::Listener* listener); | 41 void AddRoute(int32 routing_id, IPC::Channel::Listener* listener); |
42 void RemoveRoute(int32 routing_id); | 42 void RemoveRoute(int32 routing_id); |
43 | 43 |
44 IPC::Channel::Listener* ResolveRoute(int32 routing_id); | 44 IPC::Channel::Listener* ResolveRoute(int32 routing_id); |
45 | 45 |
46 IPC::SyncChannel* channel() { return channel_.get(); } | 46 IPC::SyncChannel* channel() { return channel_.get(); } |
47 | 47 |
48 // Creates a ResourceLoaderBridge. | 48 // Creates a ResourceLoaderBridge. |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 virtual void OnDumpHandles(); | 96 virtual void OnDumpHandles(); |
97 | 97 |
98 void set_on_channel_error_called(bool on_channel_error_called) { | 98 void set_on_channel_error_called(bool on_channel_error_called) { |
99 on_channel_error_called_ = on_channel_error_called; | 99 on_channel_error_called_ = on_channel_error_called; |
100 } | 100 } |
101 | 101 |
102 private: | 102 private: |
103 void Init(); | 103 void Init(); |
104 | 104 |
105 // IPC::Channel::Listener implementation: | 105 // IPC::Channel::Listener implementation: |
106 virtual bool OnMessageReceived(const IPC::Message& msg); | 106 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; |
107 virtual void OnChannelError(); | 107 virtual void OnChannelError() OVERRIDE; |
108 | 108 |
109 std::string channel_name_; | 109 std::string channel_name_; |
110 scoped_ptr<IPC::SyncChannel> channel_; | 110 scoped_ptr<IPC::SyncChannel> channel_; |
111 | 111 |
112 // Allows threads other than the main thread to send sync messages. | 112 // Allows threads other than the main thread to send sync messages. |
113 scoped_refptr<IPC::SyncMessageFilter> sync_message_filter_; | 113 scoped_refptr<IPC::SyncMessageFilter> sync_message_filter_; |
114 | 114 |
115 // Implements message routing functionality to the consumers of ChildThread. | 115 // Implements message routing functionality to the consumers of ChildThread. |
116 MessageRouter router_; | 116 MessageRouter router_; |
117 | 117 |
(...skipping 15 matching lines...) Expand all Loading... |
133 MessageLoop* message_loop_; | 133 MessageLoop* message_loop_; |
134 | 134 |
135 scoped_ptr<FileSystemDispatcher> file_system_dispatcher_; | 135 scoped_ptr<FileSystemDispatcher> file_system_dispatcher_; |
136 | 136 |
137 scoped_ptr<QuotaDispatcher> quota_dispatcher_; | 137 scoped_ptr<QuotaDispatcher> quota_dispatcher_; |
138 | 138 |
139 DISALLOW_COPY_AND_ASSIGN(ChildThread); | 139 DISALLOW_COPY_AND_ASSIGN(ChildThread); |
140 }; | 140 }; |
141 | 141 |
142 #endif // CONTENT_COMMON_CHILD_THREAD_H_ | 142 #endif // CONTENT_COMMON_CHILD_THREAD_H_ |
OLD | NEW |