[GTK] Remove dependency on SoupPasswordManager
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Nov 2012 18:05:42 +0000 (18:05 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Nov 2012 18:05:42 +0000 (18:05 +0000)
https://bugs.webkit.org/show_bug.cgi?id=100775

Patch by Martin Robinson <mrobinson@igalia.com> on 2012-11-02
Reviewed by Carlos Garcia Campos.

.:

Add a libsecret dependency to the build. This is necessary so that we can remove
a dependency on SoupPasswordManager.

* configure.ac: Look for libsecret using the pkg-config configuration macro.

Source/WebCore:

Remember passwords using libsecret instead of SoupPasswordManager. We accomplish this using
a new class, CredentialBackingStore. CredentialBackingStore will soon be the thing that backs
CredentialStoreGtk. The name is based on the name of a similar class from the BlackBerry port.

No new tests. This does not change behavior.

* GNUmakefile.am: Add libsecret flags to the build and the new directory to the include list.
* GNUmakefile.list.am: Add new files to the source list.
* platform/gtk/GRefPtrGtk.cpp: Add support for SecretValue to GRefPtrGtk.
* platform/gtk/GtkAuthenticationDialog.cpp: Replace interaction with SoupPasswordManger with
interaction with the CredentialBackingStore. Remove all conditional SoupPasswordManager guards.
* platform/gtk/GtkAuthenticationDialog.h: Ditto.
* platform/network/gtk/CredentialBackingStore.cpp: Added.
* platform/network/gtk/CredentialBackingStore.h: Added.

Source/WebKit/gtk:

Add a libsecret dependency to the build. This is necessary so that we can remove
a dependency on SoupPasswordManager.

* GNUmakefile.am: Use libsecret libs during WebKit1 library compilation.

Source/WebKit2:

Add a libsecret dependency to the build. This is necessary so that we can remove
a dependency on SoupPasswordManager.

* GNUmakefile.am: Add libsecret CFLAGS to the WebKit2 build.

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

15 files changed:
ChangeLog
Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.am
Source/WebCore/GNUmakefile.list.am
Source/WebCore/platform/gtk/GRefPtrGtk.cpp
Source/WebCore/platform/gtk/GRefPtrGtk.h
Source/WebCore/platform/gtk/GtkAuthenticationDialog.cpp
Source/WebCore/platform/gtk/GtkAuthenticationDialog.h
Source/WebCore/platform/network/gtk/CredentialBackingStore.cpp [new file with mode: 0644]
Source/WebCore/platform/network/gtk/CredentialBackingStore.h [new file with mode: 0644]
Source/WebKit/gtk/ChangeLog
Source/WebKit/gtk/GNUmakefile.am
Source/WebKit2/ChangeLog
Source/WebKit2/GNUmakefile.am
configure.ac

index 784e8ba..164a729 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2012-11-02  Martin Robinson  <mrobinson@igalia.com>
+
+        [GTK] Remove dependency on SoupPasswordManager
+        https://bugs.webkit.org/show_bug.cgi?id=100775
+
+        Reviewed by Carlos Garcia Campos.
+
+        Add a libsecret dependency to the build. This is necessary so that we can remove
+        a dependency on SoupPasswordManager.
+
+        * configure.ac: Look for libsecret using the pkg-config configuration macro.
+
 2012-11-02  Michael BrĂ¼ning  <michael.bruning@digia.com>
 
         [Qt][WK2] ASSERT hit for every mouse click
index fe9249f..19e34ce 100644 (file)
@@ -1,3 +1,25 @@
+2012-11-02  Martin Robinson  <mrobinson@igalia.com>
+
+        [GTK] Remove dependency on SoupPasswordManager
+        https://bugs.webkit.org/show_bug.cgi?id=100775
+
+        Reviewed by Carlos Garcia Campos.
+
+        Remember passwords using libsecret instead of SoupPasswordManager. We accomplish this using
+        a new class, CredentialBackingStore. CredentialBackingStore will soon be the thing that backs
+        CredentialStoreGtk. The name is based on the name of a similar class from the BlackBerry port.
+
+        No new tests. This does not change behavior.
+
+        * GNUmakefile.am: Add libsecret flags to the build and the new directory to the include list.
+        * GNUmakefile.list.am: Add new files to the source list.
+        * platform/gtk/GRefPtrGtk.cpp: Add support for SecretValue to GRefPtrGtk.
+        * platform/gtk/GtkAuthenticationDialog.cpp: Replace interaction with SoupPasswordManger with
+        interaction with the CredentialBackingStore. Remove all conditional SoupPasswordManager guards.
+        * platform/gtk/GtkAuthenticationDialog.h: Ditto.
+        * platform/network/gtk/CredentialBackingStore.cpp: Added.
+        * platform/network/gtk/CredentialBackingStore.h: Added.
+
 2012-11-02  Jinwoo Song  <jinwoo7.song@samsung.com>
 
         Fix build warning [-Wswitch]
index 3616a38..e66bf05 100644 (file)
@@ -73,6 +73,7 @@ webcore_cppflags += \
        -I$(srcdir)/Source/WebCore/platform/mediastream/gstreamer \
        -I$(srcdir)/Source/WebCore/platform/mock \
        -I$(srcdir)/Source/WebCore/platform/network \
+       -I$(srcdir)/Source/WebCore/platform/network/gtk \
        -I$(srcdir)/Source/WebCore/platform/sql \
        -I$(srcdir)/Source/WebCore/platform/text \
        -I$(srcdir)/Source/WebCore/platform/text/transcoder \
@@ -641,6 +642,7 @@ libWebCore_la_CPPFLAGS = \
        $(GEOCLUE_CFLAGS) \
        $(GLIB_CFLAGS) \
        $(GSTREAMER_CFLAGS) \
+       $(LIBSECRET_CFLAGS) \
        $(LIBSOUP_CFLAGS) \
        $(LIBXML_CFLAGS) \
        $(LIBXSLT_CFLAGS) \
@@ -704,6 +706,7 @@ libWebCoreGtk_la_CPPFLAGS = \
        $(GSTREAMER_CFLAGS) \
        $(GTK_CFLAGS) \
        $(HILDON_CFLAGS) \
+       $(LIBSECRET_CFLAGS) \
        $(LIBSOUP_CFLAGS) \
        $(LIBXML_CFLAGS) \
        $(LIBXSLT_CFLAGS) \
index 12bc8f5..72f6aa5 100644 (file)
@@ -4748,6 +4748,8 @@ webcore_sources += \
        Source/WebCore/platform/network/SocketStreamHandleBase.cpp \
        Source/WebCore/platform/network/SocketStreamHandleBase.h \
        Source/WebCore/platform/network/SocketStreamHandleClient.h \
+       Source/WebCore/platform/network/gtk/CredentialBackingStore.cpp \
+       Source/WebCore/platform/network/gtk/CredentialBackingStore.h \
        Source/WebCore/platform/network/soup/AuthenticationChallenge.h \
        Source/WebCore/platform/network/soup/AuthenticationChallengeSoup.cpp \
        Source/WebCore/platform/network/soup/CookieJarSoup.cpp \
index 9a9d679..fa506df 100644 (file)
 #include "config.h"
 #include "GRefPtrGtk.h"
 
+#define SECRET_WITH_UNSTABLE 1
+#define SECRET_API_SUBJECT_TO_CHANGE 1
+
 #include <glib.h>
 #include <gtk/gtk.h>
+#include <libsecret/secret.h>
 
 namespace WTF {
 
@@ -38,6 +42,19 @@ template <> void derefGPtr(GtkTargetList* ptr)
         gtk_target_list_unref(ptr);
 }
 
+template <> SecretValue* refGPtr(SecretValue* ptr)
+{
+    if (ptr)
+        secret_value_ref(ptr);
+    return ptr;
+}
+
+template <> void derefGPtr(SecretValue* ptr)
+{
+    if (ptr)
+        secret_value_unref(ptr);
+}
+
 #ifdef GTK_API_VERSION_2
 template <> GdkCursor* refGPtr(GdkCursor* ptr)
 {
index a9f491f..9192864 100644 (file)
 
 #include <wtf/gobject/GRefPtr.h>
 
+typedef struct _SecretValue SecretValue;
+
 namespace WTF {
 
 template <> GtkTargetList* refGPtr(GtkTargetList* ptr);
 template <> void derefGPtr(GtkTargetList* ptr);
 
+template <> SecretValue* refGPtr(SecretValue* ptr);
+template <> void derefGPtr(SecretValue* ptr);
+
 #ifdef GTK_API_VERSION_2
 template <> GdkCursor* refGPtr(GdkCursor* ptr);
 template <> void derefGPtr(GdkCursor* ptr);
index 36bd31b..8fdb0cf 100644 (file)
@@ -20,6 +20,8 @@
 #include "config.h"
 #include "GtkAuthenticationDialog.h"
 
+#include "AuthenticationChallenge.h"
+#include "CredentialBackingStore.h"
 #include "GtkVersioning.h"
 #include <glib/gi18n-lib.h>
 #include <gtk/gtk.h>
@@ -54,15 +56,6 @@ static GtkWidget* addEntryToGrid(GtkGrid* grid, int row, const char* labelText)
     return entry;
 }
 
-static bool sessionCanSavePasswords(SoupSession* session)
-{
-#ifdef SOUP_TYPE_PASSWORD_MANAGER
-    return soup_session_get_feature(session, SOUP_TYPE_PASSWORD_MANAGER);
-#else
-    return false;
-#endif
-}
-
 GtkAuthenticationDialog::~GtkAuthenticationDialog()
 {
 }
@@ -75,10 +68,8 @@ GtkAuthenticationDialog::GtkAuthenticationDialog(GtkWindow* parentWindow, SoupSe
     , m_loginEntry(0)
     , m_passwordEntry(0)
     , m_rememberCheckButton(0)
-#ifdef SOUP_TYPE_PASSWORD_MANAGER
     , m_isSavingPassword(false)
     , m_savePasswordHandler(0)
-#endif
 {
     GtkDialog* dialog = GTK_DIALOG(m_dialog);
     gtk_dialog_add_buttons(dialog, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OK, GTK_RESPONSE_OK, NULL);
@@ -187,47 +178,32 @@ GtkAuthenticationDialog::GtkAuthenticationDialog(GtkWindow* parentWindow, SoupSe
 
     gtk_entry_set_visibility(GTK_ENTRY(m_passwordEntry), FALSE);
 
-    if (sessionCanSavePasswords(m_session)) {
 #ifdef GTK_API_VERSION_2
-        GtkWidget* rememberBox = gtk_vbox_new(FALSE, 6);
+    GtkWidget* rememberBox = gtk_vbox_new(FALSE, 6);
 #else
-        GtkWidget* rememberBox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 6);
+    GtkWidget* rememberBox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 6);
 #endif
-        gtk_box_pack_start(GTK_BOX(vBox), rememberBox, FALSE, FALSE, 0);
+    gtk_box_pack_start(GTK_BOX(vBox), rememberBox, FALSE, FALSE, 0);
 
-        m_rememberCheckButton = gtk_check_button_new_with_mnemonic(_("_Remember password"));
-        gtk_label_set_line_wrap(GTK_LABEL(gtk_bin_get_child(GTK_BIN(m_rememberCheckButton))), TRUE);
-        gtk_box_pack_start(GTK_BOX(rememberBox), m_rememberCheckButton, FALSE, FALSE, 0);
-    }
-}
-
-static bool getSavedLogin(SoupAuth* auth, const char** username, const char** password)
-{
-#ifdef SOUP_TYPE_PASSWORD_MANAGER
-    GSList* users = soup_auth_get_saved_users(auth);
-    if (!users)
-        return false;
-
-    *username = static_cast<char*>(users->data);
-    *password = soup_auth_get_saved_password(auth, *username);
-    g_slist_free(users);
-
-    return *username && *password;
-#else
-    return false;
-#endif
+    m_rememberCheckButton = gtk_check_button_new_with_mnemonic(_("_Remember password"));
+    gtk_label_set_line_wrap(GTK_LABEL(gtk_bin_get_child(GTK_BIN(m_rememberCheckButton))), TRUE);
+    gtk_box_pack_start(GTK_BOX(rememberBox), m_rememberCheckButton, FALSE, FALSE, 0);
 }
 
 void GtkAuthenticationDialog::show()
 {
-    const char* username = 0;
-    const char* password = 0;
-    bool haveSavedLogin = getSavedLogin(m_auth.get(), &username, &password);
     soup_session_pause_message(m_session, m_message.get());
-    gtk_entry_set_text(GTK_ENTRY(m_loginEntry), username ? username : "");
-    gtk_entry_set_text(GTK_ENTRY(m_passwordEntry), password ? password : "");
-    if (m_rememberCheckButton && haveSavedLogin)
+
+    // This is just a temporary kludge until GtkAuthenticationDialog works directly with AuthenticationChallenges.
+    // See http://wkbug.com/99914
+    AuthenticationChallenge challenge(0 /* session */, m_message.get(), m_auth.get(), false, 0);
+    Credential savedCredential = credentialBackingStore().credentialForChallenge(challenge);
+    if (!savedCredential.isEmpty()) {
+        gtk_entry_set_text(GTK_ENTRY(m_loginEntry), savedCredential.user().utf8().data());
+        gtk_entry_set_text(GTK_ENTRY(m_passwordEntry), savedCredential.password().utf8().data());
         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(m_rememberCheckButton), TRUE);
+    }
+
     g_signal_connect(m_dialog, "response", G_CALLBACK(authenticationDialogResponseCallback), this);
     gtk_widget_show_all(m_dialog);
 }
@@ -239,9 +215,7 @@ void GtkAuthenticationDialog::destroy()
     soup_session_unpause_message(m_session, m_message.get());
     gtk_widget_destroy(m_dialog);
 
-#ifdef SOUP_TYPE_PASSWORD_MANAGER
     shouldDelete = !m_isSavingPassword;
-#endif
 
     // Do not delete the object if it's still saving the password,
     // the save password callback will delete it.
@@ -249,7 +223,6 @@ void GtkAuthenticationDialog::destroy()
         delete this;
 }
 
