Changeset 207753 in webkit


Ignore:
Timestamp:
Oct 24, 2016 12:52:09 AM (7 years ago)
Author:
commit-queue@webkit.org
Message:

Remove CachedResource::passesSameOriginPolicyCheck
https://bugs.webkit.org/show_bug.cgi?id=163593

Patch by Youenn Fablet <youenn@apple.com> on 2016-10-24
Reviewed by Andreas Kling.

No change of behavior.

Removing no-longer used code.

  • loader/cache/CachedResource.cpp:

(WebCore::CachedResource::redirectReceived):
(WebCore::CachedResource::passesAccessControlCheck): Deleted.
(WebCore::CachedResource::passesSameOriginPolicyCheck): Deleted.
(WebCore::CachedResource::responseForSameOriginPolicyChecks): Deleted.

  • loader/cache/CachedResource.h:

(WebCore::CachedResource::response):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r207752 r207753  
     12016-10-24  Youenn Fablet  <youenn@apple.com>
     2
     3        Remove CachedResource::passesSameOriginPolicyCheck
     4        https://bugs.webkit.org/show_bug.cgi?id=163593
     5
     6        Reviewed by Andreas Kling.
     7
     8        No change of behavior.
     9
     10        Removing no-longer used code.
     11
     12        * loader/cache/CachedResource.cpp:
     13        (WebCore::CachedResource::redirectReceived):
     14        (WebCore::CachedResource::passesAccessControlCheck): Deleted.
     15        (WebCore::CachedResource::passesSameOriginPolicyCheck): Deleted.
     16        (WebCore::CachedResource::responseForSameOriginPolicyChecks): Deleted.
     17        * loader/cache/CachedResource.h:
     18        (WebCore::CachedResource::response):
     19
    1202016-10-24  Youenn Fablet  <youenn@apple.com>
    221
  • trunk/Source/WebCore/loader/cache/CachedResource.cpp

    r207459 r207753  
    411411}
    412412
    413 bool CachedResource::passesAccessControlCheck(SecurityOrigin& securityOrigin)
    414 {
    415     String errorDescription;
    416     return WebCore::passesAccessControlCheck(response(), resourceRequest().allowCookies() ? AllowStoredCredentials : DoNotAllowStoredCredentials, securityOrigin, errorDescription);
    417 }
    418 
    419 bool CachedResource::passesSameOriginPolicyCheck(SecurityOrigin& securityOrigin)
    420 {
    421     if (securityOrigin.canRequest(responseForSameOriginPolicyChecks().url()))
    422         return true;
    423     return passesAccessControlCheck(securityOrigin);
    424 }
    425 
    426413void CachedResource::setCrossOrigin()
    427414{
     
    485472}
    486473
    487 void CachedResource::redirectReceived(ResourceRequest& request, const ResourceResponse& response)
     474void CachedResource::redirectReceived(ResourceRequest&, const ResourceResponse& response)
    488475{
    489476    m_requestedFromNetworkingLayer = true;
     
    491478        return;
    492479
    493     // Redirect to data: URL uses the last HTTP response for SOP.
    494     if (response.isHTTP() && request.url().protocolIsData())
    495         m_redirectResponseForSameOriginPolicyChecks = response;
    496 
    497480    updateRedirectChainStatus(m_redirectChainCacheStatus, response);
    498 }
    499 
    500 const ResourceResponse& CachedResource::responseForSameOriginPolicyChecks() const
    501 {
    502     return m_redirectResponseForSameOriginPolicyChecks.isNull() ? m_response : m_redirectResponseForSameOriginPolicyChecks;
    503481}
    504482
  • trunk/Source/WebCore/loader/cache/CachedResource.h

    r207459 r207753  
    2121*/
    2222
    23 #ifndef CachedResource_h
    24 #define CachedResource_h
     23#pragma once
    2524
    2625#include "CachePolicy.h"
     
    4342namespace WebCore {
    4443
    45 class MemoryCache;
    4644class CachedResourceClient;
    4745class CachedResourceHandleBase;
     
    4947class CachedResourceRequest;
    5048class InspectorResource;
     49class MemoryCache;
    5150class SecurityOrigin;
    5251class SharedBuffer;
     
    6160    friend class MemoryCache;
    6261    friend class InspectorResource;
    63    
     62
    6463public:
    6564    enum Type {
     
    153152    unsigned decodedSize() const { return m_decodedSize; }
    154153    unsigned overheadSize() const;
    155    
     154
    156155    bool isLoaded() const { return !m_loading; } // FIXME. Method name is inaccurate. Loading might not have started yet.
    157156
     
    181180    void increaseAccessCount() { m_accessCount++; }
    182181
    183     // Computes the status of an object after loading. 
     182    // Computes the status of an object after loading.
    184183    // Updates the expire date on the cache entry file
    185184    void finish();
    186 
    187     bool passesAccessControlCheck(SecurityOrigin&);
    188     bool passesSameOriginPolicyCheck(SecurityOrigin&);
    189185
    190186    // Called by the cache if the object has been removed from the cache
     
    194190    void setInCache(bool inCache) { m_inCache = inCache; }
    195191    bool inCache() const { return m_inCache; }
    196    
     192
    197193    void clearLoader();
    198194
     
    204200    void setResponse(const ResourceResponse&);
    205201    const ResourceResponse& response() const { return m_response; }
    206     // This is the same as response() except after HTTP redirect to data: URL.
    207     const ResourceResponse& responseForSameOriginPolicyChecks() const;
    208202
    209203    void setCrossOrigin();
     
    296290    ResourceResponse m_response;
    297291    ResourceResponse::Tainting m_responseTainting { ResourceResponse::Tainting::Basic };
    298     ResourceResponse m_redirectResponseForSameOriginPolicyChecks;
    299292    RefPtr<SharedBuffer> m_data;
    300293    DeferrableOneShotTimer m_decodedDataDeletionTimer;
     
    353346
    354347    CachedResourceLoader* m_owningCachedResourceLoader { nullptr }; // only non-null for resources that are not in the cache
    355    
     348
    356349    // If this field is non-null we are using the resource as a proxy for checking whether an existing resource is still up to date
    357350    // using HTTP If-Modified-Since/If-None-Match headers. If the response is 304 all clients of this resource are moved
     
    396389    static bool isType(const WebCore::CachedResource& resource) { return resource.type() == WebCore::CachedResourceType; } \
    397390SPECIALIZE_TYPE_TRAITS_END()
    398 
    399 #endif // CachedResource_h
Note: See TracChangeset for help on using the changeset viewer.