Changeset 147499 in webkit


Ignore:
Timestamp:
Apr 2, 2013 2:24:14 PM (11 years ago)
Author:
Martin Robinson
Message:

[GTK] Make libsecret optional
https://bugs.webkit.org/show_bug.cgi?id=113821

Reviewed by Gustavo Noronha Silva.

.:

Add a configuration option to disable credential storage and thus remove
the libsecret dependency. This should make it possible to build WebKit 2.x
on Windows again.

  • Source/autotools/FindDependencies.m4: Only look for libsecret if credential storage is active.
  • Source/autotools/PrintBuildConfiguration.m4: Print whether or not credential storage is active.
  • Source/autotools/ReadCommandLineArguments.m4: Added an option to control credential storage.
  • Source/autotools/SetupAutoconfHeader.m4: Expose credential storage setting to code.

Source/WebCore:

Don't try to use libsecret if credential storage is disabled.

  • platform/gtk/GRefPtrGtk.cpp: Protect libsecret sections.
  • platform/gtk/GRefPtrGtk.h: Ditto.
  • platform/network/gtk/CredentialBackingStore.cpp: Ditto.
Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r147416 r147499  
     12013-04-02  Martin Robinson  <mrobinson@igalia.com>
     2
     3        [GTK] Make libsecret optional
     4        https://bugs.webkit.org/show_bug.cgi?id=113821
     5
     6        Reviewed by Gustavo Noronha Silva.
     7
     8        Add a configuration option to disable credential storage and thus remove
     9        the libsecret dependency. This should make it possible to build WebKit 2.x
     10        on Windows again.
     11
     12        * Source/autotools/FindDependencies.m4: Only look for libsecret if credential storage is active.
     13        * Source/autotools/PrintBuildConfiguration.m4: Print whether or not credential storage is active.
     14        * Source/autotools/ReadCommandLineArguments.m4: Added an option to control credential storage.
     15        * Source/autotools/SetupAutoconfHeader.m4: Expose credential storage setting to code.
     16
    1172013-04-02  Sheriff Bot  <webkit.review.bot@gmail.com>
    218
  • trunk/Source/WebCore/ChangeLog

    r147495 r147499  
     12013-04-02  Martin Robinson  <mrobinson@igalia.com>
     2
     3        [GTK] Make libsecret optional
     4        https://bugs.webkit.org/show_bug.cgi?id=113821
     5
     6        Reviewed by Gustavo Noronha Silva.
     7
     8        Don't try to use libsecret if credential storage is disabled.
     9
     10        * platform/gtk/GRefPtrGtk.cpp: Protect libsecret sections.
     11        * platform/gtk/GRefPtrGtk.h: Ditto.
     12        * platform/network/gtk/CredentialBackingStore.cpp: Ditto.
     13
    1142013-04-02  Bem Jones-Bey  <bjonesbe@adobe.com>
    215
  • trunk/Source/WebCore/platform/gtk/GRefPtrGtk.cpp

    r133317 r147499  
    2121#include "GRefPtrGtk.h"
    2222
     23#include <glib.h>
     24#include <gtk/gtk.h>
     25
     26#if ENABLE(CREDENTIAL_STORAGE)
    2327#define SECRET_WITH_UNSTABLE 1
    2428#define SECRET_API_SUBJECT_TO_CHANGE 1
    25 
    26 #include <glib.h>
    27 #include <gtk/gtk.h>
    2829#include <libsecret/secret.h>
     30#endif
    2931
    3032namespace WTF {
     
    4345}
    4446
     47#if ENABLE(CREDENTIAL_STORAGE)
    4548template <> SecretValue* refGPtr(SecretValue* ptr)
    4649{
     
    5558        secret_value_unref(ptr);
    5659}
     60#endif
    5761
    5862#ifdef GTK_API_VERSION_2
  • trunk/Source/WebCore/platform/gtk/GRefPtrGtk.h

    r133317 r147499  
    3131template <> void derefGPtr(GtkTargetList* ptr);
    3232
     33#if ENABLE(CREDENTIAL_STORAGE)
    3334template <> SecretValue* refGPtr(SecretValue* ptr);
    3435template <> void derefGPtr(SecretValue* ptr);
     36#endif
    3537
    3638#ifdef GTK_API_VERSION_2
  • trunk/Source/WebCore/platform/network/gtk/CredentialBackingStore.cpp

    r134955 r147499  
    11/*
    2  * Copyright (C) 2012 Igalia S.L.
     2 * Copyright (C) 2012, 2013 Igalia S.L.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2727#include "CredentialBackingStore.h"
    2828
     29#if ENABLE(CREDENTIAL_STORAGE)
    2930#define SECRET_WITH_UNSTABLE 1
    3031#define SECRET_API_SUBJECT_TO_CHANGE 1
     
    3637#include <wtf/gobject/GOwnPtr.h>
    3738#include <wtf/text/CString.h>
     39#endif
    3840
    3941namespace WebCore {
     
    4547}
    4648
     49#if ENABLE(CREDENTIAL_STORAGE)
    4750static GRefPtr<GHashTable> createAttributeHashTableFromChallenge(const AuthenticationChallenge& challenge, const Credential& credential = Credential())
    4851{
     
    9699    callback(Credential(user, password, CredentialPersistencePermanent), data);
    97100}
     101#endif // ENABLE(CREDENTIAL_STORAGE)
    98102
    99103void CredentialBackingStore::credentialForChallenge(const AuthenticationChallenge& challenge, CredentialForChallengeCallback callback, void* data)
    100104{
     105#if ENABLE(CREDENTIAL_STORAGE)
    101106    // The default flag only returns the most recent item, not all of them.
    102107    SecretSearchFlags searchFlags = static_cast<SecretSearchFlags>(SECRET_SEARCH_UNLOCK | SECRET_SEARCH_LOAD_SECRETS);
     
    113118        reinterpret_cast<GAsyncReadyCallback>(credentialForChallengeAsyncReadyCallback),
    114119        callbackData);
     120#else
     121    callback(Credential(), data);
     122#endif // ENABLE(CREDENTIAL_STORAGE)
    115123}
    116124
    117125void CredentialBackingStore::storeCredentialsForChallenge(const AuthenticationChallenge& challenge, const Credential& credential)
    118126{
     127#if ENABLE(CREDENTIAL_STORAGE)
    119128    CString utf8Password = credential.password().utf8();
    120129    GRefPtr<SecretValue> newSecretValue = adoptGRef(secret_value_new(utf8Password.data(), utf8Password.length(), "text/plain"));
     
    130139        0, // callback
    131140        0); // data
     141#endif // ENABLE(CREDENTIAL_STORAGE)
    132142}
    133143
  • trunk/Source/autotools/FindDependencies.m4

    r145912 r147499  
    360360AC_SUBST([LIBSOUP_LIBS])
    361361
    362 PKG_CHECK_MODULES([LIBSECRET], [libsecret-1])
    363 AC_SUBST([LIBSECRET_CFLAGS])
    364 AC_SUBST([LIBSECRET_LIBS])
     362if test "$enable_credential_storage" = "yes"; then
     363    PKG_CHECK_MODULES([LIBSECRET], [libsecret-1])
     364    AC_SUBST([LIBSECRET_CFLAGS])
     365    AC_SUBST([LIBSECRET_LIBS])
     366fi
    365367
    366368# Check if FreeType/FontConfig are available.
  • trunk/Source/autotools/PrintBuildConfiguration.m4

    r145859 r147499  
    2525 SVG support                                              : $enable_svg
    2626 Spellcheck support                                       : $enable_spellcheck
     27 Credential storage support                               : $enable_credential_storage
    2728 Web Audio support                                        : $enable_web_audio
    2829 WebGL                                                    : $enable_webgl
  • trunk/Source/autotools/ReadCommandLineArguments.m4

    r145859 r147499  
    6565AC_MSG_RESULT([$enable_spellcheck])
    6666
     67AC_MSG_CHECKING([whether to enable credential storage])
     68AC_ARG_ENABLE([credential_storage],
     69    [AS_HELP_STRING([--enable-credential-storage],[enable support for credential storage using libsecret [default=yes]])],
     70    [],
     71    [enable_credential_storage="yes"])
     72AC_MSG_RESULT([$enable_credential_storage])
     73
    6774AC_ARG_ENABLE(glx,
    6875    AC_HELP_STRING([--enable-glx], [enable support for GLX [default=auto]]),
  • trunk/Source/autotools/SetupAutoconfHeader.m4

    r143604 r147499  
    116116fi
    117117
     118if test "$enable_credential_storage" = "yes"; then
     119    AC_DEFINE([WTF_ENABLE_CREDENTIAL_STORAGE], [1], [ ])
     120fi
    118121
Note: See TracChangeset for help on using the changeset viewer.