| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_CHILD_CHILD_THREAD_H_ | 5 #ifndef CONTENT_CHILD_CHILD_THREAD_H_ |
| 6 #define CONTENT_CHILD_CHILD_THREAD_H_ | 6 #define CONTENT_CHILD_CHILD_THREAD_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/memory/shared_memory.h" | 10 #include "base/memory/shared_memory.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 | 30 |
| 31 namespace WebKit { | 31 namespace WebKit { |
| 32 class WebFrame; | 32 class WebFrame; |
| 33 } // namespace WebKit | 33 } // namespace WebKit |
| 34 | 34 |
| 35 namespace content { | 35 namespace content { |
| 36 class ChildHistogramMessageFilter; | 36 class ChildHistogramMessageFilter; |
| 37 class ChildResourceMessageFilter; | 37 class ChildResourceMessageFilter; |
| 38 class FileSystemDispatcher; | 38 class FileSystemDispatcher; |
| 39 class QuotaDispatcher; | 39 class QuotaDispatcher; |
| 40 class QuotaMessageFilter; |
| 40 class ResourceDispatcher; | 41 class ResourceDispatcher; |
| 41 class SocketStreamDispatcher; | 42 class SocketStreamDispatcher; |
| 42 class ThreadSafeSender; | 43 class ThreadSafeSender; |
| 43 | 44 |
| 44 // The main thread of a child process derives from this class. | 45 // The main thread of a child process derives from this class. |
| 45 class CONTENT_EXPORT ChildThread : public IPC::Listener, public IPC::Sender { | 46 class CONTENT_EXPORT ChildThread : public IPC::Listener, public IPC::Sender { |
| 46 public: | 47 public: |
| 47 // Creates the thread. | 48 // Creates the thread. |
| 48 ChildThread(); | 49 ChildThread(); |
| 49 // Used for single-process mode. | 50 // Used for single-process mode. |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 // IPC::Sender it returns may be safely called on any thread including | 106 // IPC::Sender it returns may be safely called on any thread including |
| 106 // the main thread. | 107 // the main thread. |
| 107 ThreadSafeSender* thread_safe_sender() const { | 108 ThreadSafeSender* thread_safe_sender() const { |
| 108 return thread_safe_sender_.get(); | 109 return thread_safe_sender_.get(); |
| 109 } | 110 } |
| 110 | 111 |
| 111 ChildHistogramMessageFilter* child_histogram_message_filter() const { | 112 ChildHistogramMessageFilter* child_histogram_message_filter() const { |
| 112 return histogram_message_filter_.get(); | 113 return histogram_message_filter_.get(); |
| 113 } | 114 } |
| 114 | 115 |
| 116 QuotaMessageFilter* quota_message_filter() const { |
| 117 return quota_message_filter_.get(); |
| 118 } |
| 119 |
| 115 base::MessageLoop* message_loop() const { return message_loop_; } | 120 base::MessageLoop* message_loop() const { return message_loop_; } |
| 116 | 121 |
| 117 // Returns the one child thread. Can only be called on the main thread. | 122 // Returns the one child thread. Can only be called on the main thread. |
| 118 static ChildThread* current(); | 123 static ChildThread* current(); |
| 119 | 124 |
| 120 #if defined(OS_ANDROID) | 125 #if defined(OS_ANDROID) |
| 121 // Called on Android's service thread to shutdown the main thread of this | 126 // Called on Android's service thread to shutdown the main thread of this |
| 122 // process. | 127 // process. |
| 123 static void ShutdownThread(); | 128 static void ShutdownThread(); |
| 124 #endif | 129 #endif |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 base::MessageLoop* message_loop_; | 186 base::MessageLoop* message_loop_; |
| 182 | 187 |
| 183 scoped_ptr<FileSystemDispatcher> file_system_dispatcher_; | 188 scoped_ptr<FileSystemDispatcher> file_system_dispatcher_; |
| 184 | 189 |
| 185 scoped_ptr<QuotaDispatcher> quota_dispatcher_; | 190 scoped_ptr<QuotaDispatcher> quota_dispatcher_; |
| 186 | 191 |
| 187 scoped_refptr<ChildHistogramMessageFilter> histogram_message_filter_; | 192 scoped_refptr<ChildHistogramMessageFilter> histogram_message_filter_; |
| 188 | 193 |
| 189 scoped_refptr<ChildResourceMessageFilter> resource_message_filter_; | 194 scoped_refptr<ChildResourceMessageFilter> resource_message_filter_; |
| 190 | 195 |
| 196 scoped_refptr<QuotaMessageFilter> quota_message_filter_; |
| 197 |
| 191 base::WeakPtrFactory<ChildThread> channel_connected_factory_; | 198 base::WeakPtrFactory<ChildThread> channel_connected_factory_; |
| 192 | 199 |
| 193 // Observes the trace event system. When tracing is enabled, optionally | 200 // Observes the trace event system. When tracing is enabled, optionally |
| 194 // starts profiling the tcmalloc heap. | 201 // starts profiling the tcmalloc heap. |
| 195 scoped_ptr<base::debug::TraceMemoryController> trace_memory_controller_; | 202 scoped_ptr<base::debug::TraceMemoryController> trace_memory_controller_; |
| 196 | 203 |
| 197 DISALLOW_COPY_AND_ASSIGN(ChildThread); | 204 DISALLOW_COPY_AND_ASSIGN(ChildThread); |
| 198 }; | 205 }; |
| 199 | 206 |
| 200 } // namespace content | 207 } // namespace content |
| 201 | 208 |
| 202 #endif // CONTENT_CHILD_CHILD_THREAD_H_ | 209 #endif // CONTENT_CHILD_CHILD_THREAD_H_ |
| OLD | NEW |