Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1493)

Unified Diff: Source/platform/WebThreadSupportingGC.h

Issue 474683003: Not for review - Rebase of crrev.com/62833003 Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: . Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/platform/WebThreadRawPtr.h ('k') | Source/platform/WebThreadSupportingGC.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/WebThreadSupportingGC.h
diff --git a/Source/platform/WebThreadSupportingGC.h b/Source/platform/WebThreadSupportingGC.h
index 3c58d6de9aaab31763879d2a9acf7aa7586c6f03..e4af14eb05f075caa5632d79257b78fb106ee64a 100644
--- a/Source/platform/WebThreadSupportingGC.h
+++ b/Source/platform/WebThreadSupportingGC.h
@@ -12,6 +12,7 @@
#include "wtf/Noncopyable.h"
#include "wtf/OwnPtr.h"
#include "wtf/PassOwnPtr.h"
+#include "WebThreadOwnPtr.h"
namespace blink {
@@ -21,54 +22,54 @@ 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 {
+class PLATFORM_EXPORT WebThreadSupportingGC {
WTF_MAKE_NONCOPYABLE(WebThreadSupportingGC);
public:
static PassOwnPtr<WebThreadSupportingGC> create(const char*);
- ~WebThreadSupportingGC();
+ virtual ~WebThreadSupportingGC();
void postTask(WebThread::Task* task)
{
- m_thread->postTask(task);
+ (*m_thread)->postTask(task);
}
void postDelayedTask(WebThread::Task* task, long long delayMs)
{
- m_thread->postDelayedTask(task, delayMs);
+ (*m_thread)->postDelayedTask(task, delayMs);
}
bool isCurrentThread() const
{
- return m_thread->isCurrentThread();
+ return (*m_thread)->isCurrentThread();
}
void addTaskObserver(WebThread::TaskObserver* observer)
{
- m_thread->addTaskObserver(observer);
+ (*m_thread)->addTaskObserver(observer);
}
void removeTaskObserver(WebThread::TaskObserver* observer)
{
- m_thread->removeTaskObserver(observer);
+ (*m_thread)->removeTaskObserver(observer);
}
void enterRunLoop()
{
- m_thread->enterRunLoop();
+ (*m_thread)->enterRunLoop();
}
void exitRunLoop()
{
- m_thread->exitRunLoop();
+ (*m_thread)->exitRunLoop();
}
- void attachGC();
- void detachGC();
+ virtual void attachGC();
+ virtual void detachGC();
WebThread& platformThread() const
{
- ASSERT(m_thread);
- return *m_thread;
+ // ASSERT(*(m_thread));
+ return *(*m_thread);
}
private:
@@ -77,12 +78,14 @@ private:
OwnPtr<PendingGCRunner> m_pendingGCRunner;
OwnPtr<MessageLoopInterruptor> m_messageLoopInterruptor;
+protected:
+ WebThreadSupportingGC() {}
// 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;
+ WebThreadPtr *m_thread;
};
}
« no previous file with comments | « Source/platform/WebThreadRawPtr.h ('k') | Source/platform/WebThreadSupportingGC.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698