[SCM] WebKit Debian packaging branch, debian/experimental, updated. debian/1.3.8-1-1049-g2e11a8e

steveblock at google.com steveblock at google.com
Fri Jan 21 14:48:05 UTC 2011


The following commit has been merged in the debian/experimental branch:
commit c3d23e03fc82b3f4da3db432ac24e79edbf342db
Author: steveblock at google.com <steveblock at google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Dec 30 11:32:15 2010 +0000

    2010-12-30  Steve Block  <steveblock at google.com>
    
            Reviewed by Sam Weinig.
    
            Visiting macnn.com often causes SQL spew via geolocation database
            https://bugs.webkit.org/show_bug.cgi?id=51557
    
            If the Geolocation position cache database path has not been set, early-out
            rather than using an empty path and thus failing to open the database.
            This avoids SQL log spew.
    
            Also, avoid starting the database thread until the path has been set, and
            shorten the thread name to avoid warnings due to exceeding 30 characters.
    
            No new tests, implementation clean-up only.
    
            * page/GeolocationPositionCache.cpp:
            (WebCore::GeolocationPositionCache::addUser):
            (WebCore::GeolocationPositionCache::removeUser):
            (WebCore::GeolocationPositionCache::setDatabasePath):
            (WebCore::GeolocationPositionCache::startBackgroundThread):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74794 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index a971545..5397fa9 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,25 @@
+2010-12-30  Steve Block  <steveblock at google.com>
+
+        Reviewed by Sam Weinig.
+
+        Visiting macnn.com often causes SQL spew via geolocation database
+        https://bugs.webkit.org/show_bug.cgi?id=51557
+
+        If the Geolocation position cache database path has not been set, early-out
+        rather than using an empty path and thus failing to open the database.
+        This avoids SQL log spew.
+
+        Also, avoid starting the database thread until the path has been set, and
+        shorten the thread name to avoid warnings due to exceeding 30 characters.
+
+        No new tests, implementation clean-up only.
+
+        * page/GeolocationPositionCache.cpp:
+        (WebCore::GeolocationPositionCache::addUser):
+        (WebCore::GeolocationPositionCache::removeUser):
+        (WebCore::GeolocationPositionCache::setDatabasePath):
+        (WebCore::GeolocationPositionCache::startBackgroundThread):
+
 2010-12-29  Philippe Normand  <pnormand at igalia.com>
 
         Reviewed by Martin Robinson.
diff --git a/WebCore/page/GeolocationPositionCache.cpp b/WebCore/page/GeolocationPositionCache.cpp
index 4a9c6b7..5a0f42d 100644
--- a/WebCore/page/GeolocationPositionCache.cpp
+++ b/WebCore/page/GeolocationPositionCache.cpp
@@ -60,7 +60,8 @@ GeolocationPositionCache::GeolocationPositionCache()
 void GeolocationPositionCache::addUser()
 {
     ASSERT(numUsers >= 0);
-    if (!numUsers && !m_threadId) {
+    MutexLocker databaseLock(m_databaseFileMutex);
+    if (!numUsers && !m_threadId && !m_databaseFile.isNull()) {
         startBackgroundThread();
         MutexLocker lock(m_cachedPositionMutex);
         if (!m_cachedPosition)
@@ -74,7 +75,7 @@ void GeolocationPositionCache::removeUser()
     MutexLocker lock(m_cachedPositionMutex);
     --numUsers;
     ASSERT(numUsers >= 0);
-    if (!numUsers && m_cachedPosition)
+    if (!numUsers && m_cachedPosition && m_threadId)
         triggerWriteToDatabase();
 }
 
@@ -85,8 +86,11 @@ void GeolocationPositionCache::setDatabasePath(const String& path)
     MutexLocker lock(m_databaseFileMutex);
     if (m_databaseFile != newFile) {
         m_databaseFile = newFile;
-        if (numUsers && !m_cachedPosition)
-            triggerReadFromDatabase();
+        if (numUsers && !m_threadId) {
+            startBackgroundThread();
+            if (!m_cachedPosition)
+                triggerReadFromDatabase();
+        }
     }
 }
 
@@ -105,7 +109,7 @@ Geoposition* GeolocationPositionCache::cachedPosition()
 void GeolocationPositionCache::startBackgroundThread()
 {
     // FIXME: Consider sharing this thread with other background tasks.
-    m_threadId = createThread(threadEntryPoint, this, "WebCore: GeolocationPositionCache");
+    m_threadId = createThread(threadEntryPoint, this, "WebCore: Geolocation cache");
 }
 
 void* GeolocationPositionCache::threadEntryPoint(void* object)

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list