-#ifdef SOUP_TYPE_PASSWORD_MANAGER
 void GtkAuthenticationDialog::savePasswordCallback(SoupMessage* message, GtkAuthenticationDialog* dialog)
 {
     dialog->savePassword();
@@ -261,8 +234,16 @@ void GtkAuthenticationDialog::savePassword()
     ASSERT(!m_password.isNull());
 
     // Anything but 401 and 5xx means the password was accepted.
-    if (m_message.get()->status_code != 401 && m_message.get()->status_code < 500)
-        soup_auth_save_password(m_auth.get(), m_username.data(), m_password.data());
+    if (m_message.get()->status_code != 401 && m_message.get()->status_code < 500) {
+        // This is just a temporary kludge until GtkAuthenticationDialog works directly with AuthenticationChallenges.
+        // See http://wkbug.com/99914
+        AuthenticationChallenge challenge(0 /* session */, m_message.get(), m_auth.get(), false, 0);
+        Credential credentialToSave = Credential(
+            String::fromUTF8(m_username.data()),
+            String::fromUTF8(m_password.data()),
+            CredentialPersistencePermanent);
+        credentialBackingStore().storeCredentialsForChallenge(challenge, credentialToSave);
+    }
 
     // Disconnect the callback. If the authentication succeeded we are done,
     // and if it failed we'll create a new GtkAuthenticationDialog and we'll
@@ -272,7 +253,6 @@ void GtkAuthenticationDialog::savePassword()
     // Dialog has been already destroyed, after saving the password it should be deleted.
     delete this;
 }
