From: mrobinson@webkit.org Date: Fri, 23 Mar 2012 22:14:00 +0000 (+0000) Subject: [Gtk] Webkit fails to build with --disable-geolocation X-Git-Url: http://git.webkit.org/?p=WebKit-https.git;a=commitdiff_plain;h=d3a4b3d9a7b1dd39817ca14921c8e7e3a3c9b6e5;hp=7ce7b8aca0d19cc81db9b96135e11172719f23da [Gtk] Webkit fails to build with --disable-geolocation https://bugs.webkit.org/show_bug.cgi?id=81451 Patch by Zan Dobersek on 2012-03-23 Reviewed by Benjamin Poulain. Wrap uses of WebCore::Geolocation in WebKitGeolocationPolicyDecision and WebKitWebView in ifdefs, removing compilation errors when compiling with geolocation support disabled. Affected public API methods are then stubs, throwing a warning that feature was not enabled at compile-time. * webkit/webkitgeolocationpolicydecision.cpp: (_WebKitGeolocationPolicyDecisionPrivate): (webkit_geolocation_policy_decision_new): (webkit_geolocation_policy_allow): (webkit_geolocation_policy_deny): * webkit/webkitgeolocationpolicydecisionprivate.h: * webkit/webkitwebview.cpp: (webkit_web_view_init): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@111915 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- diff --git a/Source/WebKit/gtk/ChangeLog b/Source/WebKit/gtk/ChangeLog index 5f82d6e..dcc0875 100644 --- a/Source/WebKit/gtk/ChangeLog +++ b/Source/WebKit/gtk/ChangeLog @@ -1,5 +1,26 @@ 2012-03-23 Zan Dobersek + [Gtk] Webkit fails to build with --disable-geolocation + https://bugs.webkit.org/show_bug.cgi?id=81451 + + Reviewed by Benjamin Poulain. + + Wrap uses of WebCore::Geolocation in WebKitGeolocationPolicyDecision + and WebKitWebView in ifdefs, removing compilation errors when compiling + with geolocation support disabled. Affected public API methods are then + stubs, throwing a warning that feature was not enabled at compile-time. + + * webkit/webkitgeolocationpolicydecision.cpp: + (_WebKitGeolocationPolicyDecisionPrivate): + (webkit_geolocation_policy_decision_new): + (webkit_geolocation_policy_allow): + (webkit_geolocation_policy_deny): + * webkit/webkitgeolocationpolicydecisionprivate.h: + * webkit/webkitwebview.cpp: + (webkit_web_view_init): + +2012-03-23 Zan Dobersek + [GObject bindings] Supplemental interfaces are not disabled with the "Conditional" attribute https://bugs.webkit.org/show_bug.cgi?id=80030 diff --git a/Source/WebKit/gtk/webkit/webkitgeolocationpolicydecision.cpp b/Source/WebKit/gtk/webkit/webkitgeolocationpolicydecision.cpp index 2523c9b..930b687 100644 --- a/Source/WebKit/gtk/webkit/webkitgeolocationpolicydecision.cpp +++ b/Source/WebKit/gtk/webkit/webkitgeolocationpolicydecision.cpp @@ -22,8 +22,7 @@ #include "Geolocation.h" #include "webkitgeolocationpolicydecisionprivate.h" - -using namespace WebCore; +#include "webkitglobalsprivate.h" /** * SECTION:webkitgeolocationpolicydecision @@ -39,7 +38,9 @@ G_DEFINE_TYPE(WebKitGeolocationPolicyDecision, webkit_geolocation_policy_decisio struct _WebKitGeolocationPolicyDecisionPrivate { WebKitWebFrame* frame; - Geolocation* geolocation; +#if ENABLE(GEOLOCATION) + WebCore::Geolocation* geolocation; +#endif }; static void webkit_geolocation_policy_decision_class_init(WebKitGeolocationPolicyDecisionClass* decisionClass) @@ -52,7 +53,8 @@ static void webkit_geolocation_policy_decision_init(WebKitGeolocationPolicyDecis decision->priv = G_TYPE_INSTANCE_GET_PRIVATE(decision, WEBKIT_TYPE_GEOLOCATION_POLICY_DECISION, WebKitGeolocationPolicyDecisionPrivate); } -WebKitGeolocationPolicyDecision* webkit_geolocation_policy_decision_new(WebKitWebFrame* frame, Geolocation* geolocation) +#if ENABLE(GEOLOCATION) +WebKitGeolocationPolicyDecision* webkit_geolocation_policy_decision_new(WebKitWebFrame* frame, WebCore::Geolocation* geolocation) { g_return_val_if_fail(frame, NULL); WebKitGeolocationPolicyDecision* decision = WEBKIT_GEOLOCATION_POLICY_DECISION(g_object_new(WEBKIT_TYPE_GEOLOCATION_POLICY_DECISION, NULL)); @@ -62,6 +64,7 @@ WebKitGeolocationPolicyDecision* webkit_geolocation_policy_decision_new(WebKitWe priv->geolocation = geolocation; return decision; } +#endif /** * webkit_geolocation_policy_allow @@ -73,10 +76,14 @@ WebKitGeolocationPolicyDecision* webkit_geolocation_policy_decision_new(WebKitWe */ void webkit_geolocation_policy_allow(WebKitGeolocationPolicyDecision* decision) { +#if ENABLE(GEOLOCATION) g_return_if_fail(WEBKIT_IS_GEOLOCATION_POLICY_DECISION(decision)); WebKitGeolocationPolicyDecisionPrivate* priv = decision->priv; priv->geolocation->setIsAllowed(TRUE); +#else + WEBKIT_WARN_FEATURE_NOT_PRESENT("Geolocation") +#endif } /** @@ -89,9 +96,13 @@ void webkit_geolocation_policy_allow(WebKitGeolocationPolicyDecision* decision) */ void webkit_geolocation_policy_deny(WebKitGeolocationPolicyDecision* decision) { +#if ENABLE(GEOLOCATION) g_return_if_fail(WEBKIT_IS_GEOLOCATION_POLICY_DECISION(decision)); WebKitGeolocationPolicyDecisionPrivate* priv = decision->priv; priv->geolocation->setIsAllowed(FALSE); +#else + WEBKIT_WARN_FEATURE_NOT_PRESENT("Geolocation") +#endif } diff --git a/Source/WebKit/gtk/webkit/webkitgeolocationpolicydecisionprivate.h b/Source/WebKit/gtk/webkit/webkitgeolocationpolicydecisionprivate.h index d250044..177154c 100644 --- a/Source/WebKit/gtk/webkit/webkitgeolocationpolicydecisionprivate.h +++ b/Source/WebKit/gtk/webkit/webkitgeolocationpolicydecisionprivate.h @@ -25,10 +25,14 @@ #include "webkitgeolocationpolicydecision.h" +#if ENABLE(GEOLOCATION) + extern "C" { WebKitGeolocationPolicyDecision* webkit_geolocation_policy_decision_new(WebKitWebFrame*, WebCore::Geolocation*); } +#endif // ENABLE(GEOLOCATION) + #endif diff --git a/Source/WebKit/gtk/webkit/webkitwebview.cpp b/Source/WebKit/gtk/webkit/webkitwebview.cpp index f15633d..5d85dae 100644 --- a/Source/WebKit/gtk/webkit/webkitwebview.cpp +++ b/Source/WebKit/gtk/webkit/webkitwebview.cpp @@ -3586,7 +3586,9 @@ static void webkit_web_view_init(WebKitWebView* webView) #endif if (DumpRenderTreeSupportGtk::dumpRenderTreeModeEnabled()) { +#if ENABLE(GEOLOCATION) static_cast(pageClients.geolocationClient)->setController(priv->corePage->geolocationController()); +#endif // Set some testing-specific settings priv->corePage->settings()->setInteractiveFormValidationEnabled(true); priv->corePage->settings()->setValidationMessageTimerMagnification(-1);