[Gtk] Webkit fails to build with --disable-geolocation
authormrobinson@webkit.org <mrobinson@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Mar 2012 22:14:00 +0000 (22:14 +0000)
committermrobinson@webkit.org <mrobinson@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Mar 2012 22:14:00 +0000 (22:14 +0000)
https://bugs.webkit.org/show_bug.cgi?id=81451

Patch by Zan Dobersek <zandobersek@gmail.com> 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

Source/WebKit/gtk/ChangeLog
Source/WebKit/gtk/webkit/webkitgeolocationpolicydecision.cpp
Source/WebKit/gtk/webkit/webkitgeolocationpolicydecisionprivate.h
Source/WebKit/gtk/webkit/webkitwebview.cpp

index 5f82d6ed01e84037a688c50ad0147cfd5ddf9dc6..dcc08752876a3fa732e40eb00ecf6eec1fc716cc 100644 (file)
@@ -1,3 +1,24 @@
+2012-03-23  Zan Dobersek  <zandobersek@gmail.com>
+
+        [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  <zandobersek@gmail.com>
 
         [GObject bindings] Supplemental interfaces are not disabled with the "Conditional" attribute
 2012-03-23  Zan Dobersek  <zandobersek@gmail.com>
 
         [GObject bindings] Supplemental interfaces are not disabled with the "Conditional" attribute
index 2523c9b739e1c07980da28b8130f90265b3de96e..930b68792d9944576975989b03254c463ea52ccf 100644 (file)
@@ -22,8 +22,7 @@
 
 #include "Geolocation.h"
 #include "webkitgeolocationpolicydecisionprivate.h"
 
 #include "Geolocation.h"
 #include "webkitgeolocationpolicydecisionprivate.h"
-
-using namespace WebCore;
+#include "webkitglobalsprivate.h"
 
 /**
  * SECTION:webkitgeolocationpolicydecision
 
 /**
  * SECTION:webkitgeolocationpolicydecision
@@ -39,7 +38,9 @@ G_DEFINE_TYPE(WebKitGeolocationPolicyDecision, webkit_geolocation_policy_decisio
 
 struct _WebKitGeolocationPolicyDecisionPrivate {
     WebKitWebFrame* frame;
 
 struct _WebKitGeolocationPolicyDecisionPrivate {
     WebKitWebFrame* frame;
-    Geolocation* geolocation;
+#if ENABLE(GEOLOCATION)
+    WebCore::Geolocation* geolocation;
+#endif
 };
 
 static void webkit_geolocation_policy_decision_class_init(WebKitGeolocationPolicyDecisionClass* decisionClass)
 };
 
 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);
 }
 
     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));
 {
     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;
 }
     priv->geolocation = geolocation;
     return decision;
 }
+#endif
 
 /**
  * webkit_geolocation_policy_allow
 
 /**
  * webkit_geolocation_policy_allow
@@ -73,10 +76,14 @@ WebKitGeolocationPolicyDecision* webkit_geolocation_policy_decision_new(WebKitWe
  */
 void webkit_geolocation_policy_allow(WebKitGeolocationPolicyDecision* decision)
 {
  */
 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);
     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)
 {
  */
 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);
     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
 }
 
 }
 
index d250044e47705b4d13ca47a89ce1036bf0d5892f..177154cd2e12c7c46565446dde06b8163d9ab7e7 100644 (file)
 
 #include "webkitgeolocationpolicydecision.h"
 
 
 #include "webkitgeolocationpolicydecision.h"
 
+#if ENABLE(GEOLOCATION)
+
 extern "C" {
 
 WebKitGeolocationPolicyDecision* webkit_geolocation_policy_decision_new(WebKitWebFrame*, WebCore::Geolocation*);
 
 }
 
 extern "C" {
 
 WebKitGeolocationPolicyDecision* webkit_geolocation_policy_decision_new(WebKitWebFrame*, WebCore::Geolocation*);
 
 }
 
+#endif // ENABLE(GEOLOCATION)
+
 #endif
 #endif
index f15633d1b015ac41af12eda144151a8b5a4f6bd1..5d85dae83c4c791267e1f1ea744d3519209b7ff5 100644 (file)
@@ -3586,7 +3586,9 @@ static void webkit_web_view_init(WebKitWebView* webView)
 #endif
 
     if (DumpRenderTreeSupportGtk::dumpRenderTreeModeEnabled()) {
 #endif
 
     if (DumpRenderTreeSupportGtk::dumpRenderTreeModeEnabled()) {
+#if ENABLE(GEOLOCATION)
         static_cast<GeolocationClientMock*>(pageClients.geolocationClient)->setController(priv->corePage->geolocationController());
         static_cast<GeolocationClientMock*>(pageClients.geolocationClient)->setController(priv->corePage->geolocationController());
+#endif
         // Set some testing-specific settings
         priv->corePage->settings()->setInteractiveFormValidationEnabled(true);
         priv->corePage->settings()->setValidationMessageTimerMagnification(-1);
         // Set some testing-specific settings
         priv->corePage->settings()->setInteractiveFormValidationEnabled(true);
         priv->corePage->settings()->setValidationMessageTimerMagnification(-1);