| 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 13 matching lines...) Expand all Loading... |
| 24 * | 24 * |
| 25 */ | 25 */ |
| 26 | 26 |
| 27 #ifndef WorkerThread_h | 27 #ifndef WorkerThread_h |
| 28 #define WorkerThread_h | 28 #define WorkerThread_h |
| 29 | 29 |
| 30 #include "core/dom/ExecutionContextTask.h" | 30 #include "core/dom/ExecutionContextTask.h" |
| 31 #include "core/frame/csp/ContentSecurityPolicy.h" | 31 #include "core/frame/csp/ContentSecurityPolicy.h" |
| 32 #include "core/workers/WorkerGlobalScope.h" | 32 #include "core/workers/WorkerGlobalScope.h" |
| 33 #include "platform/SharedTimer.h" | 33 #include "platform/SharedTimer.h" |
| 34 #include "platform/heap/glue/MessageLoopInterruptor.h" | 34 #include "platform/WebThreadSupportingGC.h" |
| 35 #include "platform/heap/glue/PendingGCRunner.h" | |
| 36 #include "platform/weborigin/SecurityOrigin.h" | 35 #include "platform/weborigin/SecurityOrigin.h" |
| 37 #include "public/platform/WebThread.h" | |
| 38 #include "wtf/Forward.h" | 36 #include "wtf/Forward.h" |
| 39 #include "wtf/MessageQueue.h" | 37 #include "wtf/MessageQueue.h" |
| 40 #include "wtf/OwnPtr.h" | 38 #include "wtf/OwnPtr.h" |
| 41 #include "wtf/PassRefPtr.h" | 39 #include "wtf/PassRefPtr.h" |
| 42 #include "wtf/RefCounted.h" | 40 #include "wtf/RefCounted.h" |
| 43 | 41 |
| 44 namespace blink { | 42 namespace blink { |
| 45 class WebWaitableEvent; | 43 class WebWaitableEvent; |
| 46 } | 44 } |
| 47 | 45 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 friend class WorkerThreadShutdownFinishTask; | 106 friend class WorkerThreadShutdownFinishTask; |
| 109 | 107 |
| 110 void initialize(); | 108 void initialize(); |
| 111 void cleanup(); | 109 void cleanup(); |
| 112 void idleHandler(); | 110 void idleHandler(); |
| 113 void postDelayedTask(PassOwnPtr<ExecutionContextTask>, long long delayMs
); | 111 void postDelayedTask(PassOwnPtr<ExecutionContextTask>, long long delayMs
); |
| 114 | 112 |
| 115 bool m_terminated; | 113 bool m_terminated; |
| 116 OwnPtr<WorkerSharedTimer> m_sharedTimer; | 114 OwnPtr<WorkerSharedTimer> m_sharedTimer; |
| 117 MessageQueue<WorkerThreadTask> m_debuggerMessageQueue; | 115 MessageQueue<WorkerThreadTask> m_debuggerMessageQueue; |
| 118 OwnPtr<PendingGCRunner> m_pendingGCRunner; | |
| 119 OwnPtr<WebThread::TaskObserver> m_microtaskRunner; | 116 OwnPtr<WebThread::TaskObserver> m_microtaskRunner; |
| 120 OwnPtr<MessageLoopInterruptor> m_messageLoopInterruptor; | |
| 121 | 117 |
| 122 WorkerLoaderProxy& m_workerLoaderProxy; | 118 WorkerLoaderProxy& m_workerLoaderProxy; |
| 123 WorkerReportingProxy& m_workerReportingProxy; | 119 WorkerReportingProxy& m_workerReportingProxy; |
| 124 | 120 |
| 125 RefPtrWillBePersistent<WorkerInspectorController> m_workerInspectorContr
oller; | 121 RefPtrWillBePersistent<WorkerInspectorController> m_workerInspectorContr
oller; |
| 126 Mutex m_workerInspectorControllerMutex; | 122 Mutex m_workerInspectorControllerMutex; |
| 127 | 123 |
| 128 Mutex m_threadCreationMutex; | 124 Mutex m_threadCreationMutex; |
| 129 RefPtrWillBePersistent<WorkerGlobalScope> m_workerGlobalScope; | 125 RefPtrWillBePersistent<WorkerGlobalScope> m_workerGlobalScope; |
| 130 OwnPtrWillBePersistent<WorkerThreadStartupData> m_startupData; | 126 OwnPtrWillBePersistent<WorkerThreadStartupData> m_startupData; |
| 131 | 127 |
| 132 // Used to signal thread shutdown. | 128 // Used to signal thread shutdown. |
| 133 OwnPtr<blink::WebWaitableEvent> m_shutdownEvent; | 129 OwnPtr<blink::WebWaitableEvent> m_shutdownEvent; |
| 134 | 130 |
| 135 // FIXME: This has to be last because of crbug.com/401397 - the | 131 // FIXME: This has to be last because of crbug.com/401397. |
| 136 // WorkerThread might get deleted before it had a chance to properly | 132 // A WorkerThread might get deleted before it had a chance to properly |
| 137 // shut down. By deleting the WebThread first, we can guarantee that | 133 // shut down. By deleting the WebThread first, we can guarantee that |
| 138 // no pending tasks on the thread might want to access any of the other | 134 // no pending tasks on the thread might want to access any of the other |
| 139 // members during the WorkerThread's destruction. | 135 // members during the WorkerThread's destruction. |
| 140 OwnPtr<blink::WebThread> m_thread; | 136 OwnPtr<WebThreadSupportingGC> m_thread; |
| 141 }; | 137 }; |
| 142 | 138 |
| 143 } // namespace blink | 139 } // namespace blink |
| 144 | 140 |
| 145 #endif // WorkerThread_h | 141 #endif // WorkerThread_h |
| OLD | NEW |