-#endif
 
 void GtkAuthenticationDialog::authenticate()
 {
@@ -280,14 +260,12 @@ void GtkAuthenticationDialog::authenticate()
     const char *password = gtk_entry_get_text(GTK_ENTRY(m_passwordEntry));
     soup_auth_authenticate(m_auth.get(), username, password);
 
-#ifdef SOUP_TYPE_PASSWORD_MANAGER
     if (m_rememberCheckButton && gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(m_rememberCheckButton))) {
         m_username = username;
         m_password = password;
         m_isSavingPassword = true;
         m_savePasswordHandler = g_signal_connect(m_message.get(), "got-headers", G_CALLBACK(savePasswordCallback), this);
     }
-#endif
 }
 
 void GtkAuthenticationDialog::authenticationDialogResponseCallback(GtkWidget*, gint responseID, GtkAuthenticationDialog* dialog)
index 758241c..912f75d 100644 (file)
@@ -20,8 +20,6 @@
 #ifndef GtkAuthenticationDialog_h
 #define GtkAuthenticationDialog_h
 
-#define LIBSOUP_I_HAVE_READ_BUG_594377_AND_KNOW_SOUP_PASSWORD_MANAGER_MIGHT_GO_AWAY
-
 #include <wtf/gobject/GOwnPtr.h>
 #include "GRefPtrGtk.h"
 #include <libsoup/soup.h>
