Title: [134469] branches/safari-536.28-branch/Source/WebKit2

Diff

Modified: branches/safari-536.28-branch/Source/WebKit2/ChangeLog (134468 => 134469)


--- branches/safari-536.28-branch/Source/WebKit2/ChangeLog	2012-11-13 20:39:26 UTC (rev 134468)
+++ branches/safari-536.28-branch/Source/WebKit2/ChangeLog	2012-11-13 20:54:46 UTC (rev 134469)
@@ -1,3 +1,24 @@
+2012-11-13  Lucas Forschler  <[email protected]>
+
+        Merge r129959
+
+    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-11-12  Lucas Forschler  <[email protected]>
 
         Merge r133379
@@ -47880,3 +47901,4 @@
 .
 .
 .
+.

Modified: branches/safari-536.28-branch/Source/WebKit2/Shared/WebPreferencesStore.h (134468 => 134469)


--- branches/safari-536.28-branch/Source/WebKit2/Shared/WebPreferencesStore.h	2012-11-13 20:39:26 UTC (rev 134468)
+++ branches/safari-536.28-branch/Source/WebKit2/Shared/WebPreferencesStore.h	2012-11-13 20:54:46 UTC (rev 134469)
@@ -115,6 +115,7 @@
     macro(AsynchronousPluginInitializationEnabled, asynchronousPluginInitializationEnabled, Bool, bool, false) \
     macro(AsynchronousPluginInitializationEnabledForAllPlugins, asynchronousPluginInitializationEnabledForAllPlugins, Bool, bool, false) \
     macro(ArtificialPluginInitializationDelayEnabled, artificialPluginInitializationDelayEnabled, Bool, bool, false) \
+    macro(CookieEnabled, cookieEnabled, Bool, bool, true) \
     \
 
 #define FOR_EACH_WEBKIT_DOUBLE_PREFERENCE(macro) \

Modified: branches/safari-536.28-branch/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp (134468 => 134469)


--- branches/safari-536.28-branch/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp	2012-11-13 20:39:26 UTC (rev 134468)
+++ branches/safari-536.28-branch/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp	2012-11-13 20:54:46 UTC (rev 134469)
@@ -288,6 +288,16 @@
     return toImpl(preferencesRef)->minimumFontSize();
 }
 
+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: branches/safari-536.28-branch/Source/WebKit2/UIProcess/API/C/WKPreferencesPrivate.h (134468 => 134469)


--- branches/safari-536.28-branch/Source/WebKit2/UIProcess/API/C/WKPreferencesPrivate.h	2012-11-13 20:39:26 UTC (rev 134468)
+++ branches/safari-536.28-branch/Source/WebKit2/UIProcess/API/C/WKPreferencesPrivate.h	2012-11-13 20:54:46 UTC (rev 134469)
@@ -195,6 +195,10 @@
 WK_EXPORT void WKPreferencesSetArtificialPluginInitializationDelayEnabled(WKPreferencesRef preferencesRef, bool enabled);
 WK_EXPORT bool WKPreferencesGetArtificialPluginInitializationDelayEnabled(WKPreferencesRef preferencesRef);
 
+// 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: branches/safari-536.28-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (134468 => 134469)


--- branches/safari-536.28-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2012-11-13 20:39:26 UTC (rev 134468)
+++ branches/safari-536.28-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2012-11-13 20:54:46 UTC (rev 134469)
@@ -2016,6 +2016,7 @@
 #endif
 
     settings->setShouldRespectImageOrientation(store.getBoolValueForKey(WebPreferencesKey::shouldRespectImageOrientationKey()));
+    m_page->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