[BlackBerry] add interface clearCredentials() and clearNeverRememberSites()
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Mar 2012 02:26:12 +0000 (02:26 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Mar 2012 02:26:12 +0000 (02:26 +0000)
https://bugs.webkit.org/show_bug.cgi?id=81887

Patch by Jonathan Dong <jonathan.dong@torchmobile.com.cn> on 2012-03-22
Reviewed by Rob Buis.

Source/WebCore:

Fixed SQL issue when clearing table logins and table never_remember.

No new tests.

* platform/network/blackberry/CredentialBackingStore.cpp:
(WebCore::CredentialBackingStore::clearLogins):
(WebCore::CredentialBackingStore::clearNeverRemember):

Source/WebKit/blackberry:

Added two interface functions clearCredentials() and
clearNeverRememberSites() into class WebPage, which
should be used by UI to clear the stored credential
information and never remember sites.
Also implemented the corresponding functions in class
CredentialManager to call CredentialBackingStore
to perform the actual clear table work.

* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPage::clearCredentials):
(WebKit):
(BlackBerry::WebKit::WebPage::clearNeverRememberSites):
* Api/WebPage.h:
* WebCoreSupport/CredentialManager.cpp:
(WebCore::CredentialManager::clearCredentials):
(WebCore):
(WebCore::CredentialManager::clearNeverRememberSites):
* WebCoreSupport/CredentialManager.h:
(CredentialManager):

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

Source/WebCore/ChangeLog
Source/WebCore/platform/network/blackberry/CredentialBackingStore.cpp
Source/WebKit/blackberry/Api/WebPage.cpp
Source/WebKit/blackberry/Api/WebPage.h
Source/WebKit/blackberry/ChangeLog
Source/WebKit/blackberry/WebCoreSupport/CredentialManager.cpp
Source/WebKit/blackberry/WebCoreSupport/CredentialManager.h

index 2d0be8845c29504e120b198a4e30a4710c5c0e78..7de0fa738e52684a30dab6cf71a7392c0506c716 100644 (file)
@@ -1,3 +1,18 @@
+2012-03-22  Jonathan Dong  <jonathan.dong@torchmobile.com.cn>
+
+        [BlackBerry] add interface clearCredentials() and clearNeverRememberSites()
+        https://bugs.webkit.org/show_bug.cgi?id=81887
+
+        Reviewed by Rob Buis.
+
+        Fixed SQL issue when clearing table logins and table never_remember.
+
+        No new tests.
+
+        * platform/network/blackberry/CredentialBackingStore.cpp:
+        (WebCore::CredentialBackingStore::clearLogins):
+        (WebCore::CredentialBackingStore::clearNeverRemember):
+
 2012-03-22  Jonathan Dong  <jonathan.dong@torchmobile.com.cn>
 
         [BlackBerry] http authenticate dialog popup only once no matter authentication pass or fail
index e024c2775010923eaf0828e9a963b2fe446180f1..ae89dc869b93ba5f49a88661e4ab7b314dfcecf8 100644 (file)
@@ -404,7 +404,7 @@ bool CredentialBackingStore::clearLogins()
     ASSERT(m_database.isOpen());
     ASSERT(m_database.tableExists("logins"));
 
