Changeset 207753 in webkit
- Timestamp:
- Oct 24, 2016 12:52:09 AM (7 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r207752 r207753 1 2016-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 1 20 2016-10-24 Youenn Fablet <youenn@apple.com> 2 21 -
trunk/Source/WebCore/loader/cache/CachedResource.cpp
r207459 r207753 411 411 } 412 412 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 426 413 void CachedResource::setCrossOrigin() 427 414 { … … 485 472 } 486 473 487 void CachedResource::redirectReceived(ResourceRequest& request, const ResourceResponse& response)474 void CachedResource::redirectReceived(ResourceRequest&, const ResourceResponse& response) 488 475 { 489 476 m_requestedFromNetworkingLayer = true; … … 491 478 return; 492 479 493 // Redirect to data: URL uses the last HTTP response for SOP.494 if (response.isHTTP() && request.url().protocolIsData())495 m_redirectResponseForSameOriginPolicyChecks = response;496 497 480 updateRedirectChainStatus(m_redirectChainCacheStatus, response); 498 }499 500 const ResourceResponse& CachedResource::responseForSameOriginPolicyChecks() const501 {502 return m_redirectResponseForSameOriginPolicyChecks.isNull() ? m_response : m_redirectResponseForSameOriginPolicyChecks;503 481 } 504 482 -
trunk/Source/WebCore/loader/cache/CachedResource.h
r207459 r207753 21 21 */ 22 22 23 #ifndef CachedResource_h 24 #define CachedResource_h 23 #pragma once 25 24 26 25 #include "CachePolicy.h" … … 43 42 namespace WebCore { 44 43 45 class MemoryCache;46 44 class CachedResourceClient; 47 45 class CachedResourceHandleBase; … … 49 47 class CachedResourceRequest; 50 48 class InspectorResource; 49 class MemoryCache; 51 50 class SecurityOrigin; 52 51 class SharedBuffer; … … 61 60 friend class MemoryCache; 62 61 friend class InspectorResource; 63 62 64 63 public: 65 64 enum Type { … … 153 152 unsigned decodedSize() const { return m_decodedSize; } 154 153 unsigned overheadSize() const; 155 154 156 155 bool isLoaded() const { return !m_loading; } // FIXME. Method name is inaccurate. Loading might not have started yet. 157 156 … … 181 180 void increaseAccessCount() { m_accessCount++; } 182 181 183 // Computes the status of an object after loading. 182 // Computes the status of an object after loading. 184 183 // Updates the expire date on the cache entry file 185 184 void finish(); 186 187 bool passesAccessControlCheck(SecurityOrigin&);188 bool passesSameOriginPolicyCheck(SecurityOrigin&);189 185 190 186 // Called by the cache if the object has been removed from the cache … … 194 190 void setInCache(bool inCache) { m_inCache = inCache; } 195 191 bool inCache() const { return m_inCache; } 196 192 197 193 void clearLoader(); 198 194 … … 204 200 void setResponse(const ResourceResponse&); 205 201 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;208 202 209 203 void setCrossOrigin(); … … 296 290 ResourceResponse m_response; 297 291 ResourceResponse::Tainting m_responseTainting { ResourceResponse::Tainting::Basic }; 298 ResourceResponse m_redirectResponseForSameOriginPolicyChecks;299 292 RefPtr<SharedBuffer> m_data; 300 293 DeferrableOneShotTimer m_decodedDataDeletionTimer; … … 353 346 354 347 CachedResourceLoader* m_owningCachedResourceLoader { nullptr }; // only non-null for resources that are not in the cache 355 348 356 349 // 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 357 350 // using HTTP If-Modified-Since/If-None-Match headers. If the response is 304 all clients of this resource are moved … … 396 389 static bool isType(const WebCore::CachedResource& resource) { return resource.type() == WebCore::CachedResourceType; } \ 397 390 SPECIALIZE_TYPE_TRAITS_END() 398 399 #endif // CachedResource_h
Note: See TracChangeset
for help on using the changeset viewer.