Changeset 129959 in webkit


Ignore:
Timestamp:
Sep 28, 2012, 4:14:53 PM (13 years ago)
Author:
mitz@apple.com
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.

Location:
trunk/Source/WebKit2
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r129957 r129959  
     12012-09-28  Dan Bernstein  <mitz@apple.com>
     2
     3        <rdar://problem/12398537> WebKit2 lacks API for disabling document.cookie like -[WebView _setCookieEnabled:]
     4        https://bugs.webkit.org/show_bug.cgi?id=97939
     5
     6        Reviewed by Sam Weinig.
     7
     8        * Shared/WebPreferencesStore.h:
     9        (WebKit): Defined CookieEnabled key with a default value of true.
     10        * UIProcess/API/C/WKPreferences.cpp:
     11        (WKPreferencesSetCookieEnabled): Added this setter.
     12        (WKPreferencesGetCookieEnabled): Added this getter.
     13        * UIProcess/API/C/WKPreferencesPrivate.h:
     14        * WebProcess/WebPage/WebPage.cpp:
     15        (WebKit::WebPage::updatePreferences): Added a call to Settings::setCookieEnabled to push the
     16        preference into Settings.
     17
    1182012-09-28  Sam Weinig  <sam@webkit.org>
    219
  • trunk/Source/WebKit2/Shared/WebPreferencesStore.h

    r129593 r129959  
    136136    macro(ScrollAnimatorEnabled, scrollAnimatorEnabled, Bool, bool, DEFAULT_WEBKIT_SCROLL_ANIMATOR_ENABLED) \
    137137    macro(ScreenFontSubstitutionEnabled, screenFontSubstitutionEnabled, Bool, bool, DEFAULT_SCREEN_FONT_SUBSTITUTION_ENABLED) \
     138    macro(CookieEnabled, cookieEnabled, Bool, bool, true) \
    138139    \
    139140
  • trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp

    r129097 r129959  
    299299}
    300300
     301void WKPreferencesSetCookieEnabled(WKPreferencesRef preferencesRef, bool enabled)
     302{
     303    toImpl(preferencesRef)->setCookieEnabled(enabled);
     304}
     305
     306bool WKPreferencesGetCookieEnabled(WKPreferencesRef preferencesRef)
     307{
     308    return toImpl(preferencesRef)->cookieEnabled();
     309}
     310
    301311void WKPreferencesSetEditableLinkBehavior(WKPreferencesRef preferencesRef, WKEditableLinkBehavior wkBehavior)
    302312{
  • trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesPrivate.h

    r129097 r129959  
    220220WK_EXPORT bool WKPreferencesGetScreenFontSubstitutionEnabled(WKPreferencesRef preferences);
    221221
     222// Defaults to true
     223WK_EXPORT void WKPreferencesSetCookieEnabled(WKPreferencesRef preferences, bool enabled);
     224WK_EXPORT bool WKPreferencesGetCookieEnabled(WKPreferencesRef preferences);
     225
    222226WK_EXPORT void WKPreferencesResetTestRunnerOverrides(WKPreferencesRef preferencesRef);
    223227
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp

    r129750 r129959  
    21302130    settings->setShouldRespectImageOrientation(store.getBoolValueForKey(WebPreferencesKey::shouldRespectImageOrientationKey()));
    21312131    settings->setStorageBlockingPolicy(static_cast<SecurityOrigin::StorageBlockingPolicy>(store.getUInt32ValueForKey(WebPreferencesKey::storageBlockingPolicyKey())));
     2132    settings->setCookieEnabled(store.getBoolValueForKey(WebPreferencesKey::cookieEnabledKey()));
    21322133
    21332134    settings->setDiagnosticLoggingEnabled(store.getBoolValueForKey(WebPreferencesKey::diagnosticLoggingEnabledKey()));
Note: See TracChangeset for help on using the changeset viewer.