- Revision
- 101668
- Author
- [email protected]
- Date
- 2011-12-01 07:56:13 -0800 (Thu, 01 Dec 2011)
Log Message
Upstream credential storage files of BlackBerry porting
https://bugs.webkit.org/show_bug.cgi?id=73280
Patch by Jonathan Dong <[email protected]> on 2011-12-01
Reviewed by Rob Buis.
Added the basic structure of class CredentialBackingStore
to persist the credential data, and generated
platform/network/blackberry/CredentialStorageBlackBerry.cpp,
to implement CredentialStorage::getFromPersistentStorage
for BlackBerry porting.
Contributed by Torch Team.
* platform/network/blackberry/CredentialBackingStore.cpp: Added.
(WebCore::CredentialBackingStore::instance):
(WebCore::CredentialBackingStore::CredentialBackingStore):
(WebCore::CredentialBackingStore::~CredentialBackingStore):
(WebCore::CredentialBackingStore::open):
(WebCore::CredentialBackingStore::close):
(WebCore::CredentialBackingStore::addLogin):
(WebCore::CredentialBackingStore::updateLogin):
(WebCore::CredentialBackingStore::hasLogin):
(WebCore::CredentialBackingStore::getLogin):
(WebCore::CredentialBackingStore::removeLogin):
(WebCore::CredentialBackingStore::clear):
(WebCore::CredentialBackingStore::encryptedString):
(WebCore::CredentialBackingStore::decryptedString):
* platform/network/blackberry/CredentialBackingStore.h: Added.
* platform/network/blackberry/CredentialStorageBlackBerry.cpp: Added.
(WebCore::CredentialStorage::getFromPersistentStorage):
Modified Paths
Added Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (101667 => 101668)
--- trunk/Source/WebCore/ChangeLog 2011-12-01 15:44:59 UTC (rev 101667)
+++ trunk/Source/WebCore/ChangeLog 2011-12-01 15:56:13 UTC (rev 101668)
@@ -1,3 +1,35 @@
+2011-12-01 Jonathan Dong <[email protected]>
+
+ Upstream credential storage files of BlackBerry porting
+ https://bugs.webkit.org/show_bug.cgi?id=73280
+
+ Reviewed by Rob Buis.
+
+ Added the basic structure of class CredentialBackingStore
+ to persist the credential data, and generated
+ platform/network/blackberry/CredentialStorageBlackBerry.cpp,
+ to implement CredentialStorage::getFromPersistentStorage
+ for BlackBerry porting.
+ Contributed by Torch Team.
+
+ * platform/network/blackberry/CredentialBackingStore.cpp: Added.
+ (WebCore::CredentialBackingStore::instance):
+ (WebCore::CredentialBackingStore::CredentialBackingStore):
+ (WebCore::CredentialBackingStore::~CredentialBackingStore):
+ (WebCore::CredentialBackingStore::open):
+ (WebCore::CredentialBackingStore::close):
+ (WebCore::CredentialBackingStore::addLogin):
+ (WebCore::CredentialBackingStore::updateLogin):
+ (WebCore::CredentialBackingStore::hasLogin):
+ (WebCore::CredentialBackingStore::getLogin):
+ (WebCore::CredentialBackingStore::removeLogin):
+ (WebCore::CredentialBackingStore::clear):
+ (WebCore::CredentialBackingStore::encryptedString):
+ (WebCore::CredentialBackingStore::decryptedString):
+ * platform/network/blackberry/CredentialBackingStore.h: Added.
+ * platform/network/blackberry/CredentialStorageBlackBerry.cpp: Added.
+ (WebCore::CredentialStorage::getFromPersistentStorage):
+
2011-11-30 Andreas Kling <[email protected]>
StyledElement: Tidy up copyNonAttributeProperties().
Added: trunk/Source/WebCore/platform/network/blackberry/CredentialBackingStore.cpp (0 => 101668)
--- trunk/Source/WebCore/platform/network/blackberry/CredentialBackingStore.cpp (rev 0)
+++ trunk/Source/WebCore/platform/network/blackberry/CredentialBackingStore.cpp 2011-12-01 15:56:13 UTC (rev 101668)
@@ -0,0 +1,133 @@
+/*
+ * Copyright (C) 2011 Research In Motion Limited. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "config.h"
+
+#if ENABLE(BLACKBERRY_CREDENTIAL_PERSIST)
+#include "CredentialBackingStore.h"
+
+#include "CredentialStorage.h"
+#include "KURL.h"
+#include "NotImplemented.h"
+#include "ProtectionSpaceHash.h"
+#include "SQLiteStatement.h"
+#include <wtf/UnusedParam.h>
+
+namespace WebCore {
+
+CredentialBackingStore* CredentialBackingStore::instance()
+{
+ static CredentialBackingStore* backingStore = 0;
+ if (!backingStore)
+ backingStore = new CredentialBackingStore;
+ return backingStore;
+}
+
+CredentialBackingStore::CredentialBackingStore()
+ : m_addStatement(0)
+ , m_updateStatement(0)
+ , m_hasStatement(0)
+ , m_getStatement(0)
+ , m_removeStatement(0)
+{
+}
+
+CredentialBackingStore::~CredentialBackingStore()
+{
+}
+
+bool CredentialBackingStore::open(const String& dbPath)
+{
+ UNUSED_PARAM(dbPath);
+
+ notImplemented();
+ return false;
+}
+
+void CredentialBackingStore::close()
+{
+ notImplemented();
+}
+
+bool CredentialBackingStore::addLogin(const KURL& url, const ProtectionSpace& protectionSpace, const Credential& credential)
+{
+ UNUSED_PARAM(url);
+ UNUSED_PARAM(protectionSpace);
+ UNUSED_PARAM(credential);
+
+ notImplemented();
+ return false;
+}
+
+bool CredentialBackingStore::updateLogin(const KURL& url, const ProtectionSpace& protectionSpace, const Credential& credential)
+{
+ UNUSED_PARAM(url);
+ UNUSED_PARAM(protectionSpace);
+ UNUSED_PARAM(credential);
+
+ notImplemented();
+ return false;
+}
+
+bool CredentialBackingStore::hasLogin(const ProtectionSpace& protectionSpace)
+{
+ UNUSED_PARAM(protectionSpace);
+
+ notImplemented();
+ return false;
+}
+
+Credential CredentialBackingStore::getLogin(const ProtectionSpace& protectionSpace)
+{
+ UNUSED_PARAM(protectionSpace);
+
+ notImplemented();
+ return Credential();
+}
+
+bool CredentialBackingStore::removeLogin(const ProtectionSpace& protectionSpace)
+{
+ UNUSED_PARAM(protectionSpace);
+
+ notImplemented();
+ return false;
+}
+
+bool CredentialBackingStore::clear()
+{
+ notImplemented();
+ return false;
+}
+
+String CredentialBackingStore::encryptedString(const String& plainText) const
+{
+ // FIXME: Need encrypt plainText here
+ notImplemented();
+ return plainText;
+}
+
+String CredentialBackingStore::decryptedString(const String& cipherText) const
+{
+ // FIXME: Need decrypt cipherText here
+ notImplemented();
+ return cipherText;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(BLACKBERRY_CREDENTIAL_PERSIST)
Added: trunk/Source/WebCore/platform/network/blackberry/CredentialBackingStore.h (0 => 101668)
--- trunk/Source/WebCore/platform/network/blackberry/CredentialBackingStore.h (rev 0)
+++ trunk/Source/WebCore/platform/network/blackberry/CredentialBackingStore.h 2011-12-01 15:56:13 UTC (rev 101668)
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2011 Research In Motion Limited. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef CredentialBackingStore_h
+#define CredentialBackingStore_h
+
+#if ENABLE(BLACKBERRY_CREDENTIAL_PERSIST)
+
+#include "Credential.h"
+#include "SQLiteDatabase.h"
+
+namespace WebCore {
+
+class KURL;
+class ProtectionSpace;
+
+class CredentialBackingStore {
+public:
+ static CredentialBackingStore* instance();
+ ~CredentialBackingStore();
+ bool open(const String& dbPath);
+ void close();
+ bool addLogin(const KURL&, const ProtectionSpace&, const Credential&);
+ bool updateLogin(const KURL&, const ProtectionSpace&, const Credential&);
+ bool hasLogin(const ProtectionSpace&);
+ Credential getLogin(const ProtectionSpace&);
+ bool removeLogin(const ProtectionSpace&);
+ bool clear();
+
+private:
+ CredentialBackingStore();
+ String encryptedString(const String& plainText) const;
+ String decryptedString(const String& cipherText) const;
+
+ SQLiteDatabase m_database;
+ SQLiteStatement* m_addStatement;
+ SQLiteStatement* m_updateStatement;
+ SQLiteStatement* m_hasStatement;
+ SQLiteStatement* m_getStatement;
+ SQLiteStatement* m_removeStatement;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(BLACKBERRY_CREDENTIAL_PERSIST)
+
+#endif // CredentialBackingStore_h
Added: trunk/Source/WebCore/platform/network/blackberry/CredentialStorageBlackBerry.cpp (0 => 101668)
--- trunk/Source/WebCore/platform/network/blackberry/CredentialStorageBlackBerry.cpp (rev 0)
+++ trunk/Source/WebCore/platform/network/blackberry/CredentialStorageBlackBerry.cpp 2011-12-01 15:56:13 UTC (rev 101668)
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2011 Research In Motion Limited. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "config.h"
+#include "CredentialStorage.h"
+
+#include "Credential.h"
+#if ENABLE(BLACKBERRY_CREDENTIAL_PERSIST)
+#include "CredentialBackingStore.h"
+#endif
+#include <wtf/UnusedParam.h>
+
+namespace WebCore {
+
+Credential CredentialStorage::getFromPersistentStorage(const ProtectionSpace& protectionSpace)
+{
+#if ENABLE(BLACKBERRY_CREDENTIAL_PERSIST)
+ return CredentialBackingStore::instance()->getLogin(protectionSpace);
+#else
+ UNUSED_PARAM(protectionSpace);
+ return Credential();
+#endif
+}
+
+} // namespace WebCore