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