[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 2d0be88..7de0fa7 100644 (file)
@@ -1,5 +1,20 @@
 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
         https://bugs.webkit.org/show_bug.cgi?id=80135
 
index e024c27..ae89dc8 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 7f1899f..e168943 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 e9eed23..5e3105c 100644 (file)
@@ -191,6 +191,8 @@ public:
     void clearCookies();
     void clearCache();
     void clearLocalStorage();
+    void clearCredentials();
+    void clearNeverRememberSites();
 
     void runLayoutTests();
 
index fff2c85..64c4e74 100644 (file)
@@ -1,5 +1,32 @@
 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
         https://bugs.webkit.org/show_bug.cgi?id=80135
 
index 683e3c3..50ce69f 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 2f19e8a..92ce530 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();