Unreviewed, rolling out r157061.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 Oct 2013 01:34:15 +0000 (01:34 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 Oct 2013 01:34:15 +0000 (01:34 +0000)
http://trac.webkit.org/changeset/157061
https://bugs.webkit.org/show_bug.cgi?id=122479

Broke worker tests (Requested by andersca on #webkit).

* Modules/webdatabase/Database.cpp:
(WebCore::DerefContextTask::create):
(WebCore::DerefContextTask::DerefContextTask):
(WebCore::Database::~Database):
(WebCore::DeliverPendingCallbackTask::create):
(WebCore::DeliverPendingCallbackTask::performTask):
(WebCore::DeliverPendingCallbackTask::DeliverPendingCallbackTask):
(WebCore::Database::scheduleTransactionCallback):
* Modules/webdatabase/DatabaseManager.cpp:
(WebCore::DatabaseCreationCallbackTask::create):
(WebCore::DatabaseCreationCallbackTask::performTask):
(WebCore::DatabaseCreationCallbackTask::DatabaseCreationCallbackTask):
(WebCore::DatabaseManager::openDatabase):
* Modules/webdatabase/SQLCallbackWrapper.h:
(WebCore::SQLCallbackWrapper::clear):
(WebCore::SQLCallbackWrapper::SafeReleaseTask::create):
(WebCore::SQLCallbackWrapper::SafeReleaseTask::performTask):
(WebCore::SQLCallbackWrapper::SafeReleaseTask::isCleanupTask):
(WebCore::SQLCallbackWrapper::SafeReleaseTask::SafeReleaseTask):
* Modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp:
(WebCore::ThreadableWebSocketChannelClientWrapper::processPendingTasks):
* Modules/websockets/ThreadableWebSocketChannelClientWrapper.h:
* Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
(WebCore::WorkerThreadableWebSocketChannel::WorkerGlobalScopeDidInitializeTask::create):
(WebCore::WorkerThreadableWebSocketChannel::WorkerGlobalScopeDidInitializeTask::~WorkerGlobalScopeDidInitializeTask):
(WebCore::WorkerThreadableWebSocketChannel::WorkerGlobalScopeDidInitializeTask::WorkerGlobalScopeDidInitializeTask):
(WebCore::WorkerThreadableWebSocketChannel::Bridge::mainThreadInitialize):
* bindings/js/JSCallbackData.h:
(WebCore::DeleteCallbackDataTask::create):
(WebCore::DeleteCallbackDataTask::performTask):
(WebCore::DeleteCallbackDataTask::isCleanupTask):
(WebCore::DeleteCallbackDataTask::DeleteCallbackDataTask):
* bindings/js/JSDOMGlobalObjectTask.h:
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::queueTaskToEventLoop):
* bindings/js/JSWorkerGlobalScopeBase.cpp:
(WebCore::JSWorkerGlobalScopeBase::queueTaskToEventLoop):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateCallbackImplementation):
* dom/CrossThreadTask.h:
(WebCore::CrossThreadTask1::create):
(WebCore::CrossThreadTask1::performTask):
(WebCore::CrossThreadTask2::create):
(WebCore::CrossThreadTask2::performTask):
(WebCore::CrossThreadTask3::create):
(WebCore::CrossThreadTask3::performTask):
(WebCore::CrossThreadTask4::create):
(WebCore::CrossThreadTask4::performTask):
(WebCore::CrossThreadTask5::create):
(WebCore::CrossThreadTask5::performTask):
(WebCore::CrossThreadTask6::create):
(WebCore::CrossThreadTask6::performTask):
(WebCore::CrossThreadTask7::create):
(WebCore::CrossThreadTask7::performTask):
(WebCore::CrossThreadTask8::create):
(WebCore::CrossThreadTask8::performTask):
(WebCore::createCallbackTask):
* dom/Document.cpp:
(WebCore::Document::addConsoleMessage):
(WebCore::Document::addMessage):
(WebCore::PerformTaskContext::PerformTaskContext):
(WebCore::Document::postTask):
(WebCore::Document::pendingTasksTimerFired):
* dom/Document.h:
* dom/ScriptExecutionContext.cpp:
(WebCore::ProcessMessagesSoonTask::create):
(WebCore::ProcessMessagesSoonTask::performTask):
(WebCore::ScriptExecutionContext::processMessagePortMessagesSoon):
* dom/ScriptExecutionContext.h:
(WebCore::ScriptExecutionContext::AddConsoleMessageTask::create):
(WebCore::ScriptExecutionContext::AddConsoleMessageTask::AddConsoleMessageTask):
* dom/StringCallback.cpp:
(WebCore::StringCallback::scheduleCallback):
* loader/appcache/ApplicationCacheGroup.cpp:
(WebCore::CallCacheListenerTask::create):
(WebCore::CallCacheListenerTask::CallCacheListenerTask):
(WebCore::ApplicationCacheGroup::postListenerTask):
* workers/DefaultSharedWorkerRepository.cpp:
(WebCore::SharedWorkerProxy::postTaskToLoader):
(WebCore::SharedWorkerProxy::postTaskForModeToWorkerGlobalScope):
(WebCore::SharedWorkerConnectTask::create):
(WebCore::SharedWorkerConnectTask::performTask):
(WebCore::DefaultSharedWorkerRepository::workerScriptLoaded):
(WebCore::DefaultSharedWorkerRepository::connectToWorker):
* workers/WorkerEventQueue.cpp:
(WebCore::WorkerEventQueue::enqueueEvent):
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::close):
(WebCore::WorkerGlobalScope::postTask):
(WebCore::WorkerGlobalScope::addConsoleMessage):
(WebCore::WorkerGlobalScope::addMessage):
* workers/WorkerGlobalScope.h:
* workers/WorkerLoaderProxy.h:
* workers/WorkerMessagingProxy.cpp:
(WebCore::MessageWorkerGlobalScopeTask::create):
(WebCore::MessageWorkerGlobalScopeTask::performTask):
(WebCore::MessageWorkerTask::create):
(WebCore::MessageWorkerTask::performTask):
(WebCore::WorkerExceptionTask::create):
(WebCore::WorkerExceptionTask::performTask):
(WebCore::WorkerGlobalScopeDestroyedTask::create):
(WebCore::WorkerGlobalScopeDestroyedTask::performTask):
(WebCore::WorkerTerminateTask::create):
(WebCore::WorkerTerminateTask::WorkerTerminateTask):
(WebCore::WorkerTerminateTask::performTask):
(WebCore::WorkerThreadActivityReportTask::create):
(WebCore::WorkerThreadActivityReportTask::performTask):
(WebCore::PostMessageToPageInspectorTask::create):
(WebCore::PostMessageToPageInspectorTask::performTask):
(WebCore::NotifyNetworkStateChangeTask::create):
(WebCore::NotifyNetworkStateChangeTask::NotifyNetworkStateChangeTask):
(WebCore::NotifyNetworkStateChangeTask::performTask):
(WebCore::WorkerMessagingProxy::postMessageToWorkerObject):
(WebCore::WorkerMessagingProxy::postMessageToWorkerGlobalScope):
(WebCore::WorkerMessagingProxy::postTaskForModeToWorkerGlobalScope):
(WebCore::WorkerMessagingProxy::postTaskToLoader):
(WebCore::WorkerMessagingProxy::postExceptionToWorkerObject):
(WebCore::WorkerMessagingProxy::workerThreadCreated):
(WebCore::WorkerMessagingProxy::notifyNetworkStateChange):
(WebCore::WorkerMessagingProxy::workerGlobalScopeDestroyed):
(WebCore::WorkerMessagingProxy::workerGlobalScopeClosed):
(WebCore::WorkerMessagingProxy::postMessageToPageInspector):
(WebCore::WorkerMessagingProxy::confirmMessageFromWorkerObject):
(WebCore::WorkerMessagingProxy::reportPendingActivity):
* workers/WorkerMessagingProxy.h:
* workers/WorkerRunLoop.cpp:
(WebCore::WorkerRunLoop::postTask):
(WebCore::WorkerRunLoop::postTaskAndTerminate):
(WebCore::WorkerRunLoop::postTaskForMode):
(WebCore::WorkerRunLoop::Task::create):
(WebCore::WorkerRunLoop::Task::Task):
* workers/WorkerRunLoop.h:
* workers/WorkerThread.cpp:
(WebCore::WorkerThreadShutdownFinishTask::create):
(WebCore::WorkerThreadShutdownFinishTask::performTask):
(WebCore::WorkerThreadShutdownFinishTask::isCleanupTask):
(WebCore::WorkerThreadShutdownStartTask::performTask):
(WebCore::WorkerThread::stop):
(WebCore::WorkerThread::releaseFastMallocFreeMemoryInAllThreads):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@157075 268f45cc-cd09-0410-ab3c-d52691b4dbfc

29 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/webdatabase/Database.cpp
Source/WebCore/Modules/webdatabase/DatabaseManager.cpp
Source/WebCore/Modules/webdatabase/SQLCallbackWrapper.h
Source/WebCore/Modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp
Source/WebCore/Modules/websockets/ThreadableWebSocketChannelClientWrapper.h
Source/WebCore/Modules/websockets/WorkerThreadableWebSocketChannel.cpp
Source/WebCore/bindings/js/JSCallbackData.h
Source/WebCore/bindings/js/JSDOMGlobalObjectTask.h
Source/WebCore/bindings/js/JSDOMWindowBase.cpp
Source/WebCore/bindings/js/JSWorkerGlobalScopeBase.cpp
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/dom/CrossThreadTask.h
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/Document.h
Source/WebCore/dom/ScriptExecutionContext.cpp
Source/WebCore/dom/ScriptExecutionContext.h
Source/WebCore/dom/StringCallback.cpp
Source/WebCore/loader/appcache/ApplicationCacheGroup.cpp
Source/WebCore/workers/DefaultSharedWorkerRepository.cpp
Source/WebCore/workers/WorkerEventQueue.cpp
Source/WebCore/workers/WorkerGlobalScope.cpp
Source/WebCore/workers/WorkerGlobalScope.h
Source/WebCore/workers/WorkerLoaderProxy.h
Source/WebCore/workers/WorkerMessagingProxy.cpp
Source/WebCore/workers/WorkerMessagingProxy.h
Source/WebCore/workers/WorkerRunLoop.cpp
Source/WebCore/workers/WorkerRunLoop.h
Source/WebCore/workers/WorkerThread.cpp