@@ -44,12 +42,8 @@ public:
 private:
     void destroy();
     void authenticate();
-
-#ifdef SOUP_TYPE_PASSWORD_MANAGER
     void savePassword();
     static void savePasswordCallback(SoupMessage*, GtkAuthenticationDialog*);
-#endif
-
     static void authenticationDialogResponseCallback(GtkWidget*, gint responseID, GtkAuthenticationDialog*);
 
     GtkWidget* m_dialog;
@@ -61,12 +55,10 @@ private:
     GtkWidget* m_passwordEntry;
     GtkWidget* m_rememberCheckButton;
 
-#ifdef SOUP_TYPE_PASSWORD_MANAGER
     bool m_isSavingPassword;
     unsigned long m_savePasswordHandler;
     CString m_username;
     CString m_password;
-#endif
 };
 
 } // namespace WebCore
diff --git a/Source/WebCore/platform/network/gtk/CredentialBackingStore.cpp b/Source/WebCore/platform/network/gtk/CredentialBackingStore.cpp
new file mode 100644 (file)
index 0000000..e4d1baf
--- /dev/null
@@ -0,0 +1,108 @@
+/*
+ * Copyright (C) 2012 Igalia S.L.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY IGALIA S.L. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "CredentialBackingStore.h"
+
+#define SECRET_WITH_UNSTABLE 1
+#define SECRET_API_SUBJECT_TO_CHANGE 1
+#include "AuthenticationChallenge.h"
+#include "GRefPtrGtk.h"
+#include <glib/gi18n-lib.h>
+#include <libsecret/secret.h>
+#include <libsoup/soup.h>
+#include <wtf/gobject/GOwnPtr.h>
+#include <wtf/text/CString.h>
+
+namespace WebCore {
+
+CredentialBackingStore& credentialBackingStore()
+{
+    DEFINE_STATIC_LOCAL(CredentialBackingStore, backingStore, ());
+    return backingStore;
+}
+
+static GRefPtr<GHashTable> createAttributeHashTableFromChallenge(const AuthenticationChallenge& challenge, const Credential& credential = Credential())
+{
+    SoupURI* uri = soup_message_get_uri(challenge.soupMessage());
+    GRefPtr<GHashTable> attributes = adoptGRef(secret_attributes_build(
+        SECRET_SCHEMA_COMPAT_NETWORK,
+        "domain", soup_auth_get_realm(challenge.soupAuth()),
+        "server", uri->host,
+        "protocol", uri->scheme,
+        "authtype", soup_auth_get_scheme_name(challenge.soupAuth()),
+        "port", uri->port,
+        NULL));
+    if (credential.isEmpty())
+        return attributes;
+
+    g_hash_table_insert(attributes.get(), g_strdup("user"), g_strdup(credential.user().utf8().data()));
+    return attributes;
+}
+
+Credential CredentialBackingStore::credentialForChallenge(const AuthenticationChallenge& challenge)
+{
+    GOwnPtr<GList> elements(secret_service_search_sync(
+        0, // The default SecretService.
+        SECRET_SCHEMA_COMPAT_NETWORK,
+        createAttributeHashTableFromChallenge(challenge).get(),
+        static_cast<SecretSearchFlags>(SECRET_SEARCH_UNLOCK | SECRET_SEARCH_LOAD_SECRETS), // The default behavior is to only return the most recent item.
+        0, // cancellable
+        0)); // error
+    if (!elements || !elements->data)
+        return Credential();
+
+    GRefPtr<SecretItem> secretItem = adoptGRef(static_cast<SecretItem*>(elements->data));
+    GRefPtr<GHashTable> attributes = adoptGRef(secret_item_get_attributes(secretItem.get()));
+    String user = String::fromUTF8(static_cast<const char*>(g_hash_table_lookup(attributes.get(), "user")));
+    if (user.isEmpty())
+        return Credential();
+
+    size_t length;
+    GRefPtr<SecretValue> secretValue = adoptGRef(secret_item_get_secret(secretItem.get()));
+    const char* passwordData = secret_value_get(secretValue.get(), &length);
+    String password = String::fromUTF8(passwordData, length);
+
+    return Credential(user, password, CredentialPersistencePermanent);
+}
+
+void CredentialBackingStore::storeCredentialsForChallenge(const AuthenticationChallenge& challenge, const Credential& credential)
+{
+    CString utf8Password = credential.password().utf8();
+    GRefPtr<SecretValue> newSecretValue = adoptGRef(secret_value_new(utf8Password.data(), utf8Password.length(), "text/plain"));
+
+    secret_service_store(
+        0, // The default SecretService.
+        SECRET_SCHEMA_COMPAT_NETWORK,
+        createAttributeHashTableFromChallenge(challenge, credential).get(),
+        SECRET_COLLECTION_DEFAULT,
+        _("WebKitGTK+ password"),
+        newSecretValue.get(),
+        0, // cancellable
+        0, // callback
+        0); // data
+}
+
+} // namespace WebCore
diff --git a/Source/WebCore/platform/network/gtk/CredentialBackingStore.h b/Source/WebCore/platform/network/gtk/CredentialBackingStore.h
new file mode 100644 (file)
index 0000000..383dafc
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2012 Igalia S.L.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY IGALIA S.L. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef CredentialBackingStore_h
+#define CredentialBackingStore_h
+
+#include "Credential.h"
+
+namespace WebCore {
+
+class AuthenticationChallenge;
+
+class CredentialBackingStore {
+WTF_MAKE_NONCOPYABLE(CredentialBackingStore);
+public:
+    friend CredentialBackingStore& credentialBackingStore();
+    virtual ~CredentialBackingStore() { }
+
+    Credential credentialForChallenge(const AuthenticationChallenge&);
+    void storeCredentialsForChallenge(const AuthenticationChallenge&, const Credential&);
+
+private:
+    CredentialBackingStore() { }
+};
+
+CredentialBackingStore& credentialBackingStore();
+
+} // namespace WebCore
+
+#endif // CredentialBackingStore_h
index 90aeb4f..5058645 100644 (file)
@@ -1,3 +1,15 @@
+2012-11-02  Martin Robinson  <mrobinson@igalia.com>
+
+        [GTK] Remove dependency on SoupPasswordManager
+        https://bugs.webkit.org/show_bug.cgi?id=100775
+
+        Reviewed by Carlos Garcia Campos.
+
+        Add a libsecret dependency to the build. This is necessary so that we can remove
+        a dependency on SoupPasswordManager.
+
+        * GNUmakefile.am: Use libsecret libs during WebKit1 library compilation.
+
 2012-10-24  Brady Eidson  <beidson@apple.com>
 
         Add a strategy for loader customization.
index 4b1c451..8997703 100644 (file)
@@ -95,6 +95,7 @@ libwebkitgtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_LIBA
        $(GSTREAMER_LIBS) \
        $(GTK_LIBS) \
        $(JPEG_LIBS) \
+       $(LIBSECRET_LIBS) \
        $(LIBSOUP_LIBS) \
        $(LIBXML_LIBS) \
        $(LIBXSLT_LIBS) \
index 025fe7f..ab91779 100644 (file)
@@ -1,3 +1,15 @@
+2012-11-02  Martin Robinson  <mrobinson@igalia.com>
+
+        [GTK] Remove dependency on SoupPasswordManager
+        https://bugs.webkit.org/show_bug.cgi?id=100775
+
+        Reviewed by Carlos Garcia Campos.
+
+        Add a libsecret dependency to the build. This is necessary so that we can remove
+        a dependency on SoupPasswordManager.
+
+        * GNUmakefile.am: Add libsecret CFLAGS to the WebKit2 build.
+
 2012-11-02  Byungwoo Lee  <bw80.lee@samsung.com>
 
         [EFL][WK2] Change the scope of locking in WorkQueueEfl.cpp.
index fa6e78c..0bbfeae 100644 (file)
@@ -175,6 +175,7 @@ libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_LIB
        $(GTK_LIBS) \
        $(GTK_UNIX_PRINTING_LIBS) \
        $(JPEG_LIBS) \
+       $(LIBSECRET_LIBS) \
        $(LIBSOUP_LIBS) \
        $(LIBXML_LIBS) \
        $(LIBXSLT_LIBS) \
@@ -458,6 +459,7 @@ libWebCoreGtk2_la_CPPFLAGS = \
        $(GLIB_CFLAGS) \
        $(GSTREAMER_CFLAGS) \
        $(GTK2_CFLAGS) \
+       $(LIBSECRET_CFLAGS) \
        $(LIBSOUP_CFLAGS) \
        $(LIBXML_CFLAGS) \
        $(LIBXSLT_CFLAGS) \
index 5295177..593e014 100644 (file)
@@ -962,6 +962,10 @@ PKG_CHECK_MODULES([LIBSOUP],
 AC_SUBST([LIBSOUP_CFLAGS])
 AC_SUBST([LIBSOUP_LIBS])
 
+PKG_CHECK_MODULES([LIBSECRET], [libsecret-1])
+AC_SUBST([LIBSECRET_CFLAGS])
+AC_SUBST([LIBSECRET_LIBS])
+
 # check if FreeType/FontConfig are available
 if test "$with_font_backend" = "freetype"; then
    if test "$with_target" = "directfb"; then