Make DatabaseTrackerChromium::removeOpenDatabase() send and IPC on
authordumi@chromium.org <dumi@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 19 Dec 2009 02:03:00 +0000 (02:03 +0000)
committerdumi@chromium.org <dumi@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 19 Dec 2009 02:03:00 +0000 (02:03 +0000)
the main thread when a database is being closed.

Reviewed by Eric Seidel.

https://bugs.webkit.org/show_bug.cgi?id=32627

* storage/chromium/DatabaseTrackerChromium.cpp:
(WebCore::removeOpenDatabaseOnMainThread):
(WebCore::DatabaseTracker::removeOpenDatabase):

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

WebCore/ChangeLog
WebCore/storage/chromium/DatabaseTrackerChromium.cpp

index 356e0d5d1a2317083f9128a79cb3af81f4098511..733590fc00581e988f5a8ce047eac54c8340b7e6 100644 (file)
@@ -1,3 +1,16 @@
+2009-12-18  Dumitru Daniliuc  <dumi@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        Make DatabaseTrackerChromium::removeOpenDatabase() send and IPC on
+        the main thread when a database is being closed.
+
+        https://bugs.webkit.org/show_bug.cgi?id=32627
+
+        * storage/chromium/DatabaseTrackerChromium.cpp:
+        (WebCore::removeOpenDatabaseOnMainThread):
+        (WebCore::DatabaseTracker::removeOpenDatabase):
+
 2009-12-18  Brent Fulgham  <bfulgham@webkit.org>
 
         Build fix, no review.
 2009-12-18  Brent Fulgham  <bfulgham@webkit.org>
 
         Build fix, no review.
@@ -7,7 +20,7 @@
         (WebCore::FontCache::createFontPlatformData): Conditionalize
           Safari-only call.
 
         (WebCore::FontCache::createFontPlatformData): Conditionalize
           Safari-only call.
 
-2009-12-16  Dumitru Daniliuc  <dumi@chromium.org>
+2009-12-18  Dumitru Daniliuc  <dumi@chromium.org>
 
         Reviewed by Dmitry Titov.
 
 
         Reviewed by Dmitry Titov.
 
index e4b8178fafd779360cc7607105b0cab18b967ece..7556e3da6044aa51c7cd8c036025c3ac348091ac 100644 (file)
@@ -77,13 +77,22 @@ void DatabaseTracker::addOpenDatabase(Database* database)
     ASSERT(isMainThread());
     DatabaseObserver::databaseOpened(database);
 }
     ASSERT(isMainThread());
     DatabaseObserver::databaseOpened(database);
 }
+static void removeOpenDatabaseOnMainThread(void* context)
+{
+    Database* database = static_cast<Database*>(context);
+    DatabaseTracker::tracker().removeOpenDatabase(database);
+    database->deref();
+}
 
 void DatabaseTracker::removeOpenDatabase(Database* database)
 {
 
 void DatabaseTracker::removeOpenDatabase(Database* database)
 {
-    // FIXME: once we know how to use this information, figure out
-    //        how to get this method called on the main thread
-    //ASSERT(isMainThread());
-    //DatabaseObserver::databaseClosed(database);
+    if (!isMainThread()) {
+        database->ref();
+        callOnMainThread(removeOpenDatabaseOnMainThread, database);
+        return;
+    }
+
+    DatabaseObserver::databaseClosed(database);
 }
 
 unsigned long long DatabaseTracker::getMaxSizeForDatabase(const Database* database)
 }
 
 unsigned long long DatabaseTracker::getMaxSizeForDatabase(const Database* database)