-    HANDLE_SQL_EXEC_FAILURE(!m_database.executeCommand("DELETE FROM logins"),
+    HANDLE_SQL_EXEC_FAILURE(!m_database.executeCommand("DELETE FROM logins"),
         false, "Failed to clear table logins");
 
     return true;
@@ -415,7 +415,7 @@ bool CredentialBackingStore::clearNeverRemember()
     ASSERT(m_database.isOpen());
     ASSERT(m_database.tableExists("never_remember"));
 
-    HANDLE_SQL_EXEC_FAILURE(!m_database.executeCommand("DELETE FROM never_remember"),
+    HANDLE_SQL_EXEC_FAILURE(!m_database.executeCommand("DELETE FROM never_remember"),
         false, "Failed to clear table never_remember");
 
     return true;
index 7f1899fad602f646c0bfe443bd07bbeed462ab39..e1689439d950a210b50a61cbb5f11e3c7245d589 100644 (file)
@@ -4874,6 +4874,20 @@ void WebPage::clearLocalStorage()
     clearDatabase(d->m_page->groupName());
 }
 
+void WebPage::clearCredentials()
+{
+#if ENABLE(BLACKBERRY_CREDENTIAL_PERSIST)
+    credentialManager().clearCredentials();
+#endif
+}
+
+void WebPage::clearNeverRememberSites()
+{
+#if ENABLE(BLACKBERRY_CREDENTIAL_PERSIST)
+    credentialManager().clearNeverRememberSites();
+#endif
+}
+
 void WebPage::clearCache()
 {
     clearMemoryCaches();
index e9eed2304c067c37d3f63ca10c79ec822a3b982a..5e3105c05439f0a92728d16e8deb87aeae8bdb93 100644 (file)
@@ -191,6 +191,8 @@ public:
     void clearCookies();
     void clearCache();
     void clearLocalStorage();
+    void clearCredentials();
+    void clearNeverRememberSites();
 
     void runLayoutTests();
 
index fff2c85bf8cf4a62eaccaee0471de549e2b994f7..64c4e7498912307a11086b1a20f7a62668533fd9 100644 (file)
@@ -1,3 +1,30 @@
+2012-03-22  Jonathan Dong  <jonathan.dong@torchmobile.com.cn>
+
+        [BlackBerry] add interface clearCredentials() and clearNeverRememberSites()
+        https://bugs.webkit.org/show_bug.cgi?id=81887
+
+        Reviewed by Rob Buis.
+
+        Added two interface functions clearCredentials() and
+        clearNeverRememberSites() into class WebPage, which
+        should be used by UI to clear the stored credential
+        information and never remember sites.
+        Also implemented the corresponding functions in class
+        CredentialManager to call CredentialBackingStore
+        to perform the actual clear table work.
+
+        * Api/WebPage.cpp:
+        (BlackBerry::WebKit::WebPage::clearCredentials):
+        (WebKit):
+        (BlackBerry::WebKit::WebPage::clearNeverRememberSites):
+        * Api/WebPage.h:
+        * WebCoreSupport/CredentialManager.cpp:
+        (WebCore::CredentialManager::clearCredentials):
+        (WebCore):
+        (WebCore::CredentialManager::clearNeverRememberSites):
+        * WebCoreSupport/CredentialManager.h:
+        (CredentialManager):
+
 2012-03-22  Jonathan Dong  <jonathan.dong@torchmobile.com.cn>
 
         [BlackBerry] http authenticate dialog popup only once no matter authentication pass or fail
index 683e3c3bbc8f8796169b7f44df3bf954e5eefae0..50ce69f1be7df67ff49166abab3544f320cffacb 100644 (file)
@@ -92,6 +92,16 @@ void CredentialManager::saveCredentialIfConfirmed(PageClientBlackBerry* pageClie
     }
 }
 
+void CredentialManager::clearCredentials()
+{
+    CredentialBackingStore::instance()->clearLogins();
+}
+
+void CredentialManager::clearNeverRememberSites()
+{
+    CredentialBackingStore::instance()->clearNeverRemember();
+}
+
 } // namespace WebCore
 
 #endif // ENABLE(BLACKBERRY_CREDENTIAL_PERSIST)
index 2f19e8ac095c1a555567b17e10a89e9462880a63..92ce530f55a3d16ac4d0f95c97686f087957a1db 100644 (file)
@@ -42,6 +42,8 @@ public:
     void autofillAuthenticationChallenge(const ProtectionSpace&, BlackBerry::WebKit::WebString& username, BlackBerry::WebKit::WebString& password);
     void autofillPasswordForms(PassRefPtr<HTMLCollection> docForms);
     void saveCredentialIfConfirmed(PageClientBlackBerry*, const CredentialTransformData&);
+    void clearCredentials();
+    void clearNeverRememberSites();
 
  private:
     friend CredentialManager& credentialManager();