Title: [111142] trunk/Source/WebCore
Revision
111142
Author
[email protected]
Date
2012-03-18 17:23:00 -0700 (Sun, 18 Mar 2012)

Log Message

[Qt] Don't prepare SQL statements when the database is not open https://bugs.webkit.org/show_bug.cgi?id=81470

Reviewed by Kenneth Rohde Christiansen.

Already covered by existing tests.

* platform/qt/CookieJarQt.cpp:
(WebCore::SharedCookieJarQt::deleteCookiesForHostname):
(WebCore::SharedCookieJarQt::deleteAllCookies):
(WebCore::SharedCookieJarQt::setCookiesFromUrl):
(WebCore::SharedCookieJarQt::loadCookies):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (111141 => 111142)


--- trunk/Source/WebCore/ChangeLog	2012-03-18 23:50:01 UTC (rev 111141)
+++ trunk/Source/WebCore/ChangeLog	2012-03-19 00:23:00 UTC (rev 111142)
@@ -1,3 +1,18 @@
+2012-03-18  Alexander Færøy  <[email protected]>
+
+        [Qt] Don't prepare SQL statements when the database is not open
+        https://bugs.webkit.org/show_bug.cgi?id=81470
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Already covered by existing tests.
+
+        * platform/qt/CookieJarQt.cpp:
+        (WebCore::SharedCookieJarQt::deleteCookiesForHostname):
+        (WebCore::SharedCookieJarQt::deleteAllCookies):
+        (WebCore::SharedCookieJarQt::setCookiesFromUrl):
+        (WebCore::SharedCookieJarQt::loadCookies):
+
 2012-03-18  Kentaro Hara  <[email protected]>
 
         Unreviewed, rolling out r110994 due to Chromium crash

Modified: trunk/Source/WebCore/platform/qt/CookieJarQt.cpp (111141 => 111142)


--- trunk/Source/WebCore/platform/qt/CookieJarQt.cpp	2012-03-18 23:50:01 UTC (rev 111141)
+++ trunk/Source/WebCore/platform/qt/CookieJarQt.cpp	2012-03-19 00:23:00 UTC (rev 111142)
@@ -202,6 +202,9 @@
 
 void SharedCookieJarQt::deleteCookiesForHostname(const String& hostname)
 {
+    if (!m_database.isOpen())
+        return;
+
     QList<QNetworkCookie> cookies = allCookies();
     QList<QNetworkCookie>::Iterator it = cookies.begin();
     QList<QNetworkCookie>::Iterator end = cookies.end();
@@ -220,6 +223,9 @@
 
 void SharedCookieJarQt::deleteAllCookies()
 {
+    if (!m_database.isOpen())
+        return;
+
     QSqlQuery sqlQuery(m_database);
     sqlQuery.prepare(QLatin1String("DELETE * FROM cookies"));
     sqlQuery.exec();
@@ -245,6 +251,10 @@
 {
     if (!QNetworkCookieJar::setCookiesFromUrl(cookieList, url))
         return false;
+
+    if (!m_database.isOpen())
+        return false;
+
     QSqlQuery sqlQuery(m_database);
     sqlQuery.prepare(QLatin1String("INSERT OR REPLACE INTO cookies (cookieId, cookie) VALUES (:cookieIdvalue, :cookievalue)"));
     QVariantList cookiesIds;
@@ -274,6 +284,9 @@
 
 void SharedCookieJarQt::loadCookies()
 {
+    if (!m_database.isOpen())
+        return;
+
     QList<QNetworkCookie> cookies;
     QSqlQuery sqlQuery(m_database);
     sqlQuery.prepare(QLatin1String("SELECT cookie FROM cookies"));
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to