Title: [129959] trunk/Source/WebKit2
Revision
129959
Author
[email protected]
Date
2012-09-28 16:14:53 -0700 (Fri, 28 Sep 2012)

Log Message

<rdar://problem/12398537> WebKit2 lacks API for disabling document.cookie like -[WebView _setCookieEnabled:]
https://bugs.webkit.org/show_bug.cgi?id=97939

Reviewed by Sam Weinig.

* Shared/WebPreferencesStore.h:
(WebKit): Defined CookieEnabled key with a default value of true.
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetCookieEnabled): Added this setter.
(WKPreferencesGetCookieEnabled): Added this getter.
* UIProcess/API/C/WKPreferencesPrivate.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences): Added a call to Settings::setCookieEnabled to push the
preference into Settings.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (129958 => 129959)


--- trunk/Source/WebKit2/ChangeLog	2012-09-28 23:12:56 UTC (rev 129958)
+++ trunk/Source/WebKit2/ChangeLog	2012-09-28 23:14:53 UTC (rev 129959)
@@ -1,3 +1,20 @@
+2012-09-28  Dan Bernstein  <[email protected]>
+
+        <rdar://problem/12398537> WebKit2 lacks API for disabling document.cookie like -[WebView _setCookieEnabled:]
+        https://bugs.webkit.org/show_bug.cgi?id=97939
+
+        Reviewed by Sam Weinig.
+
+        * Shared/WebPreferencesStore.h:
+        (WebKit): Defined CookieEnabled key with a default value of true.
+        * UIProcess/API/C/WKPreferences.cpp:
+        (WKPreferencesSetCookieEnabled): Added this setter.
+        (WKPreferencesGetCookieEnabled): Added this getter.
+        * UIProcess/API/C/WKPreferencesPrivate.h:
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::updatePreferences): Added a call to Settings::setCookieEnabled to push the
+        preference into Settings.
+
 2012-09-28  Sam Weinig  <[email protected]>
 
         Fix pluralization of Info.plist key.

Modified: trunk/Source/WebKit2/Shared/WebPreferencesStore.h (129958 => 129959)


--- trunk/Source/WebKit2/Shared/WebPreferencesStore.h	2012-09-28 23:12:56 UTC (rev 129958)
+++ trunk/Source/WebKit2/Shared/WebPreferencesStore.h	2012-09-28 23:14:53 UTC (rev 129959)
@@ -135,6 +135,7 @@
     macro(StorageBlockingPolicy, storageBlockingPolicy, UInt32, uint32_t, 0) \
     macro(ScrollAnimatorEnabled, scrollAnimatorEnabled, Bool, bool, DEFAULT_WEBKIT_SCROLL_ANIMATOR_ENABLED) \
     macro(ScreenFontSubstitutionEnabled, screenFontSubstitutionEnabled, Bool, bool, DEFAULT_SCREEN_FONT_SUBSTITUTION_ENABLED) \
+    macro(CookieEnabled, cookieEnabled, Bool, bool, true) \
     \
 
 #define FOR_EACH_WEBKIT_DOUBLE_PREFERENCE(macro) \

Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp (129958 => 129959)


--- trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp	2012-09-28 23:12:56 UTC (rev 129958)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp	2012-09-28 23:14:53 UTC (rev 129959)
@@ -298,6 +298,16 @@
     return toImpl(preferencesRef)->screenFontSubstitutionEnabled();
 }
 
+void WKPreferencesSetCookieEnabled(WKPreferencesRef preferencesRef, bool enabled)
+{
+    toImpl(preferencesRef)->setCookieEnabled(enabled);
+}
+
+bool WKPreferencesGetCookieEnabled(WKPreferencesRef preferencesRef)
+{
+    return toImpl(preferencesRef)->cookieEnabled();
+}
+
 void WKPreferencesSetEditableLinkBehavior(WKPreferencesRef preferencesRef, WKEditableLinkBehavior wkBehavior)
 {
     toImpl(preferencesRef)->setEditableLinkBehavior(toEditableLinkBehavior(wkBehavior));

Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesPrivate.h (129958 => 129959)


--- trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesPrivate.h	2012-09-28 23:12:56 UTC (rev 129958)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesPrivate.h	2012-09-28 23:14:53 UTC (rev 129959)
@@ -219,6 +219,10 @@
 WK_EXPORT void WKPreferencesSetScreenFontSubstitutionEnabled(WKPreferencesRef preferences, bool enabled);
 WK_EXPORT bool WKPreferencesGetScreenFontSubstitutionEnabled(WKPreferencesRef preferences);
 
+// Defaults to true
+WK_EXPORT void WKPreferencesSetCookieEnabled(WKPreferencesRef preferences, bool enabled);
+WK_EXPORT bool WKPreferencesGetCookieEnabled(WKPreferencesRef preferences);
+
 WK_EXPORT void WKPreferencesResetTestRunnerOverrides(WKPreferencesRef preferencesRef);
 
 #ifdef __cplusplus

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (129958 => 129959)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2012-09-28 23:12:56 UTC (rev 129958)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2012-09-28 23:14:53 UTC (rev 129959)
@@ -2129,6 +2129,7 @@
 
     settings->setShouldRespectImageOrientation(store.getBoolValueForKey(WebPreferencesKey::shouldRespectImageOrientationKey()));
     settings->setStorageBlockingPolicy(static_cast<SecurityOrigin::StorageBlockingPolicy>(store.getUInt32ValueForKey(WebPreferencesKey::storageBlockingPolicyKey())));
+    settings->setCookieEnabled(store.getBoolValueForKey(WebPreferencesKey::cookieEnabledKey()));
 
     settings->setDiagnosticLoggingEnabled(store.getBoolValueForKey(WebPreferencesKey::diagnosticLoggingEnabledKey()));
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to