Upstream version 10.38.220.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / workers / WorkerThread.h
index 80a2bf5..082d437 100644 (file)
@@ -71,6 +71,9 @@ namespace blink {
         // (This is signalled on the main thread, so it's assumed to be waited on the worker context thread)
         blink::WebWaitableEvent* shutdownEvent() { return m_shutdownEvent.get(); }
 
+        blink::WebWaitableEvent* terminationEvent() { return m_terminationEvent.get(); }
+        static void terminateAndWaitForAllWorkers();
+
         bool isCurrentThread() const;
         WorkerLoaderProxy& workerLoaderProxy() const { return m_workerLoaderProxy; }
         WorkerReportingProxy& workerReportingProxy() const { return m_workerReportingProxy; }
@@ -107,6 +110,9 @@ namespace blink {
         friend class WorkerSharedTimer;
         friend class WorkerThreadShutdownFinishTask;
 
+        void stopInShutdownSequence();
+        void stopInternal();
+
         void initialize();
         void cleanup();
         void idleHandler();
@@ -132,6 +138,9 @@ namespace blink {
         // Used to signal thread shutdown.
         OwnPtr<blink::WebWaitableEvent> m_shutdownEvent;
 
+        // Used to signal thread termination.
+        OwnPtr<blink::WebWaitableEvent> m_terminationEvent;
+
         // FIXME: This has to be last because of crbug.com/401397 - the
         // WorkerThread might get deleted before it had a chance to properly
         // shut down. By deleting the WebThread first, we can guarantee that