Changeset 245871 in webkit
- Timestamp:
- May 29, 2019 3:07:24 PM (5 years ago)
- Location:
- trunk/Source
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r245868 r245871 1 2019-05-29 David Kilzer <ddkilzer@apple.com> 2 3 IndexedDatabase Server thread in com.apple.WebKit.Networking process leaks objects into an autoreleasePool that's never cleared 4 <https://webkit.org/b/198346> 5 <rdar://problem/50895658> 6 7 Reviewed by Brent Fulgham. 8 9 * wtf/CrossThreadTaskHandler.cpp: 10 (WTF::CrossThreadTaskHandler::CrossThreadTaskHandler): 11 - Add optional second argument to enable use of an 12 AutodrainedPool when running the runloop. 13 (WTF::CrossThreadTaskHandler::taskRunLoop): 14 - Create an AutodrainedPool if requested when 15 CrossThreadTaskHandler was created. 16 * wtf/CrossThreadTaskHandler.h: 17 (WTF::CrossThreadTaskHandler::AutodrainedPoolForRunLoop): 18 - Add enum class for enabling an AutodrainedPool for 19 CrossThreadTaskHandler::taskRunLoop(). 20 (WTF::CrossThreadTaskHandler::CrossThreadTaskHandler): 21 - Add optional second argument to enable use of an 22 AutodrainedPool when running the runloop. 23 1 24 2019-05-29 Geoffrey Garen <ggaren@apple.com> 2 25 -
trunk/Source/WTF/wtf/CrossThreadTaskHandler.cpp
r244687 r245871 27 27 #include <wtf/CrossThreadTaskHandler.h> 28 28 29 #include <wtf/AutodrainedPool.h> 30 29 31 namespace WTF { 30 32 31 CrossThreadTaskHandler::CrossThreadTaskHandler(const char* threadName) 33 CrossThreadTaskHandler::CrossThreadTaskHandler(const char* threadName, AutodrainedPoolForRunLoop useAutodrainedPool) 34 : m_useAutodrainedPool(useAutodrainedPool) 32 35 { 33 36 ASSERT(isMainThread()); … … 70 73 71 74 while (!m_taskQueue.isKilled()) { 72 m_taskQueue.waitForMessage().performTask(); 75 { 76 std::unique_ptr<AutodrainedPool> autodrainedPool = (m_useAutodrainedPool == AutodrainedPoolForRunLoop::Use) ? std::make_unique<AutodrainedPool>() : nullptr; 77 78 m_taskQueue.waitForMessage().performTask(); 79 } 73 80 74 81 Locker<Lock> shouldSuspendLocker(m_shouldSuspendLock); -
trunk/Source/WTF/wtf/CrossThreadTaskHandler.h
r244687 r245871 39 39 public: 40 40 WTF_EXPORT_PRIVATE virtual ~CrossThreadTaskHandler(); 41 enum class AutodrainedPoolForRunLoop { DoNotUse, Use }; 41 42 42 43 protected: 43 WTF_EXPORT_PRIVATE CrossThreadTaskHandler(const char* threadName );44 WTF_EXPORT_PRIVATE CrossThreadTaskHandler(const char* threadName, AutodrainedPoolForRunLoop = AutodrainedPoolForRunLoop::DoNotUse); 44 45 45 46 WTF_EXPORT_PRIVATE void postTask(CrossThreadTask&&); … … 51 52 void handleTaskRepliesOnMainThread(); 52 53 void taskRunLoop(); 54 55 AutodrainedPoolForRunLoop m_useAutodrainedPool { AutodrainedPoolForRunLoop::DoNotUse }; 53 56 54 57 Lock m_taskThreadCreationLock; -
trunk/Source/WebCore/ChangeLog
r245868 r245871 1 2019-05-29 David Kilzer <ddkilzer@apple.com> 2 3 IndexedDatabase Server thread in com.apple.WebKit.Networking process leaks objects into an autoreleasePool that's never cleared 4 <https://webkit.org/b/198346> 5 <rdar://problem/50895658> 6 7 Reviewed by Brent Fulgham. 8 9 * Modules/indexeddb/server/IDBServer.cpp: 10 (WebCore::IDBServer::IDBServer::IDBServer): 11 - Pass AutodrainedPoolForRunLoop::Use when creating 12 CrossThreadTaskHandler to fix the bug. 13 1 14 2019-05-29 Geoffrey Garen <ggaren@apple.com> 2 15 -
trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.cpp
r244687 r245871 58 58 59 59 IDBServer::IDBServer(PAL::SessionID sessionID, IDBBackingStoreTemporaryFileHandler& fileHandler, QuotaManagerGetter&& quotaManagerGetter) 60 : CrossThreadTaskHandler("IndexedDatabase Server" )60 : CrossThreadTaskHandler("IndexedDatabase Server", AutodrainedPoolForRunLoop::Use) 61 61 , m_sessionID(sessionID) 62 62 , m_backingStoreTemporaryFileHandler(fileHandler) … … 66 66 67 67 IDBServer::IDBServer(PAL::SessionID sessionID, const String& databaseDirectoryPath, IDBBackingStoreTemporaryFileHandler& fileHandler, QuotaManagerGetter&& quotaManagerGetter) 68 : CrossThreadTaskHandler("IndexedDatabase Server" )68 : CrossThreadTaskHandler("IndexedDatabase Server", AutodrainedPoolForRunLoop::Use) 69 69 , m_sessionID(sessionID) 70 70 , m_databaseDirectoryPath(databaseDirectoryPath)
Note: See TracChangeset
for help on using the changeset viewer.