Title: [137814] trunk/Source/WebCore
Revision
137814
Author
[email protected]
Date
2012-12-15 15:32:12 -0800 (Sat, 15 Dec 2012)

Log Message

[BlackBerry] Prevent CookieManager from blocking the WKT thread
https://bugs.webkit.org/show_bug.cgi?id=105111

PR 265603

Patch by Otto Derek Cheung <[email protected]> on 2012-12-15
Reviewed by Rob Buis.
Internally reviewed by Konrad Piascik.

The getBackingStoreCookies in WKT is blocking the thread because it has to wait for
the db to be opened before it can call on it.

The fix is to make CookieDatabaseBackingStore in the cookie_db thread dispatch
a getBackingStoreCookies call on WKT after invokeOpen is finished.

Tested loading the browser. Cookies are being loaded into memory on start up.

* platform/blackberry/CookieDatabaseBackingStore/CookieDatabaseBackingStore.cpp:
(WebCore::CookieDatabaseBackingStore::invokeOpen):
* platform/blackberry/CookieManager.cpp:
(WebCore::cookieManager):
* platform/blackberry/CookieManager.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (137813 => 137814)


--- trunk/Source/WebCore/ChangeLog	2012-12-15 23:11:52 UTC (rev 137813)
+++ trunk/Source/WebCore/ChangeLog	2012-12-15 23:32:12 UTC (rev 137814)
@@ -1,3 +1,27 @@
+2012-12-15  Otto Derek Cheung  <[email protected]>
+
+        [BlackBerry] Prevent CookieManager from blocking the WKT thread
+        https://bugs.webkit.org/show_bug.cgi?id=105111
+
+        PR 265603
+
+        Reviewed by Rob Buis.
+        Internally reviewed by Konrad Piascik.
+
+        The getBackingStoreCookies in WKT is blocking the thread because it has to wait for
+        the db to be opened before it can call on it.
+
+        The fix is to make CookieDatabaseBackingStore in the cookie_db thread dispatch
+        a getBackingStoreCookies call on WKT after invokeOpen is finished.
+
+        Tested loading the browser. Cookies are being loaded into memory on start up.
+
+        * platform/blackberry/CookieDatabaseBackingStore/CookieDatabaseBackingStore.cpp:
+        (WebCore::CookieDatabaseBackingStore::invokeOpen):
+        * platform/blackberry/CookieManager.cpp:
+        (WebCore::cookieManager):
+        * platform/blackberry/CookieManager.h:
+
 2012-12-15  Simon Fraser  <[email protected]>
 
         Fix repaint issues when resizing a window with centered content, for platforms with a tile cache

Modified: trunk/Source/WebCore/platform/blackberry/CookieDatabaseBackingStore/CookieDatabaseBackingStore.cpp (137813 => 137814)


--- trunk/Source/WebCore/platform/blackberry/CookieDatabaseBackingStore/CookieDatabaseBackingStore.cpp	2012-12-15 23:11:52 UTC (rev 137813)
+++ trunk/Source/WebCore/platform/blackberry/CookieDatabaseBackingStore/CookieDatabaseBackingStore.cpp	2012-12-15 23:32:12 UTC (rev 137814)
@@ -167,6 +167,7 @@
         LOG_ERROR("SQLite Error Message: %s", m_db.lastErrorMsg());
     }
 
+    BlackBerry::Platform::webKitThreadMessageClient()->dispatchMessage(createMethodCallMessage(&CookieManager::getBackingStoreCookies, &cookieManager()));
 }
 
 void CookieDatabaseBackingStore::close()

Modified: trunk/Source/WebCore/platform/blackberry/CookieManager.cpp (137813 => 137814)


--- trunk/Source/WebCore/platform/blackberry/CookieManager.cpp	2012-12-15 23:11:52 UTC (rev 137813)
+++ trunk/Source/WebCore/platform/blackberry/CookieManager.cpp	2012-12-15 23:32:12 UTC (rev 137814)
@@ -78,8 +78,6 @@
         // Open the cookieJar now and get the backing store cookies to fill the manager.
         cookieManager = new CookieManager;
         cookieManager->m_cookieBackingStore->open(cookieManager->cookieJar());
-        cookieManager->getBackingStoreCookies();
-        CookieLog("CookieManager - Backingstore load complete.\n");
     }
     return *cookieManager;
 }
@@ -500,6 +498,7 @@
         ParsedCookie* newCookie = cookies[i];
         checkAndTreatCookie(newCookie, BackingStoreCookieEntry);
     }
+    CookieLog("CookieManager - Backingstore loading complete.");
 }
 
 void CookieManager::setPrivateMode(bool privateMode)

Modified: trunk/Source/WebCore/platform/blackberry/CookieManager.h (137813 => 137814)


--- trunk/Source/WebCore/platform/blackberry/CookieManager.h	2012-12-15 23:11:52 UTC (rev 137813)
+++ trunk/Source/WebCore/platform/blackberry/CookieManager.h	2012-12-15 23:32:12 UTC (rev 137814)
@@ -103,6 +103,7 @@
 
 private:
     friend CookieManager& cookieManager();
+    friend class CookieDatabaseBackingStore;
 
     CookieManager();
     virtual ~CookieManager();
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to