OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 | 147 |
148 // Called for creating WorkerThreadLifecycleObserver on both the main thread | 148 // Called for creating WorkerThreadLifecycleObserver on both the main thread |
149 // and the worker thread. | 149 // and the worker thread. |
150 WorkerThreadLifecycleContext* getWorkerThreadLifecycleContext() const { | 150 WorkerThreadLifecycleContext* getWorkerThreadLifecycleContext() const { |
151 return m_workerThreadLifecycleContext; | 151 return m_workerThreadLifecycleContext; |
152 } | 152 } |
153 | 153 |
154 // Number of active worker threads. | 154 // Number of active worker threads. |
155 static unsigned workerThreadCount(); | 155 static unsigned workerThreadCount(); |
156 | 156 |
| 157 static void PostTaskToAllWorkerThreads(const WebTraceLocation&, |
| 158 std::unique_ptr<ExecutionContextTask>); |
| 159 |
157 PlatformThreadId platformThreadId(); | 160 PlatformThreadId platformThreadId(); |
158 | 161 |
159 bool isForciblyTerminated(); | 162 bool isForciblyTerminated(); |
160 | 163 |
161 void waitForShutdownForTesting() { m_shutdownEvent->wait(); } | 164 void waitForShutdownForTesting() { m_shutdownEvent->wait(); } |
162 | 165 |
163 protected: | 166 protected: |
164 WorkerThread(PassRefPtr<WorkerLoaderProxy>, WorkerReportingProxy&); | 167 WorkerThread(PassRefPtr<WorkerLoaderProxy>, WorkerReportingProxy&); |
165 | 168 |
166 // Factory method for creating a new worker context for the thread. | 169 // Factory method for creating a new worker context for the thread. |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 // Scheduled when termination starts with TerminationMode::Force, and | 289 // Scheduled when termination starts with TerminationMode::Force, and |
287 // cancelled when the worker thread is gracefully shut down. | 290 // cancelled when the worker thread is gracefully shut down. |
288 std::unique_ptr<ForceTerminationTask> m_scheduledForceTerminationTask; | 291 std::unique_ptr<ForceTerminationTask> m_scheduledForceTerminationTask; |
289 | 292 |
290 Persistent<WorkerThreadLifecycleContext> m_workerThreadLifecycleContext; | 293 Persistent<WorkerThreadLifecycleContext> m_workerThreadLifecycleContext; |
291 }; | 294 }; |
292 | 295 |
293 } // namespace blink | 296 } // namespace blink |
294 | 297 |
295 #endif // WorkerThread_h | 298 #endif // WorkerThread_h |
OLD | NEW |