index 6f45ac7bedef1247ec56205fd9ec7efa3f13c082..d5932d9a2a39d040e316075dde9d27d3777d9b78 100644 (file)
@@ -1,3 +1,151 @@
+2013-10-07  Commit Queue  <commit-queue@webkit.org>
+
+        Unreviewed, rolling out r157061.
+        http://trac.webkit.org/changeset/157061
+        https://bugs.webkit.org/show_bug.cgi?id=122479
+
+        Broke worker tests (Requested by andersca on #webkit).
+
+        * Modules/webdatabase/Database.cpp:
+        (WebCore::DerefContextTask::create):
+        (WebCore::DerefContextTask::DerefContextTask):
+        (WebCore::Database::~Database):
+        (WebCore::DeliverPendingCallbackTask::create):
+        (WebCore::DeliverPendingCallbackTask::performTask):
+        (WebCore::DeliverPendingCallbackTask::DeliverPendingCallbackTask):
+        (WebCore::Database::scheduleTransactionCallback):
+        * Modules/webdatabase/DatabaseManager.cpp:
+        (WebCore::DatabaseCreationCallbackTask::create):
+        (WebCore::DatabaseCreationCallbackTask::performTask):
+        (WebCore::DatabaseCreationCallbackTask::DatabaseCreationCallbackTask):
+        (WebCore::DatabaseManager::openDatabase):
+        * Modules/webdatabase/SQLCallbackWrapper.h:
+        (WebCore::SQLCallbackWrapper::clear):
+        (WebCore::SQLCallbackWrapper::SafeReleaseTask::create):
+        (WebCore::SQLCallbackWrapper::SafeReleaseTask::performTask):
+        (WebCore::SQLCallbackWrapper::SafeReleaseTask::isCleanupTask):
+        (WebCore::SQLCallbackWrapper::SafeReleaseTask::SafeReleaseTask):
+        * Modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp:
+        (WebCore::ThreadableWebSocketChannelClientWrapper::processPendingTasks):
+        * Modules/websockets/ThreadableWebSocketChannelClientWrapper.h:
+        * Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
+        (WebCore::WorkerThreadableWebSocketChannel::WorkerGlobalScopeDidInitializeTask::create):
+        (WebCore::WorkerThreadableWebSocketChannel::WorkerGlobalScopeDidInitializeTask::~WorkerGlobalScopeDidInitializeTask):
+        (WebCore::WorkerThreadableWebSocketChannel::WorkerGlobalScopeDidInitializeTask::WorkerGlobalScopeDidInitializeTask):
+        (WebCore::WorkerThreadableWebSocketChannel::Bridge::mainThreadInitialize):
+        * bindings/js/JSCallbackData.h:
+        (WebCore::DeleteCallbackDataTask::create):
+        (WebCore::DeleteCallbackDataTask::performTask):
+        (WebCore::DeleteCallbackDataTask::isCleanupTask):
+        (WebCore::DeleteCallbackDataTask::DeleteCallbackDataTask):
+        * bindings/js/JSDOMGlobalObjectTask.h:
+        * bindings/js/JSDOMWindowBase.cpp:
+        (WebCore::JSDOMWindowBase::queueTaskToEventLoop):
+        * bindings/js/JSWorkerGlobalScopeBase.cpp:
+        (WebCore::JSWorkerGlobalScopeBase::queueTaskToEventLoop):
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateCallbackImplementation):
+        * dom/CrossThreadTask.h:
+        (WebCore::CrossThreadTask1::create):
+        (WebCore::CrossThreadTask1::performTask):
+        (WebCore::CrossThreadTask2::create):
+        (WebCore::CrossThreadTask2::performTask):
+        (WebCore::CrossThreadTask3::create):
+        (WebCore::CrossThreadTask3::performTask):
+        (WebCore::CrossThreadTask4::create):
+        (WebCore::CrossThreadTask4::performTask):
+        (WebCore::CrossThreadTask5::create):
+        (WebCore::CrossThreadTask5::performTask):
+        (WebCore::CrossThreadTask6::create):
+        (WebCore::CrossThreadTask6::performTask):
+        (WebCore::CrossThreadTask7::create):
+        (WebCore::CrossThreadTask7::performTask):
+        (WebCore::CrossThreadTask8::create):
+        (WebCore::CrossThreadTask8::performTask):
+        (WebCore::createCallbackTask):
+        * dom/Document.cpp:
+        (WebCore::Document::addConsoleMessage):
+        (WebCore::Document::addMessage):
+        (WebCore::PerformTaskContext::PerformTaskContext):
+        (WebCore::Document::postTask):
+        (WebCore::Document::pendingTasksTimerFired):
+        * dom/Document.h:
+        * dom/ScriptExecutionContext.cpp:
+        (WebCore::ProcessMessagesSoonTask::create):
+        (WebCore::ProcessMessagesSoonTask::performTask):
+        (WebCore::ScriptExecutionContext::processMessagePortMessagesSoon):
+        * dom/ScriptExecutionContext.h:
+        (WebCore::ScriptExecutionContext::AddConsoleMessageTask::create):
+        (WebCore::ScriptExecutionContext::AddConsoleMessageTask::AddConsoleMessageTask):
+        * dom/StringCallback.cpp:
+        (WebCore::StringCallback::scheduleCallback):
+        * loader/appcache/ApplicationCacheGroup.cpp:
+        (WebCore::CallCacheListenerTask::create):
+        (WebCore::CallCacheListenerTask::CallCacheListenerTask):
+        (WebCore::ApplicationCacheGroup::postListenerTask):
+        * workers/DefaultSharedWorkerRepository.cpp:
+        (WebCore::SharedWorkerProxy::postTaskToLoader):
+        (WebCore::SharedWorkerProxy::postTaskForModeToWorkerGlobalScope):
+        (WebCore::SharedWorkerConnectTask::create):
+        (WebCore::SharedWorkerConnectTask::performTask):
+        (WebCore::DefaultSharedWorkerRepository::workerScriptLoaded):
+        (WebCore::DefaultSharedWorkerRepository::connectToWorker):
+        * workers/WorkerEventQueue.cpp:
+        (WebCore::WorkerEventQueue::enqueueEvent):
+        * workers/WorkerGlobalScope.cpp:
+        (WebCore::WorkerGlobalScope::close):
+        (WebCore::WorkerGlobalScope::postTask):
+        (WebCore::WorkerGlobalScope::addConsoleMessage):
+        (WebCore::WorkerGlobalScope::addMessage):
+        * workers/WorkerGlobalScope.h:
+        * workers/WorkerLoaderProxy.h:
+        * workers/WorkerMessagingProxy.cpp:
+        (WebCore::MessageWorkerGlobalScopeTask::create):
+        (WebCore::MessageWorkerGlobalScopeTask::performTask):
+        (WebCore::MessageWorkerTask::create):
+        (WebCore::MessageWorkerTask::performTask):
+        (WebCore::WorkerExceptionTask::create):
+        (WebCore::WorkerExceptionTask::performTask):
+        (WebCore::WorkerGlobalScopeDestroyedTask::create):
+        (WebCore::WorkerGlobalScopeDestroyedTask::performTask):
+        (WebCore::WorkerTerminateTask::create):
+        (WebCore::WorkerTerminateTask::WorkerTerminateTask):
+        (WebCore::WorkerTerminateTask::performTask):
+        (WebCore::WorkerThreadActivityReportTask::create):
+        (WebCore::WorkerThreadActivityReportTask::performTask):
+        (WebCore::PostMessageToPageInspectorTask::create):
+        (WebCore::PostMessageToPageInspectorTask::performTask):
+        (WebCore::NotifyNetworkStateChangeTask::create):
+        (WebCore::NotifyNetworkStateChangeTask::NotifyNetworkStateChangeTask):
+        (WebCore::NotifyNetworkStateChangeTask::performTask):
+        (WebCore::WorkerMessagingProxy::postMessageToWorkerObject):
+        (WebCore::WorkerMessagingProxy::postMessageToWorkerGlobalScope):
+        (WebCore::WorkerMessagingProxy::postTaskForModeToWorkerGlobalScope):
+        (WebCore::WorkerMessagingProxy::postTaskToLoader):
+        (WebCore::WorkerMessagingProxy::postExceptionToWorkerObject):
+        (WebCore::WorkerMessagingProxy::workerThreadCreated):
+        (WebCore::WorkerMessagingProxy::notifyNetworkStateChange):
+        (WebCore::WorkerMessagingProxy::workerGlobalScopeDestroyed):
+        (WebCore::WorkerMessagingProxy::workerGlobalScopeClosed):
+        (WebCore::WorkerMessagingProxy::postMessageToPageInspector):
+        (WebCore::WorkerMessagingProxy::confirmMessageFromWorkerObject):
+        (WebCore::WorkerMessagingProxy::reportPendingActivity):
+        * workers/WorkerMessagingProxy.h:
+        * workers/WorkerRunLoop.cpp:
+        (WebCore::WorkerRunLoop::postTask):
+        (WebCore::WorkerRunLoop::postTaskAndTerminate):
+        (WebCore::WorkerRunLoop::postTaskForMode):
+        (WebCore::WorkerRunLoop::Task::create):
+        (WebCore::WorkerRunLoop::Task::Task):
+        * workers/WorkerRunLoop.h:
+        * workers/WorkerThread.cpp:
+        (WebCore::WorkerThreadShutdownFinishTask::create):
+        (WebCore::WorkerThreadShutdownFinishTask::performTask):
+        (WebCore::WorkerThreadShutdownFinishTask::isCleanupTask):
+        (WebCore::WorkerThreadShutdownStartTask::performTask):
+        (WebCore::WorkerThread::stop):
+        (WebCore::WorkerThread::releaseFastMallocFreeMemoryInAllThreads):
+
 2013-10-07  Darin Adler  <darin@apple.com>
 
         Make Vector::insert work for move-only types
index bc6017b4ab513c48957210ce22531d59b0243550..869c85f0d70b3c96ea6a8075559fdc234fbeec18 100644 (file)
@@ -86,12 +86,11 @@ Database::Database(PassRefPtr<DatabaseBackendContext> databaseContext,
 
 class DerefContextTask : public ScriptExecutionContext::Task {
 public:
-    explicit DerefContextTask(PassRefPtr<ScriptExecutionContext> context)
-        : m_context(context)
+    static PassOwnPtr<DerefContextTask> create(PassRefPtr<ScriptExecutionContext> context)
     {
+        return adoptPtr(new DerefContextTask(context));
     }
 
-private:
     virtual void performTask(ScriptExecutionContext* context)
     {
         ASSERT_UNUSED(context, context == m_context);
@@ -100,6 +99,12 @@ private:
 
     virtual bool isCleanupTask() const { return true; }
 
+private:
+    DerefContextTask(PassRefPtr<ScriptExecutionContext> context)
+        : m_context(context)
+    {
+    }
+    
     RefPtr<ScriptExecutionContext> m_context;
 };
 
@@ -111,7 +116,7 @@ Database::~Database()
         // DerefContextTask::create.
         ScriptExecutionContext* scriptExecutionContext = m_scriptExecutionContext.get();
         
-        scriptExecutionContext->postTask(std::make_unique<DerefContextTask>(m_scriptExecutionContext.release()));
+        scriptExecutionContext->postTask(DerefContextTask::create(m_scriptExecutionContext.release()));
     }
 }
 
@@ -200,24 +205,28 @@ void Database::runTransaction(PassRefPtr<SQLTransactionCallback> callback, PassR
 
 class DeliverPendingCallbackTask : public ScriptExecutionContext::Task {
 public:
-    explicit DeliverPendingCallbackTask(PassRefPtr<SQLTransaction> transaction)
-        : m_transaction(transaction)
+    static PassOwnPtr<DeliverPendingCallbackTask> create(PassRefPtr<SQLTransaction> transaction)
     {
+        return adoptPtr(new DeliverPendingCallbackTask(transaction));
     }
 
-private:
-    virtual void performTask(ScriptExecutionContext*) OVERRIDE
+    virtual void performTask(ScriptExecutionContext*)
     {
         m_transaction->performPendingCallback();
     }
 
 private:
+    DeliverPendingCallbackTask(PassRefPtr<SQLTransaction> transaction)
+        : m_transaction(transaction)
+    {
+    }
+
     RefPtr<SQLTransaction> m_transaction;
 };
 
 void Database::scheduleTransactionCallback(SQLTransaction* transaction)
 {
-    m_scriptExecutionContext->postTask(std::make_unique<DeliverPendingCallbackTask>(transaction));
+    m_scriptExecutionContext->postTask(DeliverPendingCallbackTask::create(transaction));
 }
 
 Vector<String> Database::performGetTableNames()
index 56f76b310bddc2b459ee558482fa5b0fa4d1c911..afcea143a967051a171621c9ef57b49e2f1285d4 100644 (file)
@@ -105,18 +105,23 @@ void DatabaseManager::setIsAvailable(bool available)
 
 class DatabaseCreationCallbackTask : public ScriptExecutionContext::Task {
 public:
-    DatabaseCreationCallbackTask(PassRefPtr<Database> database, PassRefPtr<DatabaseCallback> callback)
-        : m_database(database)
-        , m_creationCallback(callback)
+    static PassOwnPtr<DatabaseCreationCallbackTask> create(PassRefPtr<Database> database, PassRefPtr<DatabaseCallback> creationCallback)
     {
+        return adoptPtr(new DatabaseCreationCallbackTask(database, creationCallback));
     }
 
-private:
-    virtual void performTask(ScriptExecutionContext*) OVERRIDE
+    virtual void performTask(ScriptExecutionContext*)
     {
         m_creationCallback->handleEvent(m_database.get());
     }
 
+private:
+    DatabaseCreationCallbackTask(PassRefPtr<Database> database, PassRefPtr<DatabaseCallback> callback)
+        : m_database(database)
+        , m_creationCallback(callback)
+    {
+    }
+
     RefPtr<Database> m_database;
     RefPtr<DatabaseCallback> m_creationCallback;
 };
@@ -296,7 +301,7 @@ PassRefPtr<Database> DatabaseManager::openDatabase(ScriptExecutionContext* conte
 
     if (backend->isNew() && creationCallback.get()) {
         LOG(StorageAPI, "Scheduling DatabaseCreationCallbackTask for database %p\n", database.get());
-        database->m_scriptExecutionContext->postTask(std::make_unique<DatabaseCreationCallbackTask>(database, creationCallback));
+        database->m_scriptExecutionContext->postTask(DatabaseCreationCallbackTask::create(database, creationCallback));
     }
 
     ASSERT(database);
index 6241bbd240830a82fca8aae7a2a9210f8d73c487..c184a3738053824e277a5008bea74a5c43da3670 100644 (file)
@@ -73,7 +73,7 @@ public:
             context = m_scriptExecutionContext.release().leakRef();
             callback = m_callback.release().leakRef();
         }
-        context->postTask(std::make_unique<SafeReleaseTask>(callback));
+        context->postTask(SafeReleaseTask::create(callback));
     }
 
     PassRefPtr<T> unwrap()
