| Index: Source/platform/WebThreadSupportingGC.h
|
| diff --git a/Source/platform/WebThreadSupportingGC.h b/Source/platform/WebThreadSupportingGC.h
|
| index 3c58d6de9aaab31763879d2a9acf7aa7586c6f03..495c083631c5003b51affedf08ce0ee8f2ef8610 100644
|
| --- a/Source/platform/WebThreadSupportingGC.h
|
| +++ b/Source/platform/WebThreadSupportingGC.h
|
| @@ -21,68 +21,45 @@ namespace blink {
|
| // thread allocates any objects managed by the Blink GC. The detach GC
|
| // method must be called on the WebThread during shutdown when the thread
|
| // no longer needs to access objects managed by the Blink GC.
|
| -class PLATFORM_EXPORT WebThreadSupportingGC final {
|
| - WTF_MAKE_NONCOPYABLE(WebThreadSupportingGC);
|
| +class PLATFORM_EXPORT WebThreadSupportingGC {
|
| public:
|
| static PassOwnPtr<WebThreadSupportingGC> create(const char*);
|
| - ~WebThreadSupportingGC();
|
| +
|
| + virtual ~WebThreadSupportingGC();
|
|
|
| void postTask(WebThread::Task* task)
|
| {
|
| - m_thread->postTask(task);
|
| + platformThread().postTask(task);
|
| }
|
|
|
| void postDelayedTask(WebThread::Task* task, long long delayMs)
|
| {
|
| - m_thread->postDelayedTask(task, delayMs);
|
| + platformThread().postDelayedTask(task, delayMs);
|
| }
|
|
|
| bool isCurrentThread() const
|
| {
|
| - return m_thread->isCurrentThread();
|
| + return platformThread().isCurrentThread();
|
| }
|
|
|
| void addTaskObserver(WebThread::TaskObserver* observer)
|
| {
|
| - m_thread->addTaskObserver(observer);
|
| + platformThread().addTaskObserver(observer);
|
| }
|
|
|
| void removeTaskObserver(WebThread::TaskObserver* observer)
|
| {
|
| - m_thread->removeTaskObserver(observer);
|
| - }
|
| -
|
| - void enterRunLoop()
|
| - {
|
| - m_thread->enterRunLoop();
|
| - }
|
| -
|
| - void exitRunLoop()
|
| - {
|
| - m_thread->exitRunLoop();
|
| + platformThread().removeTaskObserver(observer);
|
| }
|
|
|
| void attachGC();
|
| void detachGC();
|
|
|
| - WebThread& platformThread() const
|
| - {
|
| - ASSERT(m_thread);
|
| - return *m_thread;
|
| - }
|
| + virtual WebThread& platformThread() const = 0;
|
|
|
| private:
|
| - explicit WebThreadSupportingGC(const char*);
|
| -
|
| OwnPtr<PendingGCRunner> m_pendingGCRunner;
|
| OwnPtr<MessageLoopInterruptor> m_messageLoopInterruptor;
|
| -
|
| - // FIXME: This has to be last because of crbug.com/401397.
|
| - // A WorkerThread might get deleted before it had a chance to properly
|
| - // shut down. By deleting the WebThread first, we can guarantee that
|
| - // no pending tasks on the thread might want to access any of the other
|
| - // members during the WorkerThread's destruction.
|
| - OwnPtr<WebThread> m_thread;
|
| };
|
|
|
| }
|
|
|