• Lily Chen's avatar
    Add CookieAccessSemantics to cookie change notifications · 19cced42
    Lily Chen authored
    This change adds a CookieAccessSemantics field to the cookie change
    notification interfaces, such that the access semantics of a cookie at
    the time of the reported change can also be included in the change
    notification. The CookieAccessSemantics is used to determine whether a
    cookie should be treated according to "legacy" rules, based on a
    policy setting. It affects whether the cookie may be included on a given
    request, and some cookie change consumers care about this because they
    check whether the cookie change should be observed based on whether it
    would have been included on a request.
    
    This is accomplished by bundling the changed cookie, the
    CookieAccessSemantics, and CookieChangeCause into a new struct,
    CookieChangeInfo, and passing a CookieChangeInfo along to notification
    subscribers.
    
    This change should not produce any behavior change for consumers who
    don't care about the CookieAccessSemantics, which is most of them, for
    which this will just pass them an extra parameter that they don't need.
    The places where behavior changes are in the CookieStore API
    (CookieChangeSubscription::ShouldObserveChangeTo), the
    RestrictedCookieManager::Listener (OnCookieChange), and
    CookieMonsterChangeDispatcher::Subscription (DispatchChange), where
    now the call to CanonicalCookie::IncludeForRequestURL is able to pass
    the CookieAccessSemantics in order to properly compute whether the
    cookie change should be observed.
    
    TBR=khorimoto@chromium.org
    
    Bug: 978172
    Change-Id: I712972391ff0adcc4b94481bba156dc0e7b759a6
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1854649Reviewed-by: default avatarLily Chen <chlily@chromium.org>
    Reviewed-by: default avatarDavid Roger <droger@chromium.org>
    Reviewed-by: default avatarMohammad Refaat <mrefaat@chromium.org>
    Reviewed-by: default avatarWez <wez@chromium.org>
    Reviewed-by: default avatarVictor Costan <pwnall@chromium.org>
    Reviewed-by: default avatarRichard Coles <torne@chromium.org>
    Reviewed-by: default avatarKaran Bhatia <karandeepb@chromium.org>
    Reviewed-by: default avatarMarijn Kruisselbrink <mek@chromium.org>
    Reviewed-by: default avatarMaksim Orlovich <morlovich@chromium.org>
    Reviewed-by: default avatarMartin Barbella <mbarbella@chromium.org>
    Commit-Queue: Lily Chen <chlily@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#707116}
    19cced42
consistency_cookie_browsertest.cc 5.8 KB