@@ -90,21 +90,26 @@ public:
 private:
     class SafeReleaseTask : public ScriptExecutionContext::Task {
     public:
-        explicit SafeReleaseTask(T* callbackToRelease)
-            : m_callbackToRelease(callbackToRelease)
+        static PassOwnPtr<SafeReleaseTask> create(T* callbackToRelease)
         {
+            return adoptPtr(new SafeReleaseTask(callbackToRelease));
         }
 
-    private:
-        virtual void performTask(ScriptExecutionContext* context) OVERRIDE
+        virtual void performTask(ScriptExecutionContext* context)
         {
             ASSERT(m_callbackToRelease && context && context->isContextThread());
             m_callbackToRelease->deref();
             context->deref();
         }
 
-        virtual bool isCleanupTask() const OVERRIDE { return true; }
-        
+        virtual bool isCleanupTask() const { return true; }
+
+    private:
+        explicit SafeReleaseTask(T* callbackToRelease)
+            : m_callbackToRelease(callbackToRelease)
+        {
+        }
+
         T* m_callbackToRelease;
     };
 
index d7e170474ebe4645a124f269b90f6e1e1d3f5b69..a3367b0ef21cbc0f87bacd02dec6efc70f031d9c 100644 (file)
@@ -232,10 +232,9 @@ void ThreadableWebSocketChannelClientWrapper::processPendingTasks()
         m_context->postTask(createCallbackTask(&ThreadableWebSocketChannelClientWrapper::processPendingTasksCallback, this));
         return;
     }
-
-    auto tasks = std::move(m_pendingTasks);
-
-    for (auto iter = tasks.begin(); iter != tasks.end(); ++iter)
+    Vector<OwnPtr<ScriptExecutionContext::Task> > tasks;
+    tasks.swap(m_pendingTasks);
+    for (Vector<OwnPtr<ScriptExecutionContext::Task> >::const_iterator iter = tasks.begin(); iter != tasks.end(); ++iter)
         (*iter)->performTask(0);
 }
 
index eb2cd851307029ccc72b399a7081d7943626e0c6..c6f33a580322118f65b238d41520d19b21dfbbea 100644 (file)
@@ -114,7 +114,7 @@ private:
     ThreadableWebSocketChannel::SendResult m_sendRequestResult;
     unsigned long m_bufferedAmount;
     bool m_suspended;
-    Vector<std::unique_ptr<ScriptExecutionContext::Task>> m_pendingTasks;
+    Vector<OwnPtr<ScriptExecutionContext::Task> > m_pendingTasks;
 };
 
 } // namespace WebCore
