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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 // use this mode, because after the synchronous termination any V8 APIs | 150 // use this mode, because after the synchronous termination any V8 APIs |
151 // may suddenly start to return empty handles and it may cause crashes. | 151 // may suddenly start to return empty handles and it may cause crashes. |
152 Forcible, | 152 Forcible, |
153 | 153 |
154 // Don't synchronously terminate the worker execution. Instead, schedule | 154 // Don't synchronously terminate the worker execution. Instead, schedule |
155 // a task to terminate it in case that the shutdown sequence does not | 155 // a task to terminate it in case that the shutdown sequence does not |
156 // start on the worker thread in a certain time period. | 156 // start on the worker thread in a certain time period. |
157 Graceful, | 157 Graceful, |
158 }; | 158 }; |
159 | 159 |
160 std::unique_ptr<CrossThreadClosure> createWorkerThreadTask(std::unique_ptr<E
xecutionContextTask>, bool isInstrumented); | |
161 | |
162 void terminateInternal(TerminationMode); | 160 void terminateInternal(TerminationMode); |
163 void forciblyTerminateExecution(); | 161 void forciblyTerminateExecution(); |
164 | 162 |
165 void initializeOnWorkerThread(PassOwnPtr<WorkerThreadStartupData>); | 163 void initializeOnWorkerThread(PassOwnPtr<WorkerThreadStartupData>); |
166 void prepareForShutdownOnWorkerThread(); | 164 void prepareForShutdownOnWorkerThread(); |
167 void performShutdownOnWorkerThread(); | 165 void performShutdownOnWorkerThread(); |
168 void performTaskOnWorkerThread(std::unique_ptr<ExecutionContextTask>, bool i
sInstrumented); | 166 void performTaskOnWorkerThread(std::unique_ptr<ExecutionContextTask>, bool i
sInstrumented); |
169 void performDebuggerTaskOnWorkerThread(std::unique_ptr<CrossThreadClosure>); | 167 void performDebuggerTaskOnWorkerThread(std::unique_ptr<CrossThreadClosure>); |
170 void performDebuggerTaskDontWaitOnWorkerThread(); | 168 void performDebuggerTaskDontWaitOnWorkerThread(); |
171 | 169 |
(...skipping 28 matching lines...) Expand all Loading... |
200 OwnPtr<WaitableEvent> m_shutdownEvent; | 198 OwnPtr<WaitableEvent> m_shutdownEvent; |
201 | 199 |
202 // Scheduled when termination starts with TerminationMode::Force, and | 200 // Scheduled when termination starts with TerminationMode::Force, and |
203 // cancelled when the worker thread is gracefully shut down. | 201 // cancelled when the worker thread is gracefully shut down. |
204 OwnPtr<ForceTerminationTask> m_scheduledForceTerminationTask; | 202 OwnPtr<ForceTerminationTask> m_scheduledForceTerminationTask; |
205 }; | 203 }; |
206 | 204 |
207 } // namespace blink | 205 } // namespace blink |
208 | 206 |
209 #endif // WorkerThread_h | 207 #endif // WorkerThread_h |
OLD | NEW |