Index: Source/core/workers/Worker.cpp |
diff --git a/Source/core/workers/Worker.cpp b/Source/core/workers/Worker.cpp |
index e5c76ceee5e97e9c068fbeca9e1892668cac78d6..12442f1fa2c245a67a0163976b45d03a59cd376c 100644 |
--- a/Source/core/workers/Worker.cpp |
+++ b/Source/core/workers/Worker.cpp |
@@ -50,7 +50,7 @@ inline Worker::Worker(ExecutionContext* context) |
ScriptWrappable::init(this); |
} |
-PassRefPtr<Worker> Worker::create(ExecutionContext* context, const String& url, ExceptionState& exceptionState) |
+PassRefPtrWillBeRawPtr<Worker> Worker::create(ExecutionContext* context, const String& url, ExceptionState& exceptionState) |
{ |
ASSERT(isMainThread()); |
Document* document = toDocument(context); |
@@ -62,7 +62,7 @@ PassRefPtr<Worker> Worker::create(ExecutionContext* context, const String& url, |
WorkerGlobalScopeProxyProvider* proxyProvider = WorkerGlobalScopeProxyProvider::from(*document->page()); |
ASSERT(proxyProvider); |
- RefPtr<Worker> worker = adoptRef(new Worker(context)); |
+ RefPtrWillBeRawPtr<Worker> worker = adoptRefWillBeRefCountedGarbageCollected(new Worker(context)); |
worker->suspendIfNeeded(); |
@@ -103,7 +103,8 @@ void Worker::postMessage(PassRefPtr<SerializedScriptValue> message, const Messag |
void Worker::terminate() |
{ |
- m_contextProxy->terminateWorkerGlobalScope(); |
+ if (m_contextProxy) |
+ m_contextProxy->terminateWorkerGlobalScope(); |
} |
void Worker::stop() |
@@ -137,4 +138,9 @@ void Worker::notifyFinished() |
unsetPendingActivity(this); |
} |
+void Worker::trace(Visitor* visitor) |
+{ |
+ AbstractWorker::trace(visitor); |
+} |
+ |
} // namespace WebCore |