Make createCrossThreadTask() functions return on the stack instead of the heap.
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 31 May 2016 19:33:22 +0000 (19:33 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 31 May 2016 19:33:22 +0000 (19:33 +0000)
commit3f7cc4daf090b2d9781561ee096717a7824db75d
tree84db4583bcb964f22e254953b6139cdf9d5180fe
parent02ad010f5d83a5e02ac582b406873b49c23b9d4e
Make createCrossThreadTask() functions return on the stack instead of the heap.
https://bugs.webkit.org/show_bug.cgi?id=158215

Reviewed by Darin Adler.

Source/WebCore:

No new tests (Refactor, no change in behavior).

* Modules/indexeddb/client/IDBConnectionProxy.h:

* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::postDatabaseTask):
(WebCore::IDBServer::IDBServer::postDatabaseTaskReply):
(WebCore::IDBServer::IDBServer::databaseRunLoop):
* Modules/indexeddb/server/IDBServer.h:

* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::postDatabaseTask):
(WebCore::IDBServer::UniqueIDBDatabase::postDatabaseTaskReply):
* Modules/indexeddb/server/UniqueIDBDatabase.h:

* dom/ScriptExecutionContext.h:
(WebCore::ScriptExecutionContext::postCrossThreadTask):

* fileapi/ThreadableBlobRegistry.cpp:
(WebCore::threadableQueue):

Source/WebKit2:

* DatabaseProcess/DatabaseProcess.cpp:
(WebKit::DatabaseProcess::postDatabaseTask):
(WebKit::DatabaseProcess::performNextDatabaseTask):
(WebKit::DatabaseProcess::fetchWebsiteData):
* DatabaseProcess/DatabaseProcess.h:

Source/WTF:

* WTF.xcodeproj/project.pbxproj:

* wtf/CrossThreadCopier.cpp:

* wtf/CrossThreadQueue.h: Added. A lightweight of MessageQueue that deals directly
  in objects instead of in std::unique_ptrs.
(WTF::CrossThreadQueue::isKilled):
(WTF::CrossThreadQueue<DataType>::append):
(WTF::CrossThreadQueue<DataType>::waitForMessage):
(WTF::CrossThreadQueue<DataType>::tryGetMessage):

* wtf/CrossThreadTask.h:
(WTF::createCrossThreadTask):
(WTF::CrossThreadTask::CrossThreadTask): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@201518 268f45cc-cd09-0410-ab3c-d52691b4dbfc
16 files changed:
Source/WTF/ChangeLog
Source/WTF/WTF.xcodeproj/project.pbxproj
Source/WTF/wtf/CrossThreadCopier.cpp
Source/WTF/wtf/CrossThreadQueue.h [new file with mode: 0644]
Source/WTF/wtf/CrossThreadTask.h
Source/WebCore/ChangeLog
Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.h
Source/WebCore/Modules/indexeddb/server/IDBServer.cpp
Source/WebCore/Modules/indexeddb/server/IDBServer.h
Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp
Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h
Source/WebCore/dom/ScriptExecutionContext.h
Source/WebCore/fileapi/ThreadableBlobRegistry.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/DatabaseProcess/DatabaseProcess.cpp
Source/WebKit2/DatabaseProcess/DatabaseProcess.h