Title: [139811] trunk/Source/WebCore
Revision
139811
Author
an...@apple.com
Date
2013-01-15 17:07:31 -0800 (Tue, 15 Jan 2013)

Log Message

ASSERT(!m_queue.killed() && m_threadID) hit in StorageThread::scheduleTask on low memory warning
https://bugs.webkit.org/show_bug.cgi?id=106960

Reviewed by Mark Rowe.

We were scheduling a memory clearing task to terminated StorageThreads.
        
Remove thread from the active thread list when terminate is scheduled. Add when thread is started.

* storage/StorageThread.cpp:
(WebCore::activeStorageThreads):
(WebCore::StorageThread::StorageThread):
(WebCore::StorageThread::~StorageThread):
(WebCore::StorageThread::start):
(WebCore::StorageThread::terminate):
(WebCore::StorageThread::releaseFastMallocFreeMemoryInAllThreads):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (139810 => 139811)


--- trunk/Source/WebCore/ChangeLog	2013-01-16 00:45:22 UTC (rev 139810)
+++ trunk/Source/WebCore/ChangeLog	2013-01-16 01:07:31 UTC (rev 139811)
@@ -1,3 +1,22 @@
+2013-01-15  Antti Koivisto  <an...@apple.com>
+
+        ASSERT(!m_queue.killed() && m_threadID) hit in StorageThread::scheduleTask on low memory warning
+        https://bugs.webkit.org/show_bug.cgi?id=106960
+
+        Reviewed by Mark Rowe.
+
+        We were scheduling a memory clearing task to terminated StorageThreads.
+        
+        Remove thread from the active thread list when terminate is scheduled. Add when thread is started.
+
+        * storage/StorageThread.cpp:
+        (WebCore::activeStorageThreads):
+        (WebCore::StorageThread::StorageThread):
+        (WebCore::StorageThread::~StorageThread):
+        (WebCore::StorageThread::start):
+        (WebCore::StorageThread::terminate):
+        (WebCore::StorageThread::releaseFastMallocFreeMemoryInAllThreads):
+
 2013-01-15  Luke Macpherson   <macpher...@chromium.org>
 
         Don't do indiscriminate cast & call in StylePropertySet::PropertyReference::cssName() on release builds.

Modified: trunk/Source/WebCore/storage/StorageThread.cpp (139810 => 139811)


--- trunk/Source/WebCore/storage/StorageThread.cpp	2013-01-16 00:45:22 UTC (rev 139810)
+++ trunk/Source/WebCore/storage/StorageThread.cpp	2013-01-16 01:07:31 UTC (rev 139811)
@@ -34,7 +34,7 @@
 
 namespace WebCore {
 
-static HashSet<StorageThread*>& storageThreads()
+static HashSet<StorageThread*>& activeStorageThreads()
 {
     ASSERT(isMainThread());
     DEFINE_STATIC_LOCAL(HashSet<StorageThread*>, threads, ());
@@ -50,14 +50,12 @@
     : m_threadID(0)
 {
     ASSERT(isMainThread());
-    storageThreads().add(this);
 }
 
 StorageThread::~StorageThread()
 {
     ASSERT(isMainThread());
     ASSERT(!m_threadID);
-    storageThreads().remove(this);
 }
 
 bool StorageThread::start()
@@ -65,6 +63,7 @@
     ASSERT(isMainThread());
     if (!m_threadID)
         m_threadID = createThread(StorageThread::threadEntryPointCallback, this, "WebCore: LocalStorage");
+    activeStorageThreads().add(this);
     return m_threadID;
 }
 
@@ -95,6 +94,7 @@
 {
     ASSERT(isMainThread());
     ASSERT(!m_queue.killed() && m_threadID);
+    activeStorageThreads().remove(this);
     // Even in weird, exceptional cases, don't wait on a nonexistent thread to terminate.
     if (!m_threadID)
         return;
@@ -113,7 +113,7 @@
 
 void StorageThread::releaseFastMallocFreeMemoryInAllThreads()
 {
-    HashSet<StorageThread*>& threads = storageThreads();
+    HashSet<StorageThread*>& threads = activeStorageThreads();
     HashSet<StorageThread*>::iterator end = threads.end();
     for (HashSet<StorageThread*>::iterator it = threads.begin(); it != end; ++it)
         (*it)->scheduleTask(StorageTask::createReleaseFastMallocFreeMemory());
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to