index cdff0fd403841f04a0ea833294ceb964a5569254..b6ba2d6fa9427c6674bfcbc2ec2b5c5f1fce294d 100644 (file)
@@ -361,15 +361,14 @@ WorkerThreadableWebSocketChannel::Bridge::~Bridge()
 
 class WorkerThreadableWebSocketChannel::WorkerGlobalScopeDidInitializeTask : public ScriptExecutionContext::Task {
 public:
-    WorkerGlobalScopeDidInitializeTask(WorkerThreadableWebSocketChannel::Peer* peer, WorkerLoaderProxy* loaderProxy, PassRefPtr<ThreadableWebSocketChannelClientWrapper> workerClientWrapper)
-        : m_peer(peer)
-        , m_loaderProxy(loaderProxy)
-        , m_workerClientWrapper(workerClientWrapper)
+    static PassOwnPtr<ScriptExecutionContext::Task> create(WorkerThreadableWebSocketChannel::Peer* peer,
+                                                           WorkerLoaderProxy* loaderProxy,
+                                                           PassRefPtr<ThreadableWebSocketChannelClientWrapper> workerClientWrapper)
     {
+        return adoptPtr(new WorkerGlobalScopeDidInitializeTask(peer, loaderProxy, workerClientWrapper));
     }
-    virtual ~WorkerGlobalScopeDidInitializeTask() { }
 
-private:
+    virtual ~WorkerGlobalScopeDidInitializeTask() { }
     virtual void performTask(ScriptExecutionContext* context) OVERRIDE
     {
         ASSERT_UNUSED(context, context->isWorkerGlobalScope());
@@ -383,6 +382,16 @@ private:
     }
     virtual bool isCleanupTask() const OVERRIDE { return true; }
 
+private:
+    WorkerGlobalScopeDidInitializeTask(WorkerThreadableWebSocketChannel::Peer* peer,
+                                   WorkerLoaderProxy* loaderProxy,
+                                   PassRefPtr<ThreadableWebSocketChannelClientWrapper> workerClientWrapper)
+        : m_peer(peer)
+        , m_loaderProxy(loaderProxy)
+        , m_workerClientWrapper(workerClientWrapper)
+    {
+    }
+
     WorkerThreadableWebSocketChannel::Peer* m_peer;
     WorkerLoaderProxy* m_loaderProxy;
     RefPtr<ThreadableWebSocketChannelClientWrapper> m_workerClientWrapper;
@@ -396,7 +405,8 @@ void WorkerThreadableWebSocketChannel::Bridge::mainThreadInitialize(ScriptExecut
     RefPtr<ThreadableWebSocketChannelClientWrapper> clientWrapper = prpClientWrapper;
 
     Peer* peer = Peer::create(clientWrapper, *loaderProxy, context, taskMode);
-    bool sent = loaderProxy->postTaskForModeToWorkerGlobalScope(std::make_unique<WorkerThreadableWebSocketChannel::WorkerGlobalScopeDidInitializeTask>(peer, loaderProxy, clientWrapper), taskMode);
+    bool sent = loaderProxy->postTaskForModeToWorkerGlobalScope(
+        WorkerThreadableWebSocketChannel::WorkerGlobalScopeDidInitializeTask::create(peer, loaderProxy, clientWrapper), taskMode);
     if (!sent) {
         clientWrapper->clearPeer();
         delete peer;
index d8fb406f98599c71fa584314f903d07a3c1319fd..d321c57f05c9f0232f1e7d04ca4421c374b08625 100644 (file)
@@ -77,18 +77,19 @@ private:
 
 class DeleteCallbackDataTask : public ScriptExecutionContext::Task {
 public:
-    explicit DeleteCallbackDataTask(JSCallbackData* data)
-        : m_data(data)
+    static PassOwnPtr<DeleteCallbackDataTask> create(JSCallbackData* data)
     {
+        return adoptPtr(new DeleteCallbackDataTask(data));
     }
 
-private:
-    virtual void performTask(ScriptExecutionContext*) OVERRIDE
+    virtual void performTask(ScriptExecutionContext*)
     {
         delete m_data;
     }
+    virtual bool isCleanupTask() const { return true; }
+private:
 
-    virtual bool isCleanupTask() const OVERRIDE { return true; }
+    DeleteCallbackDataTask(JSCallbackData* data) : m_data(data) {}
 
     JSCallbackData* m_data;
 };
index 23763af051cd80dcfa8a46f7075165765cf25ee7..672cc852146263b13996ac38dc801c5a488aeea4 100644 (file)
@@ -35,10 +35,16 @@ class JSGlobalObjectCallback;
 
 class JSGlobalObjectTask FINAL : public ScriptExecutionContext::Task {
 public:
-    JSGlobalObjectTask(JSDOMGlobalObject*, JSC::GlobalObjectMethodTable::QueueTaskToEventLoopCallbackFunctionPtr, PassRefPtr<JSC::TaskContext>);
+    static PassOwnPtr<JSGlobalObjectTask> create(JSDOMGlobalObject* globalObject, JSC::GlobalObjectMethodTable::QueueTaskToEventLoopCallbackFunctionPtr functionPtr, PassRefPtr<JSC::TaskContext> taskContext)
+    {
+        return adoptPtr(new JSGlobalObjectTask(globalObject, functionPtr, taskContext));
+    }
+
     virtual ~JSGlobalObjectTask();
 
 private:
+    JSGlobalObjectTask(JSDOMGlobalObject*, JSC::GlobalObjectMethodTable::QueueTaskToEventLoopCallbackFunctionPtr, PassRefPtr<JSC::TaskContext>);
+
     virtual void performTask(ScriptExecutionContext*) OVERRIDE;
 
     RefPtr<JSGlobalObjectCallback> m_callback;
index ddc9da353ee443e18c09e1156f841cd8548053a2..c29e6d57928dfd4a6e8cbad7fd37035c8eb4be5c 100644 (file)
@@ -167,7 +167,7 @@ bool JSDOMWindowBase::javaScriptExperimentsEnabled(const JSGlobalObject* object)
 void JSDOMWindowBase::queueTaskToEventLoop(const JSGlobalObject* object, GlobalObjectMethodTable::QueueTaskToEventLoopCallbackFunctionPtr functionPtr, PassRefPtr<TaskContext> taskContext)
 {
     const JSDOMWindowBase* thisObject = static_cast<const JSDOMWindowBase*>(object);
-    thisObject->scriptExecutionContext()->postTask(std::make_unique<JSGlobalObjectTask>((JSDOMWindowBase*)thisObject, functionPtr, taskContext));
+    thisObject->scriptExecutionContext()->postTask(JSGlobalObjectTask::create((JSDOMWindowBase*)thisObject, functionPtr, taskContext));
 }
 
 void JSDOMWindowBase::willRemoveFromWindowShell()
index 69d4ef801d1b3da60e10e2d4f8174ebfdf8b74fa..2f97abb9a13d32d13fa16ba97f21ff2c786ad301 100644 (file)
@@ -99,7 +99,7 @@ bool JSWorkerGlobalScopeBase::javaScriptExperimentsEnabled(const JSGlobalObject*
 void JSWorkerGlobalScopeBase::queueTaskToEventLoop(const JSGlobalObject* object, GlobalObjectMethodTable::QueueTaskToEventLoopCallbackFunctionPtr functionPtr, PassRefPtr<TaskContext> taskContext)
 {
     const JSWorkerGlobalScopeBase* thisObject = static_cast<const JSWorkerGlobalScopeBase*>(object);
-    thisObject->scriptExecutionContext()->postTask(std::make_unique<JSGlobalObjectTask>((JSDOMGlobalObject*)thisObject, functionPtr, taskContext));
+    thisObject->scriptExecutionContext()->postTask(JSGlobalObjectTask::create((JSDOMGlobalObject*)thisObject, functionPtr, taskContext));
 }
 
 JSValue toJS(ExecState* exec, JSDOMGlobalObject*, WorkerGlobalScope* workerGlobalScope)
index 68f5ae9d37a3ab43ea33fb048703915786b35fa9..1d2200346ddec9b189b84a4650f785c1d008db0f 100644 (file)
@@ -3085,7 +3085,7 @@ sub GenerateCallbackImplementation
     push(@implContent, "    if (!context || context->isContextThread())\n");
     push(@implContent, "        delete m_data;\n");
     push(@implContent, "    else\n");
-    push(@implContent, "        context->postTask(std::make_unique<DeleteCallbackDataTask>(m_data));\n");
+    push(@implContent, "        context->postTask(DeleteCallbackDataTask::create(m_data));\n");
     push(@implContent, "#ifndef NDEBUG\n");
     push(@implContent, "    m_data = 0;\n");
     push(@implContent, "#endif\n");
index bdad011f0b1c0030b4a8f4a3dcb38224be0e21f4..e2809987f8c0fb1e8e69c9467fda807e34895766 100644 (file)
@@ -63,18 +63,24 @@ public:
     typedef CrossThreadTask1<P1, MP1> CrossThreadTask;
     typedef typename CrossThreadTaskTraits<P1>::ParamType Param1;
 
+    static PassOwnPtr<CrossThreadTask> create(Method method, Param1 parameter1)
+    {
+        return adoptPtr(new CrossThreadTask(method, parameter1));
+    }
+
+private:
     CrossThreadTask1(Method method, Param1 parameter1)
         : m_method(method)
         , m_parameter1(parameter1)
     {
     }
 
-private:
-    virtual void performTask(ScriptExecutionContext* context) OVERRIDE
+    virtual void performTask(ScriptExecutionContext* context)
     {
         (*m_method)(context, m_parameter1);
     }
 
+private:
     Method m_method;
     P1 m_parameter1;
 };
@@ -87,6 +93,12 @@ public:
     typedef typename CrossThreadTaskTraits<P1>::ParamType Param1;
     typedef typename CrossThreadTaskTraits<P2>::ParamType Param2;
 
+    static PassOwnPtr<CrossThreadTask> create(Method method, Param1 parameter1, Param2 parameter2)
+    {
+        return adoptPtr(new CrossThreadTask(method, parameter1, parameter2));
+    }
+
+private:
     CrossThreadTask2(Method method, Param1 parameter1, Param2 parameter2)
         : m_method(method)
         , m_parameter1(parameter1)
@@ -94,12 +106,12 @@ public:
     {
     }
 
-private:
-    virtual void performTask(ScriptExecutionContext* context) OVERRIDE
+    virtual void performTask(ScriptExecutionContext* context)
     {
         (*m_method)(context, m_parameter1, m_parameter2);
     }
 
+private:
     Method m_method;
     P1 m_parameter1;
     P2 m_parameter2;
@@ -114,6 +126,12 @@ public:
     typedef typename CrossThreadTaskTraits<P2>::ParamType Param2;
     typedef typename CrossThreadTaskTraits<P3>::ParamType Param3;
 
+    static PassOwnPtr<CrossThreadTask> create(Method method, Param1 parameter1, Param2 parameter2, Param3 parameter3)
+    {
+        return adoptPtr(new CrossThreadTask(method, parameter1, parameter2, parameter3));
+    }
+
+private:
     CrossThreadTask3(Method method, Param1 parameter1, Param2 parameter2, Param3 parameter3)
         : m_method(method)
         , m_parameter1(parameter1)
@@ -122,12 +140,12 @@ public:
     {
     }
 
-private:
-    virtual void performTask(ScriptExecutionContext* context) OVERRIDE
+    virtual void performTask(ScriptExecutionContext* context)
     {
         (*m_method)(context, m_parameter1, m_parameter2, m_parameter3);
     }
 
+private:
     Method m_method;
     P1 m_parameter1;
     P2 m_parameter2;
@@ -144,6 +162,12 @@ public:
     typedef typename CrossThreadTaskTraits<P3>::ParamType Param3;
     typedef typename CrossThreadTaskTraits<P4>::ParamType Param4;
 
+    static PassOwnPtr<CrossThreadTask> create(Method method, Param1 parameter1, Param2 parameter2, Param3 parameter3, Param4 parameter4)
+    {
+        return adoptPtr(new CrossThreadTask(method, parameter1, parameter2, parameter3, parameter4));
+    }
+
+private:
     CrossThreadTask4(Method method, Param1 parameter1, Param2 parameter2, Param3 parameter3, Param4 parameter4)
         : m_method(method)
         , m_parameter1(parameter1)
@@ -153,12 +177,12 @@ public:
     {
     }
 
-private:
-    virtual void performTask(ScriptExecutionContext* context) OVERRIDE
+    virtual void performTask(ScriptExecutionContext* context)
     {
         (*m_method)(context, m_parameter1, m_parameter2, m_parameter3, m_parameter4);
     }
 
+private:
     Method m_method;
     P1 m_parameter1;
     P2 m_parameter2;
@@ -177,7 +201,12 @@ public:
     typedef typename CrossThreadTaskTraits<P4>::ParamType Param4;
     typedef typename CrossThreadTaskTraits<P5>::ParamType Param5;
 
-public:
+    static PassOwnPtr<CrossThreadTask> create(Method method, Param1 parameter1, Param2 parameter2, Param3 parameter3, Param4 parameter4, Param5 parameter5)
+    {
+        return adoptPtr(new CrossThreadTask(method, parameter1, parameter2, parameter3, parameter4, parameter5));
+    }
+
+private:
     CrossThreadTask5(Method method, Param1 parameter1, Param2 parameter2, Param3 parameter3, Param4 parameter4, Param5 parameter5)
         : m_method(method)
         , m_parameter1(parameter1)
@@ -188,12 +217,12 @@ public:
     {
     }
 
-private:
-    virtual void performTask(ScriptExecutionContext* context) OVERRIDE
+    virtual void performTask(ScriptExecutionContext* context)
     {
         (*m_method)(context, m_parameter1, m_parameter2, m_parameter3, m_parameter4, m_parameter5);
     }
 
+private:
     Method m_method;
     P1 m_parameter1;
     P2 m_parameter2;
@@ -214,6 +243,12 @@ public:
     typedef typename CrossThreadTaskTraits<P5>::ParamType Param5;
     typedef typename CrossThreadTaskTraits<P6>::ParamType Param6;
 
+    static PassOwnPtr<CrossThreadTask> create(Method method, Param1 parameter1, Param2 parameter2, Param3 parameter3, Param4 parameter4, Param5 parameter5, Param6 parameter6)
+    {
+        return adoptPtr(new CrossThreadTask(method, parameter1, parameter2, parameter3, parameter4, parameter5, parameter6));
+    }
+
+private:
     CrossThreadTask6(Method method, Param1 parameter1, Param2 parameter2, Param3 parameter3, Param4 parameter4, Param5 parameter5, Param6 parameter6)
         : m_method(method)
         , m_parameter1(parameter1)
@@ -225,8 +260,7 @@ public:
     {
     }
 
-private:
-    virtual void performTask(ScriptExecutionContext* context) OVERRIDE
+    virtual void performTask(ScriptExecutionContext* context)
     {
         (*m_method)(context, m_parameter1, m_parameter2, m_parameter3, m_parameter4, m_parameter5, m_parameter6);
     }
@@ -254,7 +288,12 @@ public:
     typedef typename CrossThreadTaskTraits<P6>::ParamType Param6;
     typedef typename CrossThreadTaskTraits<P7>::ParamType Param7;
 
-public:
+    static PassOwnPtr<CrossThreadTask> create(Method method, Param1 parameter1, Param2 parameter2, Param3 parameter3, Param4 parameter4, Param5 parameter5, Param6 parameter6, Param7 parameter7)
+    {
+        return adoptPtr(new CrossThreadTask(method, parameter1, parameter2, parameter3, parameter4, parameter5, parameter6, parameter7));
+    }
+
+private:
     CrossThreadTask7(Method method, Param1 parameter1, Param2 parameter2, Param3 parameter3, Param4 parameter4, Param5 parameter5, Param6 parameter6, Param7 parameter7)
         : m_method(method)
         , m_parameter1(parameter1)
@@ -267,12 +306,12 @@ public:
     {
     }
 
-private:
-    virtual void performTask(ScriptExecutionContext* context) OVERRIDE
+    virtual void performTask(ScriptExecutionContext* context)
     {
         (*m_method)(context, m_parameter1, m_parameter2, m_parameter3, m_parameter4, m_parameter5, m_parameter6, m_parameter7);
     }
 
+private:
     Method m_method;
     P1 m_parameter1;
     P2 m_parameter2;
@@ -297,7 +336,12 @@ public:
     typedef typename CrossThreadTaskTraits<P7>::ParamType Param7;
     typedef typename CrossThreadTaskTraits<P8>::ParamType Param8;
     
-public:
+    static PassOwnPtr<CrossThreadTask> create(Method method, Param1 parameter1, Param2 parameter2, Param3 parameter3, Param4 parameter4, Param5 parameter5, Param6 parameter6, Param7 parameter7, Param8 parameter8)
+    {
+        return adoptPtr(new CrossThreadTask(method, parameter1, parameter2, parameter3, parameter4, parameter5, parameter6, parameter7, parameter8));
+    }
+    
+private:
     CrossThreadTask8(Method method, Param1 parameter1, Param2 parameter2, Param3 parameter3, Param4 parameter4, Param5 parameter5, Param6 parameter6, Param7 parameter7, Param8 parameter8)
     : m_method(method)
     , m_parameter1(parameter1)
@@ -311,12 +355,12 @@ public:
     {
     }
     
-private:
-    virtual void performTask(ScriptExecutionContext* context) OVERRIDE
+    virtual void performTask(ScriptExecutionContext* context)
     {
         (*m_method)(context, m_parameter1, m_parameter2, m_parameter3, m_parameter4, m_parameter5, m_parameter6, m_parameter7, m_parameter8);
     }
     
+private:
     Method m_method;
     P1 m_parameter1;
     P2 m_parameter2;
@@ -329,68 +373,68 @@ private:
 };
 
 template<typename P1, typename MP1>
-std::unique_ptr<ScriptExecutionContext::Task> createCallbackTask(
+PassOwnPtr<ScriptExecutionContext::Task> createCallbackTask(
     void (*method)(ScriptExecutionContext*, MP1),
     const P1& parameter1)
 {
-    return std::make_unique<CrossThreadTask1<typename CrossThreadCopier<P1>::Type, MP1>>(
+    return CrossThreadTask1<typename CrossThreadCopier<P1>::Type, MP1>::create(
         method,
         CrossThreadCopier<P1>::copy(parameter1));
 }
 
 template<typename P1, typename MP1, typename P2, typename MP2>
-std::unique_ptr<ScriptExecutionContext::Task> createCallbackTask(
+PassOwnPtr<ScriptExecutionContext::Task> createCallbackTask(
     void (*method)(ScriptExecutionContext*, MP1, MP2),
     const P1& parameter1, const P2& parameter2)
 {
-    return std::make_unique<CrossThreadTask2<typename CrossThreadCopier<P1>::Type, MP1, typename CrossThreadCopier<P2>::Type, MP2>>(
+    return CrossThreadTask2<typename CrossThreadCopier<P1>::Type, MP1, typename CrossThreadCopier<P2>::Type, MP2>::create(
         method,
         CrossThreadCopier<P1>::copy(parameter1), CrossThreadCopier<P2>::copy(parameter2));
 }
 
 template<typename P1, typename MP1, typename P2, typename MP2, typename P3, typename MP3>
-std::unique_ptr<ScriptExecutionContext::Task> createCallbackTask(
+PassOwnPtr<ScriptExecutionContext::Task> createCallbackTask(
     void (*method)(ScriptExecutionContext*, MP1, MP2, MP3),
     const P1& parameter1, const P2& parameter2, const P3& parameter3)
 {
-    return std::make_unique<CrossThreadTask3<typename CrossThreadCopier<P1>::Type, MP1, typename CrossThreadCopier<P2>::Type, MP2, typename CrossThreadCopier<P3>::Type, MP3>>(
+    return CrossThreadTask3<typename CrossThreadCopier<P1>::Type, MP1, typename CrossThreadCopier<P2>::Type, MP2, typename CrossThreadCopier<P3>::Type, MP3>::create(
         method,
         CrossThreadCopier<P1>::copy(parameter1), CrossThreadCopier<P2>::copy(parameter2),
         CrossThreadCopier<P3>::copy(parameter3));
 }
 
 template<typename P1, typename MP1, typename P2, typename MP2, typename P3, typename MP3, typename P4, typename MP4>
-std::unique_ptr<ScriptExecutionContext::Task> createCallbackTask(
+PassOwnPtr<ScriptExecutionContext::Task> createCallbackTask(
     void (*method)(ScriptExecutionContext*, MP1, MP2, MP3, MP4),
     const P1& parameter1, const P2& parameter2, const P3& parameter3, const P4& parameter4)
 {
-    return std::make_unique<CrossThreadTask4<typename CrossThreadCopier<P1>::Type, MP1, typename CrossThreadCopier<P2>::Type, MP2, typename CrossThreadCopier<P3>::Type, MP3,
-        typename CrossThreadCopier<P4>::Type, MP4>>(
+    return CrossThreadTask4<typename CrossThreadCopier<P1>::Type, MP1, typename CrossThreadCopier<P2>::Type, MP2, typename CrossThreadCopier<P3>::Type, MP3,
+        typename CrossThreadCopier<P4>::Type, MP4>::create(
             method,
             CrossThreadCopier<P1>::copy(parameter1), CrossThreadCopier<P2>::copy(parameter2),
             CrossThreadCopier<P3>::copy(parameter3), CrossThreadCopier<P4>::copy(parameter4));
 }
 
 template<typename P1, typename MP1, typename P2, typename MP2, typename P3, typename MP3, typename P4, typename MP4, typename P5, typename MP5>
-std::unique_ptr<ScriptExecutionContext::Task> createCallbackTask(
+PassOwnPtr<ScriptExecutionContext::Task> createCallbackTask(
     void (*method)(ScriptExecutionContext*, MP1, MP2, MP3, MP4, MP5),
     const P1& parameter1, const P2& parameter2, const P3& parameter3, const P4& parameter4, const P5& parameter5)
 {
-    return std::make_unique<CrossThreadTask5<typename CrossThreadCopier<P1>::Type, MP1, typename CrossThreadCopier<P2>::Type, MP2, typename CrossThreadCopier<P3>::Type, MP3,
-        typename CrossThreadCopier<P4>::Type, MP4, typename CrossThreadCopier<P5>::Type, MP5>>(
+    return CrossThreadTask5<typename CrossThreadCopier<P1>::Type, MP1, typename CrossThreadCopier<P2>::Type, MP2, typename CrossThreadCopier<P3>::Type, MP3,
+        typename CrossThreadCopier<P4>::Type, MP4, typename CrossThreadCopier<P5>::Type, MP5>::create(
             method,
-            CrossThreadCopier<P1>::copy(parameter1), CrossThreadCopier<P2>::copy(parameter2),   
+            CrossThreadCopier<P1>::copy(parameter1), CrossThreadCopier<P2>::copy(parameter2),
             CrossThreadCopier<P3>::copy(parameter3), CrossThreadCopier<P4>::copy(parameter4),
             CrossThreadCopier<P5>::copy(parameter5));
 }
 
 template<typename P1, typename MP1, typename P2, typename MP2, typename P3, typename MP3, typename P4, typename MP4, typename P5, typename MP5, typename P6, typename MP6>
-std::unique_ptr<ScriptExecutionContext::Task> createCallbackTask(
+PassOwnPtr<ScriptExecutionContext::Task> createCallbackTask(
     void (*method)(ScriptExecutionContext*, MP1, MP2, MP3, MP4, MP5, MP6),
     const P1& parameter1, const P2& parameter2, const P3& parameter3, const P4& parameter4, const P5& parameter5, const P6& parameter6)
 {
-    return std::make_unique<CrossThreadTask6<typename CrossThreadCopier<P1>::Type, MP1, typename CrossThreadCopier<P2>::Type, MP2, typename CrossThreadCopier<P3>::Type, MP3,
-        typename CrossThreadCopier<P4>::Type, MP4, typename CrossThreadCopier<P5>::Type, MP5, typename CrossThreadCopier<P6>::Type, MP6>>(
+    return CrossThreadTask6<typename CrossThreadCopier<P1>::Type, MP1, typename CrossThreadCopier<P2>::Type, MP2, typename CrossThreadCopier<P3>::Type, MP3,
+        typename CrossThreadCopier<P4>::Type, MP4, typename CrossThreadCopier<P5>::Type, MP5, typename CrossThreadCopier<P6>::Type, MP6>::create(
             method,
             CrossThreadCopier<P1>::copy(parameter1), CrossThreadCopier<P2>::copy(parameter2),
             CrossThreadCopier<P3>::copy(parameter3), CrossThreadCopier<P4>::copy(parameter4),
@@ -398,13 +442,13 @@ std::unique_ptr<ScriptExecutionContext::Task> createCallbackTask(
 }
 
 template<typename P1, typename MP1, typename P2, typename MP2, typename P3, typename MP3, typename P4, typename MP4, typename P5, typename MP5, typename P6, typename MP6, typename P7, typename MP7>
-std::unique_ptr<ScriptExecutionContext::Task> createCallbackTask(
+PassOwnPtr<ScriptExecutionContext::Task> createCallbackTask(
     void (*method)(ScriptExecutionContext*, MP1, MP2, MP3, MP4, MP5, MP6, MP7),
     const P1& parameter1, const P2& parameter2, const P3& parameter3, const P4& parameter4, const P5& parameter5, const P6& parameter6, const P7& parameter7)
 {
-    return std::make_unique<CrossThreadTask7<typename CrossThreadCopier<P1>::Type, MP1, typename CrossThreadCopier<P2>::Type, MP2, typename CrossThreadCopier<P3>::Type, MP3,
+    return CrossThreadTask7<typename CrossThreadCopier<P1>::Type, MP1, typename CrossThreadCopier<P2>::Type, MP2, typename CrossThreadCopier<P3>::Type, MP3,
         typename CrossThreadCopier<P4>::Type, MP4, typename CrossThreadCopier<P5>::Type, MP5, typename CrossThreadCopier<P6>::Type, MP6,
-        typename CrossThreadCopier<P7>::Type, MP7>>(
+        typename CrossThreadCopier<P7>::Type, MP7>::create(
             method,
             CrossThreadCopier<P1>::copy(parameter1), CrossThreadCopier<P2>::copy(parameter2),
             CrossThreadCopier<P3>::copy(parameter3), CrossThreadCopier<P4>::copy(parameter4),
@@ -413,13 +457,13 @@ std::unique_ptr<ScriptExecutionContext::Task> createCallbackTask(
 }
 
 template<typename P1, typename MP1, typename P2, typename MP2, typename P3, typename MP3, typename P4, typename MP4, typename P5, typename MP5, typename P6, typename MP6, typename P7, typename MP7, typename P8, typename MP8>
-std::unique_ptr<ScriptExecutionContext::Task> createCallbackTask(
+PassOwnPtr<ScriptExecutionContext::Task> createCallbackTask(
                                                             void (*method)(ScriptExecutionContext*, MP1, MP2, MP3, MP4, MP5, MP6, MP7, MP8),
                                                             const P1& parameter1, const P2& parameter2, const P3& parameter3, const P4& parameter4, const P5& parameter5, const P6& parameter6, const P7& parameter7, const P8& parameter8)
 {
-    return std::make_unique<CrossThreadTask8<typename CrossThreadCopier<P1>::Type, MP1, typename CrossThreadCopier<P2>::Type, MP2, typename CrossThreadCopier<P3>::Type, MP3,
+    return CrossThreadTask8<typename CrossThreadCopier<P1>::Type, MP1, typename CrossThreadCopier<P2>::Type, MP2, typename CrossThreadCopier<P3>::Type, MP3,
     typename CrossThreadCopier<P4>::Type, MP4, typename CrossThreadCopier<P5>::Type, MP5, typename CrossThreadCopier<P6>::Type, MP6,
-    typename CrossThreadCopier<P7>::Type, MP7, typename CrossThreadCopier<P8>::Type, MP8>>(
+    typename CrossThreadCopier<P7>::Type, MP7, typename CrossThreadCopier<P8>::Type, MP8>::create(
                                                        method,
                                                        CrossThreadCopier<P1>::copy(parameter1), CrossThreadCopier<P2>::copy(parameter2),
                                                        CrossThreadCopier<P3>::copy(parameter3), CrossThreadCopier<P4>::copy(parameter4),
index 834238b06f0753f677d26e0d52cc0d7576d21fdc..ef5d5ebddf8060aa36d84b0f6913c72755002186 100644 (file)
@@ -4831,7 +4831,7 @@ void Document::parseDNSPrefetchControlHeader(const String& dnsPrefetchControl)
 void Document::addConsoleMessage(MessageSource source, MessageLevel level, const String& message, unsigned long requestIdentifier)
 {
     if (!isContextThread()) {
-        postTask(std::make_unique<AddConsoleMessageTask>(source, level, message));
+        postTask(AddConsoleMessageTask::create(source, level, message));
         return;
     }
 
@@ -4842,7 +4842,7 @@ void Document::addConsoleMessage(MessageSource source, MessageLevel level, const
 void Document::addMessage(MessageSource source, MessageLevel level, const String& message, const String& sourceURL, unsigned lineNumber, unsigned columnNumber, PassRefPtr<ScriptCallStack> callStack, JSC::ExecState* state, unsigned long requestIdentifier)
 {
     if (!isContextThread()) {
-        postTask(std::make_unique<AddConsoleMessageTask>(source, level, message));
+        postTask(AddConsoleMessageTask::create(source, level, message));
         return;
     }
 
@@ -4858,14 +4858,14 @@ SecurityOrigin* Document::topOrigin() const
 struct PerformTaskContext {
     WTF_MAKE_NONCOPYABLE(PerformTaskContext); WTF_MAKE_FAST_ALLOCATED;
 public:
-    PerformTaskContext(WeakPtr<Document> document, std::unique_ptr<ScriptExecutionContext::Task> task)
+    PerformTaskContext(WeakPtr<Document> document, PassOwnPtr<ScriptExecutionContext::Task> task)
         : documentReference(document)
-        , task(std::move(task))
+        , task(task)
     {
     }
 
     WeakPtr<Document> documentReference;
-    std::unique_ptr<ScriptExecutionContext::Task> task;
+    OwnPtr<ScriptExecutionContext::Task> task;
 };
 
 void Document::didReceiveTask(void* untypedContext)
@@ -4888,15 +4888,15 @@ void Document::didReceiveTask(void* untypedContext)
     context->task->performTask(document);
 }
 
-void Document::postTask(std::unique_ptr<Task> task)
+void Document::postTask(PassOwnPtr<Task> task)
 {
-    callOnMainThread(didReceiveTask, new PerformTaskContext(m_weakFactory.createWeakPtr(), std::move(task)));
+    callOnMainThread(didReceiveTask, new PerformTaskContext(m_weakFactory.createWeakPtr(), task));
 }
 
 void Document::pendingTasksTimerFired(Timer<Document>*)
 {
     while (!m_pendingTasks.isEmpty()) {
-        auto task = std::move(m_pendingTasks[0]);
+        OwnPtr<Task> task = m_pendingTasks[0].release();
         m_pendingTasks.remove(0);
         task->performTask(this);
     }
index c61afaebfbe76c5255223c56079b66d6fcdc3597..f36b02469c427426cff59479411579d943221ac2 100644 (file)
@@ -934,7 +934,7 @@ public:
     bool isDNSPrefetchEnabled() const { return m_isDNSPrefetchEnabled; }
     void parseDNSPrefetchControlHeader(const String&);
 
-    virtual void postTask(std::unique_ptr<Task>) OVERRIDE; // Executes the task on context's thread asynchronously.
+    virtual void postTask(PassOwnPtr<Task>) OVERRIDE; // Executes the task on context's thread asynchronously.
 
     void suspendScriptedAnimationControllerCallbacks();
     void resumeScriptedAnimationControllerCallbacks();
@@ -1518,7 +1518,7 @@ private:
 #endif
 
     Timer<Document> m_pendingTasksTimer;
-    Vector<std::unique_ptr<Task>> m_pendingTasks;
+    Vector<OwnPtr<Task> > m_pendingTasks;
 
 #if ENABLE(IOS_TEXT_AUTOSIZING)
 public:
index ce9c742add7f8f2e908ab8a418b98852c9b5b2e2..f748ac9e0f9504b9931e72a9e59ee57321a8d46b 100644 (file)
@@ -51,12 +51,12 @@ namespace WebCore {
 
 class ProcessMessagesSoonTask : public ScriptExecutionContext::Task {
 public:
-    ProcessMessagesSoonTask()
+    static PassOwnPtr<ProcessMessagesSoonTask> create()
     {
+        return adoptPtr(new ProcessMessagesSoonTask);
     }
 
-private:
-    virtual void performTask(ScriptExecutionContext* context) OVERRIDE
+    virtual void performTask(ScriptExecutionContext* context)
     {
         context->dispatchMessagePortEvents();
     }
@@ -119,7 +119,7 @@ ScriptExecutionContext::~ScriptExecutionContext()
 
 void ScriptExecutionContext::processMessagePortMessagesSoon()
 {
-    postTask(std::make_unique<ProcessMessagesSoonTask>());
+    postTask(ProcessMessagesSoonTask::create());
 }
 
 void ScriptExecutionContext::dispatchMessagePortEvents()
index 8c857eac8fd4c93fb0b6cbb0ddec636e1f5d1e39..87486882b9ec723dcee0c0a1eaf8a948bb60c2d8 100644 (file)
@@ -130,7 +130,7 @@ public:
         virtual bool isCleanupTask() const { return false; }
     };
 
-    virtual void postTask(std::unique_ptr<Task>) = 0; // Executes the task on context's thread asynchronously.
+    virtual void postTask(PassOwnPtr<Task>) = 0; // Executes the task on context's thread asynchronously.
 
     // Gets the next id in a circular sequence from 1 to 2^31-1.
     int circularSequentialID();
@@ -157,15 +157,18 @@ public:
 protected:
     class AddConsoleMessageTask : public Task {
     public:
+        static PassOwnPtr<AddConsoleMessageTask> create(MessageSource source, MessageLevel level, const String& message)
+        {
+            return adoptPtr(new AddConsoleMessageTask(source, level, message));
+        }
+        virtual void performTask(ScriptExecutionContext*) OVERRIDE;
+    private:
         AddConsoleMessageTask(MessageSource source, MessageLevel level, const String& message)
             : m_source(source)
             , m_level(level)
             , m_message(message.isolatedCopy())
         {
         }
-
-        virtual void performTask(ScriptExecutionContext*) OVERRIDE;
-
         MessageSource m_source;
         MessageLevel m_level;
         String m_message;
index 547536085c08adc3c27fd4a342fa95960d842338..c6285b1715bc672f5c9d88b1e964d15101012acf 100644 (file)
@@ -40,18 +40,23 @@ namespace {
 
 class DispatchCallbackTask : public ScriptExecutionContext::Task {
 public:
-    DispatchCallbackTask(PassRefPtr<StringCallback> callback, const String& data)
-        : m_callback(callback)
-        , m_data(data)
+    static PassOwnPtr<DispatchCallbackTask> create(PassRefPtr<StringCallback> callback, const String& data)
     {
+        return adoptPtr(new DispatchCallbackTask(callback, data));
     }
 
-private:
-    virtual void performTask(ScriptExecutionContext*) OVERRIDE
+    virtual void performTask(ScriptExecutionContext*)
     {
         m_callback->handleEvent(m_data);
     }
 
+private:
+    DispatchCallbackTask(PassRefPtr<StringCallback> callback, const String& data)
+        : m_callback(callback)
+        , m_data(data)
+    {
+    }
+
     RefPtr<StringCallback> m_callback;
     const String m_data;
 };
@@ -60,7 +65,7 @@ private:
 
 void StringCallback::scheduleCallback(ScriptExecutionContext* context, const String& data)
 {
-    context->postTask(std::make_unique<DispatchCallbackTask>(this, data));
+    context->postTask(DispatchCallbackTask::create(this, data));
 }
 
 } // namespace WebCore
index 482264bb270ab8b6897029964760b373cc15773e..7357b45fa6aa7d0cd11370c45fa637db3ef80556 100644 (file)
@@ -1119,15 +1119,11 @@ void ApplicationCacheGroup::scheduleReachedMaxAppCacheSizeCallback()
 
 class CallCacheListenerTask : public ScriptExecutionContext::Task {
 public:
-    CallCacheListenerTask(PassRefPtr<DocumentLoader> loader, ApplicationCacheHost::EventID eventID, int progressTotal, int progressDone)
-        : m_documentLoader(loader)
-        , m_eventID(eventID)
-        , m_progressTotal(progressTotal)
-        , m_progressDone(progressDone)
+    static PassOwnPtr<CallCacheListenerTask> create(PassRefPtr<DocumentLoader> loader, ApplicationCacheHost::EventID eventID, int progressTotal, int progressDone)
     {
+        return adoptPtr(new CallCacheListenerTask(loader, eventID, progressTotal, progressDone));
     }
 
-private:
     virtual void performTask(ScriptExecutionContext* context) OVERRIDE
     {
         
@@ -1141,6 +1137,15 @@ private:
         m_documentLoader->applicationCacheHost()->notifyDOMApplicationCache(m_eventID, m_progressTotal, m_progressDone);
     }
 
+private:
+    CallCacheListenerTask(PassRefPtr<DocumentLoader> loader, ApplicationCacheHost::EventID eventID, int progressTotal, int progressDone)
+        : m_documentLoader(loader)
+        , m_eventID(eventID)
+        , m_progressTotal(progressTotal)
+        , m_progressDone(progressDone)
+    {
+    }
+
     RefPtr<DocumentLoader> m_documentLoader;
     ApplicationCacheHost::EventID m_eventID;
     int m_progressTotal;
@@ -1162,7 +1167,7 @@ void ApplicationCacheGroup::postListenerTask(ApplicationCacheHost::EventID event
     
     ASSERT(frame->loader().documentLoader() == loader);
 
-    frame->document()->postTask(std::make_unique<CallCacheListenerTask>(loader, eventID, progressTotal, progressDone));
+    frame->document()->postTask(CallCacheListenerTask::create(loader, eventID, progressTotal, progressDone));
 }
 
 void ApplicationCacheGroup::setUpdateStatus(UpdateStatus status)
index a48d0bb275e811f264fcfc9b75dcebe804923d80..5c26c8c6101526c272f8d86429dfba3ad60f1061 100644 (file)
@@ -79,8 +79,8 @@ public:
     bool matches(const String& name, PassRefPtr<SecurityOrigin> origin, const URL& urlToMatch) const;
 
     // WorkerLoaderProxy
-    virtual void postTaskToLoader(std::unique_ptr<ScriptExecutionContext::Task>) OVERRIDE;
-    virtual bool postTaskForModeToWorkerGlobalScope(std::unique_ptr<ScriptExecutionContext::Task>, const String&) OVERRIDE;
+    virtual void postTaskToLoader(PassOwnPtr<ScriptExecutionContext::Task>);
+    virtual bool postTaskForModeToWorkerGlobalScope(PassOwnPtr<ScriptExecutionContext::Task>, const String&);
 
     // WorkerReportingProxy
     virtual void postExceptionToWorkerObject(const String& errorMessage, int lineNumber, int columnNumber, const String& sourceURL);
@@ -140,7 +140,7 @@ bool SharedWorkerProxy::matches(const String& name, PassRefPtr<SecurityOrigin> o
     return name == m_name;
 }
 
-void SharedWorkerProxy::postTaskToLoader(std::unique_ptr<ScriptExecutionContext::Task> task)
+void SharedWorkerProxy::postTaskToLoader(PassOwnPtr<ScriptExecutionContext::Task> task)
 {
     MutexLocker lock(m_workerDocumentsLock);
 
@@ -153,15 +153,15 @@ void SharedWorkerProxy::postTaskToLoader(std::unique_ptr<ScriptExecutionContext:
     // Just pick an arbitrary active document from the HashSet and pass load requests to it.
     // FIXME: Do we need to deal with the case where the user closes the document mid-load, via a shadow document or some other solution?
     Document* document = *(m_workerDocuments.begin());
-    document->postTask(std::move(task));
+    document->postTask(task);
 }
 
-bool SharedWorkerProxy::postTaskForModeToWorkerGlobalScope(std::unique_ptr<ScriptExecutionContext::Task> task, const String& mode)
+bool SharedWorkerProxy::postTaskForModeToWorkerGlobalScope(PassOwnPtr<ScriptExecutionContext::Task> task, const String& mode)
 {
     if (isClosing())
         return false;
     ASSERT(m_thread);
-    m_thread->runLoop().postTaskForMode(std::move(task), mode);
+    m_thread->runLoop().postTaskForMode(task, mode);
     return true;
 }
 
@@ -259,13 +259,18 @@ void SharedWorkerProxy::close()
 
 class SharedWorkerConnectTask : public ScriptExecutionContext::Task {
 public:
+    static PassOwnPtr<SharedWorkerConnectTask> create(PassOwnPtr<MessagePortChannel> channel)
+    {
+        return adoptPtr(new SharedWorkerConnectTask(channel));
+    }
+
+private:
     SharedWorkerConnectTask(PassOwnPtr<MessagePortChannel> channel)
         : m_channel(channel)
     {
     }
 
-private:
-    virtual void performTask(ScriptExecutionContext* scriptContext) OVERRIDE
+    virtual void performTask(ScriptExecutionContext* scriptContext)
     {
         RefPtr<MessagePort> port = MessagePort::create(*scriptContext);
         port->entangle(m_channel.release());
@@ -365,7 +370,7 @@ void DefaultSharedWorkerRepository::workerScriptLoaded(SharedWorkerProxy& proxy,
         proxy.setThread(thread);
         thread->start();
     }
-    proxy.thread()->runLoop().postTask(std::make_unique<SharedWorkerConnectTask>(port));
+    proxy.thread()->runLoop().postTask(SharedWorkerConnectTask::create(port));
 }
 
 bool DefaultSharedWorkerRepository::hasSharedWorkers(Document* document)
@@ -413,7 +418,7 @@ void DefaultSharedWorkerRepository::connectToWorker(PassRefPtr<SharedWorker> wor
     }
     // If proxy is already running, just connect to it - otherwise, kick off a loader to load the script.
     if (proxy->thread())
-        proxy->thread()->runLoop().postTask(std::make_unique<SharedWorkerConnectTask>(port));
+        proxy->thread()->runLoop().postTask(SharedWorkerConnectTask::create(port));
     else {
         RefPtr<SharedWorkerScriptLoader> loader = adoptRef(new SharedWorkerScriptLoader(worker, port, proxy.release()));
         loader->load(url);
index d4cddea81d4143ab2a3797601b5a623313b2f02f..0cc4789b306d9b148a9cd21747e089215b958637 100644 (file)
@@ -48,11 +48,9 @@ WorkerEventQueue::~WorkerEventQueue()
 
 class WorkerEventQueue::EventDispatcherTask FINAL : public ScriptExecutionContext::Task {
 public:
-    EventDispatcherTask(PassRefPtr<Event> event, WorkerEventQueue& eventQueue)
-        : m_event(event)
-        , m_eventQueue(eventQueue)
-        , m_isCancelled(false)
+    static PassOwnPtr<EventDispatcherTask> create(PassRefPtr<Event> event, WorkerEventQueue& eventQueue)
     {
+        return adoptPtr(new EventDispatcherTask(event, eventQueue));
     }
 
     virtual ~EventDispatcherTask()
@@ -61,13 +59,11 @@ public:
             m_eventQueue.m_eventTaskMap.remove(m_event.get());
     }
 
-    void cancel()
+    void dispatchEvent(ScriptExecutionContext*, PassRefPtr<Event> event)
     {
-        m_isCancelled = true;
-        m_event.clear();
+        event->target()->dispatchEvent(event);
     }
 
-private:
     virtual void performTask(ScriptExecutionContext* context) OVERRIDE
     {
         if (m_isCancelled)
@@ -77,9 +73,18 @@ private:
         m_event.clear();
     }
 
-    void dispatchEvent(ScriptExecutionContext*, PassRefPtr<Event> event)
+    void cancel()
+    {
+        m_isCancelled = true;
+        m_event.clear();
+    }
+
+private:
+    EventDispatcherTask(PassRefPtr<Event> event, WorkerEventQueue& eventQueue)
+        : m_event(event)
+        , m_eventQueue(eventQueue)
+        , m_isCancelled(false)
     {
-        event->target()->dispatchEvent(event);
     }
 
     RefPtr<Event> m_event;
@@ -92,9 +97,9 @@ bool WorkerEventQueue::enqueueEvent(PassRefPtr<Event> prpEvent)
     if (m_isClosed)
         return false;
     RefPtr<Event> event = prpEvent;
-    auto task = std::make_unique<EventDispatcherTask>(event, *this);
+    OwnPtr<EventDispatcherTask> task = EventDispatcherTask::create(event, *this);
     m_eventTaskMap.add(event.release(), task.get());
-    m_scriptExecutionContext.postTask(std::move(task));
+    m_scriptExecutionContext.postTask(task.release());
     return true;
 }
 
index ce3b4cac2b798f5d2eade6a101007aeb47334910..293797405d5149a7d5d7702b66853a8f3c5e9d8a 100644 (file)
@@ -153,7 +153,7 @@ void WorkerGlobalScope::close()
     // After m_closing is set, all the tasks in the queue continue to be fetched but only
     // tasks with isCleanupTask()==true will be executed.
     m_closing = true;
-    postTask(std::make_unique<CloseWorkerGlobalScopeTask>());
+    postTask(CloseWorkerGlobalScopeTask::create());
 }
 
 WorkerNavigator* WorkerGlobalScope::navigator() const
@@ -180,9 +180,9 @@ bool WorkerGlobalScope::hasPendingActivity() const
     return false;
 }
 
-void WorkerGlobalScope::postTask(std::unique_ptr<Task> task)
+void WorkerGlobalScope::postTask(PassOwnPtr<Task> task)
 {
-    thread()->runLoop().postTask(std::move(task));
+    thread()->runLoop().postTask(task);
 }
 
 int WorkerGlobalScope::setTimeout(PassOwnPtr<ScheduledAction> action, int timeout)
@@ -265,7 +265,7 @@ void WorkerGlobalScope::logExceptionToConsole(const String& errorMessage, const
 void WorkerGlobalScope::addConsoleMessage(MessageSource source, MessageLevel level, const String& message, unsigned long requestIdentifier)
 {
     if (!isContextThread()) {
-        postTask(std::make_unique<AddConsoleMessageTask>(source, level, message));
+        postTask(AddConsoleMessageTask::create(source, level, message));
         return;
     }
 
@@ -276,7 +276,7 @@ void WorkerGlobalScope::addConsoleMessage(MessageSource source, MessageLevel lev
 void WorkerGlobalScope::addMessage(MessageSource source, MessageLevel level, const String& message, const String& sourceURL, unsigned lineNumber, unsigned columnNumber, PassRefPtr<ScriptCallStack> callStack, JSC::ExecState* state, unsigned long requestIdentifier)
 {
     if (!isContextThread()) {
-        postTask(std::make_unique<AddConsoleMessageTask>(source, level, message));
+        postTask(AddConsoleMessageTask::create(source, level, message));
         return;
     }
 
index c5ab7f3150e995b5158463f94ac6a4c804244314..2532b926dd33f613d117b23ce841ba1acc045fc4 100644 (file)
@@ -83,7 +83,7 @@ namespace WebCore {
 
         bool hasPendingActivity() const;
 
-        virtual void postTask(std::unique_ptr<Task>) OVERRIDE; // Executes the task on context's thread asynchronously.
+        virtual void postTask(PassOwnPtr<Task>) OVERRIDE; // Executes the task on context's thread asynchronously.
 
         // WorkerGlobalScope
         WorkerGlobalScope* self() { return this; }
index 30485a46febbf3f665832eae998d873944ebbd73..18542b6fe755f20f64a65f529ec0488424e6a48a 100644 (file)
@@ -49,12 +49,12 @@ namespace WebCore {
         virtual ~WorkerLoaderProxy() { }
 
         // Posts a task to the thread which runs the loading code (normally, the main thread).
-        virtual void postTaskToLoader(std::unique_ptr<ScriptExecutionContext::Task>) = 0;
+        virtual void postTaskToLoader(PassOwnPtr<ScriptExecutionContext::Task>) = 0;
 
         // Posts callbacks from loading code to the WorkerGlobalScope. The 'mode' is used to differentiate
         // specific synchronous loading requests so they can be 'nested', per spec.
         // Returns true if the task was posted successfully.
-        virtual bool postTaskForModeToWorkerGlobalScope(std::unique_ptr<ScriptExecutionContext::Task>, const String& mode) = 0;
+        virtual bool postTaskForModeToWorkerGlobalScope(PassOwnPtr<ScriptExecutionContext::Task>, const String& mode) = 0;
     };
 
 } // namespace WebCore
index caad353fc4bcfecff09b418126642c88ee80f952..02ebc651cd6b8a686cd5207b7d46f0fdc361966e 100644 (file)
@@ -56,14 +56,19 @@ namespace WebCore {
 
 class MessageWorkerGlobalScopeTask : public ScriptExecutionContext::Task {
 public:
+    static PassOwnPtr<MessageWorkerGlobalScopeTask> create(PassRefPtr<SerializedScriptValue> message, PassOwnPtr<MessagePortChannelArray> channels)
+    {
+        return adoptPtr(new MessageWorkerGlobalScopeTask(message, channels));
+    }
+
+private:
     MessageWorkerGlobalScopeTask(PassRefPtr<SerializedScriptValue> message, PassOwnPtr<MessagePortChannelArray> channels)
         : m_message(message)
         , m_channels(channels)
     {
     }
 
-private:
-    virtual void performTask(ScriptExecutionContext* scriptContext) OVERRIDE
+    virtual void performTask(ScriptExecutionContext* scriptContext)
     {
         ASSERT_WITH_SECURITY_IMPLICATION(scriptContext->isWorkerGlobalScope());
         DedicatedWorkerGlobalScope* context = static_cast<DedicatedWorkerGlobalScope*>(scriptContext);
@@ -79,6 +84,12 @@ private:
 
 class MessageWorkerTask : public ScriptExecutionContext::Task {
 public:
+    static PassOwnPtr<MessageWorkerTask> create(PassRefPtr<SerializedScriptValue> message, PassOwnPtr<MessagePortChannelArray> channels, WorkerMessagingProxy* messagingProxy)
+    {
+        return adoptPtr(new MessageWorkerTask(message, channels, messagingProxy));
+    }
+
+private:
     MessageWorkerTask(PassRefPtr<SerializedScriptValue> message, PassOwnPtr<MessagePortChannelArray> channels, WorkerMessagingProxy* messagingProxy)
         : m_message(message)
         , m_channels(channels)
@@ -86,8 +97,7 @@ public:
     {
     }
 
-private:
-    virtual void performTask(ScriptExecutionContext* scriptContext) OVERRIDE
+    virtual void performTask(ScriptExecutionContext* scriptContext)
     {
         Worker* workerObject = m_messagingProxy->workerObject();
         if (!workerObject || m_messagingProxy->askedToTerminate())
@@ -97,6 +107,7 @@ private:
         workerObject->dispatchEvent(MessageEvent::create(ports.release(), m_message));
     }
 
+private:
     RefPtr<SerializedScriptValue> m_message;
     OwnPtr<MessagePortChannelArray> m_channels;
     WorkerMessagingProxy* m_messagingProxy;
@@ -104,6 +115,12 @@ private:
 
 class WorkerExceptionTask : public ScriptExecutionContext::Task {
 public:
+    static PassOwnPtr<WorkerExceptionTask> create(const String& errorMessage, int lineNumber, int columnNumber, const String& sourceURL, WorkerMessagingProxy* messagingProxy)
+    {
+        return adoptPtr(new WorkerExceptionTask(errorMessage, lineNumber, columnNumber, sourceURL, messagingProxy));
+    }
+
+private:
     WorkerExceptionTask(const String& errorMessage, int lineNumber, int columnNumber, const String& sourceURL, WorkerMessagingProxy* messagingProxy)
         : m_errorMessage(errorMessage.isolatedCopy())
         , m_lineNumber(lineNumber)
@@ -113,8 +130,7 @@ public:
     {
     }
 
-private:
-    virtual void performTask(ScriptExecutionContext* context) OVERRIDE
+    virtual void performTask(ScriptExecutionContext* context)
     {
         Worker* workerObject = m_messagingProxy->workerObject();
         if (!workerObject)
@@ -137,13 +153,18 @@ private:
 
 class WorkerGlobalScopeDestroyedTask : public ScriptExecutionContext::Task {
 public:
+    static PassOwnPtr<WorkerGlobalScopeDestroyedTask> create(WorkerMessagingProxy* messagingProxy)
+    {
+        return adoptPtr(new WorkerGlobalScopeDestroyedTask(messagingProxy));
+    }
+
+private:
     WorkerGlobalScopeDestroyedTask(WorkerMessagingProxy* messagingProxy)
         : m_messagingProxy(messagingProxy)
     {
     }
 
-private:
-    virtual void performTask(ScriptExecutionContext*) OVERRIDE
+    virtual void performTask(ScriptExecutionContext*)
     {
         m_messagingProxy->workerGlobalScopeDestroyedInternal();
     }
@@ -153,13 +174,18 @@ private:
 
 class WorkerTerminateTask : public ScriptExecutionContext::Task {
 public:
-    explicit WorkerTerminateTask(WorkerMessagingProxy* messagingProxy)
-        : m_messagingProxy(messagingProxy)
+    static PassOwnPtr<WorkerTerminateTask> create(WorkerMessagingProxy* messagingProxy)
     {
+        return adoptPtr(new WorkerTerminateTask(messagingProxy));
     }
 
 private:
-    virtual void performTask(ScriptExecutionContext*) OVERRIDE
+    WorkerTerminateTask(WorkerMessagingProxy* messagingProxy)
+        : m_messagingProxy(messagingProxy)
+    {
+    }
+
+    virtual void performTask(ScriptExecutionContext*)
     {
         m_messagingProxy->terminateWorkerGlobalScope();
     }
@@ -169,6 +195,12 @@ private:
 
 class WorkerThreadActivityReportTask : public ScriptExecutionContext::Task {
 public:
+    static PassOwnPtr<WorkerThreadActivityReportTask> create(WorkerMessagingProxy* messagingProxy, bool confirmingMessage, bool hasPendingActivity)
+    {
+        return adoptPtr(new WorkerThreadActivityReportTask(messagingProxy, confirmingMessage, hasPendingActivity));
+    }
+
+private:
     WorkerThreadActivityReportTask(WorkerMessagingProxy* messagingProxy, bool confirmingMessage, bool hasPendingActivity)
         : m_messagingProxy(messagingProxy)
         , m_confirmingMessage(confirmingMessage)
@@ -176,8 +208,7 @@ public:
     {
     }
 
-private:
-    virtual void performTask(ScriptExecutionContext*) OVERRIDE
+    virtual void performTask(ScriptExecutionContext*)
     {
         m_messagingProxy->reportPendingActivityInternal(m_confirmingMessage, m_hasPendingActivity);
     }
@@ -189,14 +220,19 @@ private:
 
 class PostMessageToPageInspectorTask : public ScriptExecutionContext::Task {
 public:
+    static PassOwnPtr<PostMessageToPageInspectorTask> create(WorkerMessagingProxy* messagingProxy, const String& message)
+    {
+        return adoptPtr(new PostMessageToPageInspectorTask(messagingProxy, message));
+    }
+
+private:
     PostMessageToPageInspectorTask(WorkerMessagingProxy* messagingProxy, const String& message)
         : m_messagingProxy(messagingProxy)
         , m_message(message.isolatedCopy())
     {
     }
 
-private:
-    virtual void performTask(ScriptExecutionContext*) OVERRIDE
+    virtual void performTask(ScriptExecutionContext*)
     {
 #if ENABLE(INSPECTOR)
         if (WorkerGlobalScopeProxy::PageInspector* pageInspector = m_messagingProxy->m_pageInspector)
@@ -210,13 +246,18 @@ private:
 
 class NotifyNetworkStateChangeTask : public ScriptExecutionContext::Task {
 public:
-    explicit NotifyNetworkStateChangeTask(bool isOnLine)
-        : m_isOnLine(isOnLine)
+    static PassOwnPtr<NotifyNetworkStateChangeTask> create(bool isOnLine)
     {
+        return adoptPtr(new NotifyNetworkStateChangeTask(isOnLine));
     }
 
 private:
-    virtual void performTask(ScriptExecutionContext *context) OVERRIDE
+    NotifyNetworkStateChangeTask(bool isOnLine)
+        : m_isOnLine(isOnLine)
+    {
+    }
+
+    virtual void performTask(ScriptExecutionContext *context)
     {
         AtomicString eventName = m_isOnLine ? eventNames().onlineEvent : eventNames().offlineEvent;
         WorkerGlobalScope* workerGlobalScope = static_cast<WorkerGlobalScope*>(context);
@@ -271,7 +312,7 @@ void WorkerMessagingProxy::startWorkerGlobalScope(const URL& scriptURL, const St
 
 void WorkerMessagingProxy::postMessageToWorkerObject(PassRefPtr<SerializedScriptValue> message, PassOwnPtr<MessagePortChannelArray> channels)
 {
-    m_scriptExecutionContext->postTask(std::make_unique<MessageWorkerTask>(message, channels, this));
+    m_scriptExecutionContext->postTask(MessageWorkerTask::create(message, channels, this));
 }
 
 void WorkerMessagingProxy::postMessageToWorkerGlobalScope(PassRefPtr<SerializedScriptValue> message, PassOwnPtr<MessagePortChannelArray> channels)
@@ -281,31 +322,31 @@ void WorkerMessagingProxy::postMessageToWorkerGlobalScope(PassRefPtr<SerializedS
 
     if (m_workerThread) {
         ++m_unconfirmedMessageCount;
-        m_workerThread->runLoop().postTask(std::make_unique<MessageWorkerGlobalScopeTask>(message, channels));
+        m_workerThread->runLoop().postTask(MessageWorkerGlobalScopeTask::create(message, channels));
     } else
-        m_queuedEarlyTasks.append(std::make_unique<MessageWorkerGlobalScopeTask>(message, channels));
+        m_queuedEarlyTasks.append(MessageWorkerGlobalScopeTask::create(message, channels));
 }
 
-bool WorkerMessagingProxy::postTaskForModeToWorkerGlobalScope(std::unique_ptr<ScriptExecutionContext::Task> task, const String& mode)
+bool WorkerMessagingProxy::postTaskForModeToWorkerGlobalScope(PassOwnPtr<ScriptExecutionContext::Task> task, const String& mode)
 {
     if (m_askedToTerminate)
         return false;
 
     ASSERT(m_workerThread);
-    m_workerThread->runLoop().postTaskForMode(std::move(task), mode);
+    m_workerThread->runLoop().postTaskForMode(task, mode);
     return true;
 }
 
-void WorkerMessagingProxy::postTaskToLoader(std::unique_ptr<ScriptExecutionContext::Task> task)
+void WorkerMessagingProxy::postTaskToLoader(PassOwnPtr<ScriptExecutionContext::Task> task)
 {
     // FIXME: In case of nested workers, this should go directly to the root Document context.
     ASSERT(m_scriptExecutionContext->isDocument());
-    m_scriptExecutionContext->postTask(std::move(task));
+    m_scriptExecutionContext->postTask(task);
 }
 
 void WorkerMessagingProxy::postExceptionToWorkerObject(const String& errorMessage, int lineNumber, int columnNumber, const String& sourceURL)
 {
-    m_scriptExecutionContext->postTask(std::make_unique<WorkerExceptionTask>(errorMessage, lineNumber, columnNumber, sourceURL, this));
+    m_scriptExecutionContext->postTask(WorkerExceptionTask::create(errorMessage, lineNumber, columnNumber, sourceURL, this));
 }
 
 static void postConsoleMessageTask(ScriptExecutionContext* context, WorkerMessagingProxy* messagingProxy, MessageSource source, MessageLevel level, const String& message, unsigned lineNumber, unsigned columnNumber, const String& sourceURL)
@@ -334,7 +375,7 @@ void WorkerMessagingProxy::workerThreadCreated(PassRefPtr<DedicatedWorkerThread>
         m_workerThreadHadPendingActivity = true; // Worker initialization means a pending activity.
 
         for (unsigned i = 0; i < taskCount; ++i)
-            m_workerThread->runLoop().postTask(std::move(m_queuedEarlyTasks[i]));
+            m_workerThread->runLoop().postTask(m_queuedEarlyTasks[i].release());
         m_queuedEarlyTasks.clear();
     }
 }
@@ -353,7 +394,7 @@ void WorkerMessagingProxy::notifyNetworkStateChange(bool isOnline)
     if (!m_workerThread)
         return;
 
-    m_workerThread->runLoop().postTask(std::make_unique<NotifyNetworkStateChangeTask>(isOnline));
+    m_workerThread->runLoop().postTask(NotifyNetworkStateChangeTask::create(isOnline));
 }
 
 void WorkerMessagingProxy::workerObjectDestroyedInternal(ScriptExecutionContext*, WorkerMessagingProxy* proxy)
@@ -424,14 +465,14 @@ void WorkerMessagingProxy::sendMessageToInspector(const String& message)
 
 void WorkerMessagingProxy::workerGlobalScopeDestroyed()
 {
-    m_scriptExecutionContext->postTask(std::make_unique<WorkerGlobalScopeDestroyedTask>(this));
+    m_scriptExecutionContext->postTask(WorkerGlobalScopeDestroyedTask::create(this));
     // Will execute workerGlobalScopeDestroyedInternal() on context's thread.
 }
 
 void WorkerMessagingProxy::workerGlobalScopeClosed()
 {
     // Executes terminateWorkerGlobalScope() on parent context's thread.
-    m_scriptExecutionContext->postTask(std::make_unique<WorkerTerminateTask>(this));
+    m_scriptExecutionContext->postTask(WorkerTerminateTask::create(this));
 }
 
 void WorkerMessagingProxy::workerGlobalScopeDestroyedInternal()
@@ -462,7 +503,7 @@ void WorkerMessagingProxy::terminateWorkerGlobalScope()
 #if ENABLE(INSPECTOR)
 void WorkerMessagingProxy::postMessageToPageInspector(const String& message)
 {
-    m_scriptExecutionContext->postTask(std::make_unique<PostMessageToPageInspectorTask>(this, message));
+    m_scriptExecutionContext->postTask(PostMessageToPageInspectorTask::create(this, message));
 }
 
 void WorkerMessagingProxy::updateInspectorStateCookie(const String&)
@@ -473,13 +514,13 @@ void WorkerMessagingProxy::updateInspectorStateCookie(const String&)
 
 void WorkerMessagingProxy::confirmMessageFromWorkerObject(bool hasPendingActivity)
 {
-    m_scriptExecutionContext->postTask(std::make_unique<WorkerThreadActivityReportTask>(this, true, hasPendingActivity));
+    m_scriptExecutionContext->postTask(WorkerThreadActivityReportTask::create(this, true, hasPendingActivity));
     // Will execute reportPendingActivityInternal() on context's thread.
 }
 
 void WorkerMessagingProxy::reportPendingActivity(bool hasPendingActivity)
 {
-    m_scriptExecutionContext->postTask(std::make_unique<WorkerThreadActivityReportTask>(this, false, hasPendingActivity));
+    m_scriptExecutionContext->postTask(WorkerThreadActivityReportTask::create(this, false, hasPendingActivity));
     // Will execute reportPendingActivityInternal() on context's thread.
 }
 
index 34389f29b4f72b508ee830e6b67245009ebe07de..1896a813504ac18abacdd1fac0319069dff75a61 100644 (file)
@@ -82,8 +82,8 @@ namespace WebCore {
         // Implementation of WorkerLoaderProxy.
         // These methods are called on different threads to schedule loading
         // requests and to send callbacks back to WorkerGlobalScope.
-        virtual void postTaskToLoader(std::unique_ptr<ScriptExecutionContext::Task>) OVERRIDE;
-        virtual bool postTaskForModeToWorkerGlobalScope(std::unique_ptr<ScriptExecutionContext::Task>, const String& mode) OVERRIDE;
+        virtual void postTaskToLoader(PassOwnPtr<ScriptExecutionContext::Task>) OVERRIDE;
+        virtual bool postTaskForModeToWorkerGlobalScope(PassOwnPtr<ScriptExecutionContext::Task>, const String& mode) OVERRIDE;
 
         void workerThreadCreated(PassRefPtr<DedicatedWorkerThread>);
 
@@ -115,7 +115,7 @@ namespace WebCore {
 
         bool m_askedToTerminate;
 
-        Vector<std::unique_ptr<ScriptExecutionContext::Task>> m_queuedEarlyTasks; // Tasks are queued here until there's a thread object created.
+        Vector<OwnPtr<ScriptExecutionContext::Task> > m_queuedEarlyTasks; // Tasks are queued here until there's a thread object created.
 #if ENABLE(INSPECTOR)
         WorkerGlobalScopeProxy::PageInspector* m_pageInspector;
 #endif
index 0dbfb5821e7ccf355f1f6c46922e209a6c60de48..f4a2efc8637d62fe20667c3c1cd008f9682430bf 100644 (file)
@@ -196,19 +196,24 @@ void WorkerRunLoop::terminate()
     m_messageQueue.kill();
 }
 
-void WorkerRunLoop::postTask(std::unique_ptr<ScriptExecutionContext::Task> task)
+void WorkerRunLoop::postTask(PassOwnPtr<ScriptExecutionContext::Task> task)
 {
-    postTaskForMode(std::move(task), defaultMode());
+    postTaskForMode(task, defaultMode());
 }
 
-void WorkerRunLoop::postTaskAndTerminate(std::unique_ptr<ScriptExecutionContext::Task> task)
+void WorkerRunLoop::postTaskAndTerminate(PassOwnPtr<ScriptExecutionContext::Task> task)
 {
-    m_messageQueue.appendAndKill(std::make_unique<Task>(std::move(task), defaultMode().isolatedCopy()));
+    m_messageQueue.appendAndKill(Task::create(task, defaultMode().isolatedCopy()));
 }
 
-void WorkerRunLoop::postTaskForMode(std::unique_ptr<ScriptExecutionContext::Task> task, const String& mode)
+void WorkerRunLoop::postTaskForMode(PassOwnPtr<ScriptExecutionContext::Task> task, const String& mode)
 {
-    m_messageQueue.append(std::make_unique<Task>(std::move(task), mode.isolatedCopy()));
+    m_messageQueue.append(Task::create(task, mode.isolatedCopy()));
+}
+
+std::unique_ptr<WorkerRunLoop::Task> WorkerRunLoop::Task::create(PassOwnPtr<ScriptExecutionContext::Task> task, const String& mode)
+{
+    return std::unique_ptr<Task>(new Task(task, mode));
 }
 
 void WorkerRunLoop::Task::performTask(const WorkerRunLoop& runLoop, ScriptExecutionContext* context)
@@ -218,8 +223,8 @@ void WorkerRunLoop::Task::performTask(const WorkerRunLoop& runLoop, ScriptExecut
         m_task->performTask(context);
 }
 
-WorkerRunLoop::Task::Task(std::unique_ptr<ScriptExecutionContext::Task> task, const String& mode)
-    : m_task(std::move(task))
+WorkerRunLoop::Task::Task(PassOwnPtr<ScriptExecutionContext::Task> task, const String& mode)
+    : m_task(task)
     , m_mode(mode.isolatedCopy())
 {
 }
index 1468dcfad00096533a72c816eff84533ba172bc8..3dee5a53f1da25f97c522c5b64ce9a6633c764ce 100644 (file)
@@ -60,9 +60,9 @@ namespace WebCore {
         void terminate();
         bool terminated() const { return m_messageQueue.killed(); }
 
-        void postTask(std::unique_ptr<ScriptExecutionContext::Task>);
-        void postTaskAndTerminate(std::unique_ptr<ScriptExecutionContext::Task>);
-        void postTaskForMode(std::unique_ptr<ScriptExecutionContext::Task>, const String& mode);
+        void postTask(PassOwnPtr<ScriptExecutionContext::Task>);
+        void postTaskAndTerminate(PassOwnPtr<ScriptExecutionContext::Task>);
+        void postTaskForMode(PassOwnPtr<ScriptExecutionContext::Task>, const String& mode);
 
         unsigned long createUniqueId() { return ++m_uniqueId; }
 
@@ -71,15 +71,15 @@ namespace WebCore {
         class Task {
             WTF_MAKE_NONCOPYABLE(Task); WTF_MAKE_FAST_ALLOCATED;
         public:
-            Task(std::unique_ptr<ScriptExecutionContext::Task>, const String& mode);
+            static std::unique_ptr<Task> create(PassOwnPtr<ScriptExecutionContext::Task>, const String& mode);
             ~Task() { }
-
             const String& mode() const { return m_mode; }
             void performTask(const WorkerRunLoop&, ScriptExecutionContext*);
 
         private:
-
-            std::unique_ptr<ScriptExecutionContext::Task> m_task;
+            Task(PassOwnPtr<ScriptExecutionContext::Task> task, const String& mode);
+        
+            OwnPtr<ScriptExecutionContext::Task> m_task;
             String m_mode;
         };
 
index b87cf728d06201a486165a5df804ac21ccc10ba1..6733d1410832f5436bf47d081f97af1effd3f496 100644 (file)
@@ -190,12 +190,12 @@ void WorkerThread::runEventLoop()
 
 class WorkerThreadShutdownFinishTask : public ScriptExecutionContext::Task {
 public:
-    WorkerThreadShutdownFinishTask()
+    static PassOwnPtr<WorkerThreadShutdownFinishTask> create()
     {
+        return adoptPtr(new WorkerThreadShutdownFinishTask());
     }
 
-private:
-    virtual void performTask(ScriptExecutionContext *context) OVERRIDE
+    virtual void performTask(ScriptExecutionContext *context)
     {
         ASSERT_WITH_SECURITY_IMPLICATION(context->isWorkerGlobalScope());
         WorkerGlobalScope* workerGlobalScope = static_cast<WorkerGlobalScope*>(context);
@@ -206,7 +206,7 @@ private:
         workerGlobalScope->clearScript();
     }
 
-    virtual bool isCleanupTask() const OVERRIDE { return true; }
+    virtual bool isCleanupTask() const { return true; }
 };
 
 class WorkerThreadShutdownStartTask : public ScriptExecutionContext::Task {
@@ -243,7 +243,7 @@ public:
 
         // Stick a shutdown command at the end of the queue, so that we deal
         // with all the cleanup tasks the databases post first.
-        workerGlobalScope->postTask(std::make_unique<WorkerThreadShutdownFinishTask>());
+        workerGlobalScope->postTask(WorkerThreadShutdownFinishTask::create());
     }
 
     virtual bool isCleanupTask() const { return true; }
@@ -261,7 +261,7 @@ void WorkerThread::stop()
 #if ENABLE(SQL_DATABASE)
         DatabaseManager::manager().interruptAllDatabasesForContext(m_workerGlobalScope.get());
 #endif
-        m_runLoop.postTaskAndTerminate(std::make_unique<WorkerThreadShutdownFinishTask>());
+        m_runLoop.postTaskAndTerminate(WorkerThreadShutdownStartTask::create());
         return;
     }
     m_runLoop.terminate();
@@ -275,9 +275,9 @@ void WorkerThread::releaseFastMallocFreeMemoryInAllThreads()
 {
     MutexLocker lock(threadSetMutex());
     HashSet<WorkerThread*>& threads = workerThreads();
-
-    for (auto it = threads.begin(), end = threads.end(); it != end; ++it)
-        (*it)->runLoop().postTask(std::make_unique<ReleaseFastMallocFreeMemoryTask>());
+    HashSet<WorkerThread*>::iterator end = threads.end();
+    for (HashSet<WorkerThread*>::iterator it = threads.begin(); it != end; ++it)
+        (*it)->runLoop().postTask(adoptPtr(new ReleaseFastMallocFreeMemoryTask));
 }
 
 } // namespace WebCore