Title: [133770] trunk/Source/WebCore
Revision
133770
Author
ser...@webkit.org
Date
2012-11-07 09:39:26 -0800 (Wed, 07 Nov 2012)

Log Message

[Qt] Implement deleteCookie() for persistent storage
https://bugs.webkit.org/show_bug.cgi?id=101272

Reviewed by Jocelyn Turcotte.

Individual cookies were never persistently cleared as the
deleteCookie() virtual method was not implemented for persistent
storage. That's why cookies were only deleted for the current
session.

* platform/qt/CookieJarQt.cpp:
(WebCore::SharedCookieJarQt::deleteCookie):
(WebCore): added deleteCookie() implementation for persistent
storage.
* platform/qt/CookieJarQt.h:
(SharedCookieJarQt):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (133769 => 133770)


--- trunk/Source/WebCore/ChangeLog	2012-11-07 17:35:22 UTC (rev 133769)
+++ trunk/Source/WebCore/ChangeLog	2012-11-07 17:39:26 UTC (rev 133770)
@@ -1,3 +1,22 @@
+2012-11-07  Sergio Villar Senin  <svil...@igalia.com>
+
+        [Qt] Implement deleteCookie() for persistent storage
+        https://bugs.webkit.org/show_bug.cgi?id=101272
+
+        Reviewed by Jocelyn Turcotte.
+
+        Individual cookies were never persistently cleared as the
+        deleteCookie() virtual method was not implemented for persistent
+        storage. That's why cookies were only deleted for the current
+        session.
+
+        * platform/qt/CookieJarQt.cpp:
+        (WebCore::SharedCookieJarQt::deleteCookie):
+        (WebCore): added deleteCookie() implementation for persistent
+        storage.
+        * platform/qt/CookieJarQt.h:
+        (SharedCookieJarQt):
+
 2012-11-07  Shinya Kawanaka  <shin...@chromium.org>
 
         [Shadow] Style should update when 'pseudo' attribute is dynamically updated

Modified: trunk/Source/WebCore/platform/qt/CookieJarQt.cpp (133769 => 133770)


--- trunk/Source/WebCore/platform/qt/CookieJarQt.cpp	2012-11-07 17:35:22 UTC (rev 133769)
+++ trunk/Source/WebCore/platform/qt/CookieJarQt.cpp	2012-11-07 17:39:26 UTC (rev 133770)
@@ -199,6 +199,22 @@
         hostnames.add(networkCookie.domain());
 }
 
+bool SharedCookieJarQt::deleteCookie(const QNetworkCookie& cookie)
+{
+    if (!QNetworkCookieJar::deleteCookie(cookie))
+        return false;
+
+    if (!m_database.isOpen())
+        return false;
+
+    QSqlQuery sqlQuery(m_database);
+    sqlQuery.prepare(QLatin1String("DELETE FROM cookies WHERE cookieId=:cookieIdvalue"));
+    sqlQuery.bindValue(QLatin1String(":cookieIdvalue"), cookie.domain().append(QLatin1String(cookie.name())));
+    sqlQuery.exec();
+
+    return true;
+}
+
 void SharedCookieJarQt::deleteCookiesForHostname(const String& hostname)
 {
     if (!m_database.isOpen())

Modified: trunk/Source/WebCore/platform/qt/CookieJarQt.h (133769 => 133770)


--- trunk/Source/WebCore/platform/qt/CookieJarQt.h	2012-11-07 17:35:22 UTC (rev 133769)
+++ trunk/Source/WebCore/platform/qt/CookieJarQt.h	2012-11-07 17:39:26 UTC (rev 133770)
@@ -38,6 +38,7 @@
     void destroy();
 
     void getHostnamesWithCookies(HashSet<String>&);
+    bool deleteCookie(const QNetworkCookie&);
     void deleteCookiesForHostname(const String&);
     void deleteAllCookies();
     bool setCookiesFromUrl(const QList<QNetworkCookie>&, const QUrl&);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to