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_PROCESS_H_ | 5 #ifndef CONTENT_CHILD_CHILD_PROCESS_H_ |
6 #define CONTENT_CHILD_CHILD_PROCESS_H_ | 6 #define CONTENT_CHILD_CHILD_PROCESS_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 #if defined(OS_LINUX) | 72 #if defined(OS_LINUX) |
73 void SetIOThreadPriority(base::ThreadPriority io_thread_priority); | 73 void SetIOThreadPriority(base::ThreadPriority io_thread_priority); |
74 #endif | 74 #endif |
75 | 75 |
76 // Getter for the one ChildProcess object for this process. Can only be called | 76 // Getter for the one ChildProcess object for this process. Can only be called |
77 // on the main thread. | 77 // on the main thread. |
78 static ChildProcess* current(); | 78 static ChildProcess* current(); |
79 | 79 |
80 static void WaitForDebugger(const std::string& label); | 80 static void WaitForDebugger(const std::string& label); |
81 private: | 81 private: |
| 82 // Initializes TaskScheduler. May be overridden to initialize TaskScheduler |
| 83 // with custom arguments. |
| 84 virtual void InitializeTaskScheduler(); |
| 85 |
82 int ref_count_; | 86 int ref_count_; |
83 | 87 |
84 // An event that will be signalled when we shutdown. | 88 // An event that will be signalled when we shutdown. |
85 base::WaitableEvent shutdown_event_; | 89 base::WaitableEvent shutdown_event_; |
86 | 90 |
87 // The thread that handles IO events. | 91 // The thread that handles IO events. |
88 base::Thread io_thread_; | 92 base::Thread io_thread_; |
89 | 93 |
90 // NOTE: make sure that main_thread_ is listed after shutdown_event_, since | 94 // NOTE: make sure that main_thread_ is listed after shutdown_event_, since |
91 // it depends on it (indirectly through IPC::SyncChannel). Same for | 95 // it depends on it (indirectly through IPC::SyncChannel). Same for |
92 // io_thread_. | 96 // io_thread_. |
93 std::unique_ptr<ChildThreadImpl> main_thread_; | 97 std::unique_ptr<ChildThreadImpl> main_thread_; |
94 | 98 |
| 99 // Whether this ChildProcess initialized TaskScheduler. |
| 100 bool initialized_task_scheduler_ = false; |
| 101 |
95 DISALLOW_COPY_AND_ASSIGN(ChildProcess); | 102 DISALLOW_COPY_AND_ASSIGN(ChildProcess); |
96 }; | 103 }; |
97 | 104 |
98 } // namespace content | 105 } // namespace content |
99 | 106 |
100 #endif // CONTENT_CHILD_CHILD_PROCESS_H_ | 107 #endif // CONTENT_CHILD_CHILD_PROCESS_H_ |
OLD | NEW |