| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 class ResourceDispatcher; | 42 class ResourceDispatcher; |
| 43 class SocketStreamDispatcher; | 43 class SocketStreamDispatcher; |
| 44 class ThreadSafeSender; | 44 class ThreadSafeSender; |
| 45 class WebSocketDispatcher; | 45 class WebSocketDispatcher; |
| 46 | 46 |
| 47 // The main thread of a child process derives from this class. | 47 // The main thread of a child process derives from this class. |
| 48 class CONTENT_EXPORT ChildThread : public IPC::Listener, public IPC::Sender { | 48 class CONTENT_EXPORT ChildThread : public IPC::Listener, public IPC::Sender { |
| 49 public: | 49 public: |
| 50 // Creates the thread. | 50 // Creates the thread. |
| 51 ChildThread(); | 51 ChildThread(); |
| 52 // Used for single-process mode. | 52 // Used for single-process mode and for in process gpu mode. |
| 53 explicit ChildThread(const std::string& channel_name); | 53 explicit ChildThread(const std::string& channel_name); |
| 54 // ChildProcess::main_thread() is reset after Shutdown(), and before the | 54 // ChildProcess::main_thread() is reset after Shutdown(), and before the |
| 55 // destructor, so any subsystem that relies on ChildProcess::main_thread() | 55 // destructor, so any subsystem that relies on ChildProcess::main_thread() |
| 56 // must be terminated before Shutdown returns. In particular, if a subsystem | 56 // must be terminated before Shutdown returns. In particular, if a subsystem |
| 57 // has a thread that post tasks to ChildProcess::main_thread(), that thread | 57 // has a thread that post tasks to ChildProcess::main_thread(), that thread |
| 58 // should be joined in Shutdown(). | 58 // should be joined in Shutdown(). |
| 59 virtual ~ChildThread(); | 59 virtual ~ChildThread(); |
| 60 virtual void Shutdown(); | 60 virtual void Shutdown(); |
| 61 | 61 |
| 62 // IPC::Sender implementation: | 62 // IPC::Sender implementation: |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 scoped_refptr<QuotaMessageFilter> quota_message_filter_; | 204 scoped_refptr<QuotaMessageFilter> quota_message_filter_; |
| 205 | 205 |
| 206 base::WeakPtrFactory<ChildThread> channel_connected_factory_; | 206 base::WeakPtrFactory<ChildThread> channel_connected_factory_; |
| 207 | 207 |
| 208 // Observes the trace event system. When tracing is enabled, optionally | 208 // Observes the trace event system. When tracing is enabled, optionally |
| 209 // starts profiling the tcmalloc heap. | 209 // starts profiling the tcmalloc heap. |
| 210 scoped_ptr<base::debug::TraceMemoryController> trace_memory_controller_; | 210 scoped_ptr<base::debug::TraceMemoryController> trace_memory_controller_; |
| 211 | 211 |
| 212 scoped_ptr<base::PowerMonitor> power_monitor_; | 212 scoped_ptr<base::PowerMonitor> power_monitor_; |
| 213 | 213 |
| 214 bool in_browser_process_; |
| 215 |
| 214 DISALLOW_COPY_AND_ASSIGN(ChildThread); | 216 DISALLOW_COPY_AND_ASSIGN(ChildThread); |
| 215 }; | 217 }; |
| 216 | 218 |
| 217 } // namespace content | 219 } // namespace content |
| 218 | 220 |
| 219 #endif // CONTENT_CHILD_CHILD_THREAD_H_ | 221 #endif // CONTENT_CHILD_CHILD_THREAD_H_ |
| OLD | NEW |