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_IMPL_H_ | 5 #ifndef CONTENT_CHILD_CHILD_THREAD_IMPL_H_ |
6 #define CONTENT_CHILD_CHILD_THREAD_IMPL_H_ | 6 #define CONTENT_CHILD_CHILD_THREAD_IMPL_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 // Allow to be used for single-process mode and for in process gpu mode via | 75 // Allow to be used for single-process mode and for in process gpu mode via |
76 // options. | 76 // options. |
77 explicit ChildThreadImpl(const Options& options); | 77 explicit ChildThreadImpl(const Options& options); |
78 // ChildProcess::main_thread() is reset after Shutdown(), and before the | 78 // ChildProcess::main_thread() is reset after Shutdown(), and before the |
79 // destructor, so any subsystem that relies on ChildProcess::main_thread() | 79 // destructor, so any subsystem that relies on ChildProcess::main_thread() |
80 // must be terminated before Shutdown returns. In particular, if a subsystem | 80 // must be terminated before Shutdown returns. In particular, if a subsystem |
81 // has a thread that post tasks to ChildProcess::main_thread(), that thread | 81 // has a thread that post tasks to ChildProcess::main_thread(), that thread |
82 // should be joined in Shutdown(). | 82 // should be joined in Shutdown(). |
83 ~ChildThreadImpl() override; | 83 ~ChildThreadImpl() override; |
84 virtual void Shutdown(); | 84 virtual void Shutdown(); |
| 85 // Returns true if the thread should be destroyed. |
| 86 virtual bool ShouldBeDestroyed(); |
85 | 87 |
86 // IPC::Sender implementation: | 88 // IPC::Sender implementation: |
87 bool Send(IPC::Message* msg) override; | 89 bool Send(IPC::Message* msg) override; |
88 | 90 |
89 // ChildThread implementation: | 91 // ChildThread implementation: |
90 #if defined(OS_WIN) | 92 #if defined(OS_WIN) |
91 void PreCacheFont(const LOGFONT& log_font) override; | 93 void PreCacheFont(const LOGFONT& log_font) override; |
92 void ReleaseCachedFonts() override; | 94 void ReleaseCachedFonts() override; |
93 #endif | 95 #endif |
94 void RecordAction(const base::UserMetricsAction& action) override; | 96 void RecordAction(const base::UserMetricsAction& action) override; |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 | 344 |
343 private: | 345 private: |
344 struct Options options_; | 346 struct Options options_; |
345 | 347 |
346 DISALLOW_COPY_AND_ASSIGN(Builder); | 348 DISALLOW_COPY_AND_ASSIGN(Builder); |
347 }; | 349 }; |
348 | 350 |
349 } // namespace content | 351 } // namespace content |
350 | 352 |
351 #endif // CONTENT_CHILD_CHILD_THREAD_IMPL_H_ | 353 #endif // CONTENT_CHILD_CHILD_THREAD_IMPL_H_ |
OLD | NEW |