Changeset 251887 in webkit


Ignore:
Timestamp:
Oct 31, 2019 3:40:16 PM (5 years ago)
Author:
Russell Epstein
Message:

Unreviewed, rolling out r251861.

Caused 50+ Layout Test Crashes

Reverted changeset:

"Use SecurityOriginData in NetworkProcess where possible
without other changes"
https://bugs.webkit.org/show_bug.cgi?id=203615
https://trac.webkit.org/changeset/251861

Location:
trunk/Source
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r251877 r251887  
     12019-10-31  Russell Epstein  <repstein@apple.com>
     2
     3        Unreviewed, rolling out r251861.
     4
     5        Caused 50+ Layout Test Crashes
     6
     7        Reverted changeset:
     8
     9        "Use SecurityOriginData in NetworkProcess where possible
     10        without other changes"
     11        https://bugs.webkit.org/show_bug.cgi?id=203615
     12        https://trac.webkit.org/changeset/251861
     13
    1142019-10-31  Said Abou-Hallawa  <sabouhallawa@apple.com>
    215
  • trunk/Source/WebCore/page/SecurityOrigin.cpp

    r251861 r251887  
    172172}
    173173
    174 SecurityOrigin::SecurityOrigin(const SecurityOrigin& other)
    175     : m_data { other.m_data.isolatedCopy() }
    176     , m_domain { other.m_domain.isolatedCopy() }
    177     , m_filePath { other.m_filePath.isolatedCopy() }
    178     , m_isUnique { other.m_isUnique }
    179     , m_universalAccess { other.m_universalAccess }
    180     , m_domainWasSetInDOM { other.m_domainWasSetInDOM }
    181     , m_canLoadLocalResources { other.m_canLoadLocalResources }
    182     , m_storageBlockingPolicy { other.m_storageBlockingPolicy }
    183     , m_enforcesFilePathSeparation { other.m_enforcesFilePathSeparation }
    184     , m_needsStorageAccessFromFileURLsQuirk { other.m_needsStorageAccessFromFileURLsQuirk }
    185     , m_isPotentiallyTrustworthy { other.m_isPotentiallyTrustworthy }
    186     , m_isLocal { other.m_isLocal }
     174SecurityOrigin::SecurityOrigin(const SecurityOrigin* other)
     175    : m_data { other->m_data.isolatedCopy() }
     176    , m_domain { other->m_domain.isolatedCopy() }
     177    , m_filePath { other->m_filePath.isolatedCopy() }
     178    , m_isUnique { other->m_isUnique }
     179    , m_universalAccess { other->m_universalAccess }
     180    , m_domainWasSetInDOM { other->m_domainWasSetInDOM }
     181    , m_canLoadLocalResources { other->m_canLoadLocalResources }
     182    , m_storageBlockingPolicy { other->m_storageBlockingPolicy }
     183    , m_enforcesFilePathSeparation { other->m_enforcesFilePathSeparation }
     184    , m_needsStorageAccessFromFileURLsQuirk { other->m_needsStorageAccessFromFileURLsQuirk }
     185    , m_isPotentiallyTrustworthy { other->m_isPotentiallyTrustworthy }
     186    , m_isLocal { other->m_isLocal }
    187187{
    188188}
     
    219219Ref<SecurityOrigin> SecurityOrigin::isolatedCopy() const
    220220{
    221     return adoptRef(*new SecurityOrigin(*this));
     221    return adoptRef(*new SecurityOrigin(this));
    222222}
    223223
  • trunk/Source/WebCore/page/SecurityOrigin.h

    r251861 r251887  
    222222    SecurityOrigin();
    223223    explicit SecurityOrigin(const URL&);
    224     explicit SecurityOrigin(const SecurityOrigin&);
     224    explicit SecurityOrigin(const SecurityOrigin*);
    225225
    226226    // FIXME: Rename this function to something more semantic.
  • trunk/Source/WebCore/page/SecurityOriginData.h

    r251861 r251887  
    9898void SecurityOriginData::encode(Encoder& encoder) const
    9999{
    100     ASSERT(!isEmpty());
    101100    encoder << protocol;
    102101    encoder << host;
  • trunk/Source/WebCore/page/csp/ContentSecurityPolicy.cpp

    r251861 r251887  
    509509}
    510510
    511 bool ContentSecurityPolicy::allowFrameAncestors(const Vector<SecurityOriginData>& ancestorOrigins, const URL& url, bool overrideContentSecurityPolicy) const
     511bool ContentSecurityPolicy::allowFrameAncestors(const Vector<RefPtr<SecurityOrigin>>& ancestorOrigins, const URL& url, bool overrideContentSecurityPolicy) const
    512512{
    513513    if (overrideContentSecurityPolicy)
  • trunk/Source/WebCore/page/csp/ContentSecurityPolicy.h

    r251861 r251887  
    100100
    101101    bool allowFrameAncestors(const Frame&, const URL&, bool overrideContentSecurityPolicy = false) const;
    102     WEBCORE_EXPORT bool allowFrameAncestors(const Vector<SecurityOriginData>& ancestorOrigins, const URL&, bool overrideContentSecurityPolicy = false) const;
     102    WEBCORE_EXPORT bool allowFrameAncestors(const Vector<RefPtr<SecurityOrigin>>& ancestorOrigins, const URL&, bool overrideContentSecurityPolicy = false) const;
    103103    WEBCORE_EXPORT bool overridesXFrameOptions() const;
    104104
  • trunk/Source/WebCore/page/csp/ContentSecurityPolicyDirectiveList.cpp

    r251861 r251887  
    8080}
    8181
    82 static inline URL urlFromOrigin(const SecurityOriginData& origin)
    83 {
    84     return { URL { }, origin.toString() };
    85 }
    86 
    8782static inline bool checkFrameAncestors(ContentSecurityPolicySourceListDirective* directive, const Frame& frame)
    8883{
     
    9893}
    9994
    100 static inline bool checkFrameAncestors(ContentSecurityPolicySourceListDirective* directive, const Vector<SecurityOriginData>& ancestorOrigins)
     95static inline bool checkFrameAncestors(ContentSecurityPolicySourceListDirective* directive, const Vector<RefPtr<SecurityOrigin>>& ancestorOrigins)
    10196{
    10297    if (!directive)
     
    10499    bool didReceiveRedirectResponse = false;
    105100    for (auto& origin : ancestorOrigins) {
    106         URL originURL = urlFromOrigin(origin);
     101        URL originURL = urlFromOrigin(*origin);
    107102        if (!originURL.isValid() || !directive->allows(originURL, didReceiveRedirectResponse, ContentSecurityPolicySourceListDirective::ShouldAllowEmptyURLIfSourceListIsNotNone::No))
    108103            return false;
     
    264259}
    265260
    266 const ContentSecurityPolicyDirective* ContentSecurityPolicyDirectiveList::violatedDirectiveForFrameAncestorOrigins(const Vector<SecurityOriginData>& ancestorOrigins) const
     261const ContentSecurityPolicyDirective* ContentSecurityPolicyDirectiveList::violatedDirectiveForFrameAncestorOrigins(const Vector<RefPtr<SecurityOrigin>>& ancestorOrigins) const
    267262{
    268263    if (checkFrameAncestors(m_frameAncestors.get(), ancestorOrigins))
  • trunk/Source/WebCore/page/csp/ContentSecurityPolicyDirectiveList.h

    r251861 r251887  
    6363    const ContentSecurityPolicyDirective* violatedDirectiveForFrame(const URL&, bool didReceiveRedirectResponse) const;
    6464    const ContentSecurityPolicyDirective* violatedDirectiveForFrameAncestor(const Frame&) const;
    65     const ContentSecurityPolicyDirective* violatedDirectiveForFrameAncestorOrigins(const Vector<SecurityOriginData>&) const;
     65    const ContentSecurityPolicyDirective* violatedDirectiveForFrameAncestorOrigins(const Vector<RefPtr<SecurityOrigin>>&) const;
    6666    const ContentSecurityPolicyDirective* violatedDirectiveForImage(const URL&, bool didReceiveRedirectResponse) const;
    6767#if ENABLE(APPLICATION_MANIFEST)
  • trunk/Source/WebKit/ChangeLog

    r251868 r251887  
     12019-10-31  Russell Epstein  <repstein@apple.com>
     2
     3        Unreviewed, rolling out r251861.
     4
     5        Caused 50+ Layout Test Crashes
     6
     7        Reverted changeset:
     8
     9        "Use SecurityOriginData in NetworkProcess where possible
     10        without other changes"
     11        https://bugs.webkit.org/show_bug.cgi?id=203615
     12        https://trac.webkit.org/changeset/251861
     13
    1142019-10-31  Truitt Savell  <tsavell@apple.com>
    215
  • trunk/Source/WebKit/NetworkProcess/NetworkResourceLoadParameters.cpp

    r251861 r251887  
    9393        encoder << *sourceOrigin;
    9494    encoder << static_cast<bool>(topOrigin);
    95     if (topOrigin)
     95    if (sourceOrigin)
    9696        encoder << *topOrigin;
    9797    encoder << options;
  • trunk/Source/WebKit/NetworkProcess/NetworkResourceLoadParameters.h

    r251861 r251887  
    5959    WebCore::PreflightPolicy preflightPolicy { WebCore::PreflightPolicy::Consider };
    6060    bool shouldEnableCrossOriginResourcePolicy { false };
    61     Vector<WebCore::SecurityOriginData> frameAncestorOrigins;
     61    Vector<RefPtr<WebCore::SecurityOrigin>> frameAncestorOrigins;
    6262    bool isHTTPSUpgradeEnabled { false };
    6363
  • trunk/Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp

    r251861 r251887  
    411411    case XFrameOptionsSameOrigin: {
    412412        auto origin = SecurityOrigin::create(url);
     413        auto topFrameOrigin = m_parameters.frameAncestorOrigins.last();
     414        if (!origin->isSameSchemeHostPort(*topFrameOrigin))
     415            return true;
    413416        for (auto& ancestorOrigin : m_parameters.frameAncestorOrigins) {
    414             if (!origin->isSameSchemeHostPort(ancestorOrigin.securityOrigin()))
     417            if (!origin->isSameSchemeHostPort(*ancestorOrigin))
    415418                return true;
    416419        }
  • trunk/Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp

    r251861 r251887  
    337337
    338338    if (resourceLoader.options().mode == FetchOptions::Mode::Navigate) {
    339         Vector<SecurityOriginData> frameAncestorOrigins;
     339        Vector<RefPtr<SecurityOrigin>> frameAncestorOrigins;
    340340        for (auto* frame = resourceLoader.frame()->tree().parent(); frame; frame = frame->tree().parent())
    341             frameAncestorOrigins.append(frame->document()->securityOrigin().data());
     341            frameAncestorOrigins.append(makeRefPtr(frame->document()->securityOrigin()));
    342342        loadParameters.frameAncestorOrigins = WTFMove(frameAncestorOrigins);
    343343    }
Note: See TracChangeset for help on using the changeset viewer.