<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[207753] trunk/Source/WebCore</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/207753">207753</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2016-10-24 00:52:09 -0700 (Mon, 24 Oct 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Remove CachedResource::passesSameOriginPolicyCheck
https://bugs.webkit.org/show_bug.cgi?id=163593

Patch by Youenn Fablet &lt;youenn@apple.com&gt; 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):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreloadercacheCachedResourcecpp">trunk/Source/WebCore/loader/cache/CachedResource.cpp</a></li>
<li><a href="#trunkSourceWebCoreloadercacheCachedResourceh">trunk/Source/WebCore/loader/cache/CachedResource.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (207752 => 207753)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-10-24 07:49:14 UTC (rev 207752)
+++ trunk/Source/WebCore/ChangeLog        2016-10-24 07:52:09 UTC (rev 207753)
</span><span class="lines">@@ -1,5 +1,24 @@
</span><span class="cx"> 2016-10-24  Youenn Fablet  &lt;youenn@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Remove CachedResource::passesSameOriginPolicyCheck
+        https://bugs.webkit.org/show_bug.cgi?id=163593
+
+        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):
+
+2016-10-24  Youenn Fablet  &lt;youenn@apple.com&gt;
+
</ins><span class="cx">         Redirections should be upgraded if CSP policy says so
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=163544
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheCachedResourcecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/CachedResource.cpp (207752 => 207753)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedResource.cpp        2016-10-24 07:49:14 UTC (rev 207752)
+++ trunk/Source/WebCore/loader/cache/CachedResource.cpp        2016-10-24 07:52:09 UTC (rev 207753)
</span><span class="lines">@@ -410,19 +410,6 @@
</span><span class="cx">         m_status = Cached;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool CachedResource::passesAccessControlCheck(SecurityOrigin&amp; securityOrigin)
-{
-    String errorDescription;
-    return WebCore::passesAccessControlCheck(response(), resourceRequest().allowCookies() ? AllowStoredCredentials : DoNotAllowStoredCredentials, securityOrigin, errorDescription);
-}
-
-bool CachedResource::passesSameOriginPolicyCheck(SecurityOrigin&amp; securityOrigin)
-{
-    if (securityOrigin.canRequest(responseForSameOriginPolicyChecks().url()))
-        return true;
-    return passesAccessControlCheck(securityOrigin);
-}
-
</del><span class="cx"> void CachedResource::setCrossOrigin()
</span><span class="cx"> {
</span><span class="cx">     ASSERT(m_options.mode != FetchOptions::Mode::SameOrigin);
</span><span class="lines">@@ -484,24 +471,15 @@
</span><span class="cx">     return computeFreshnessLifetimeForHTTPFamily(response, m_responseTimestamp);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CachedResource::redirectReceived(ResourceRequest&amp; request, const ResourceResponse&amp; response)
</del><ins>+void CachedResource::redirectReceived(ResourceRequest&amp;, const ResourceResponse&amp; response)
</ins><span class="cx"> {
</span><span class="cx">     m_requestedFromNetworkingLayer = true;
</span><span class="cx">     if (response.isNull())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    // Redirect to data: URL uses the last HTTP response for SOP.
-    if (response.isHTTP() &amp;&amp; request.url().protocolIsData())
-        m_redirectResponseForSameOriginPolicyChecks = response;
-
</del><span class="cx">     updateRedirectChainStatus(m_redirectChainCacheStatus, response);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-const ResourceResponse&amp; CachedResource::responseForSameOriginPolicyChecks() const
-{
-    return m_redirectResponseForSameOriginPolicyChecks.isNull() ? m_response : m_redirectResponseForSameOriginPolicyChecks;
-}
-
</del><span class="cx"> void CachedResource::setResponse(const ResourceResponse&amp; response)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(m_response.type() == ResourceResponse::Type::Default);
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheCachedResourceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/CachedResource.h (207752 => 207753)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedResource.h        2016-10-24 07:49:14 UTC (rev 207752)
+++ trunk/Source/WebCore/loader/cache/CachedResource.h        2016-10-24 07:52:09 UTC (rev 207753)
</span><span class="lines">@@ -20,8 +20,7 @@
</span><span class="cx">     Boston, MA 02110-1301, USA.
</span><span class="cx"> */
</span><span class="cx"> 
</span><del>-#ifndef CachedResource_h
-#define CachedResource_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #include &quot;CachePolicy.h&quot;
</span><span class="cx"> #include &quot;CacheValidation.h&quot;
</span><span class="lines">@@ -42,12 +41,12 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-class MemoryCache;
</del><span class="cx"> class CachedResourceClient;
</span><span class="cx"> class CachedResourceHandleBase;
</span><span class="cx"> class CachedResourceLoader;
</span><span class="cx"> class CachedResourceRequest;
</span><span class="cx"> class InspectorResource;
</span><ins>+class MemoryCache;
</ins><span class="cx"> class SecurityOrigin;
</span><span class="cx"> class SharedBuffer;
</span><span class="cx"> class SubresourceLoader;
</span><span class="lines">@@ -60,7 +59,7 @@
</span><span class="cx">     WTF_MAKE_NONCOPYABLE(CachedResource); WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx">     friend class MemoryCache;
</span><span class="cx">     friend class InspectorResource;
</span><del>-    
</del><ins>+
</ins><span class="cx"> public:
</span><span class="cx">     enum Type {
</span><span class="cx">         MainResource,
</span><span class="lines">@@ -152,7 +151,7 @@
</span><span class="cx">     unsigned encodedSize() const { return m_encodedSize; }
</span><span class="cx">     unsigned decodedSize() const { return m_decodedSize; }
</span><span class="cx">     unsigned overheadSize() const;
</span><del>-    
</del><ins>+
</ins><span class="cx">     bool isLoaded() const { return !m_loading; } // FIXME. Method name is inaccurate. Loading might not have started yet.
</span><span class="cx"> 
</span><span class="cx">     bool isLoading() const { return m_loading; }
</span><span class="lines">@@ -180,13 +179,10 @@
</span><span class="cx">     unsigned accessCount() const { return m_accessCount; }
</span><span class="cx">     void increaseAccessCount() { m_accessCount++; }
</span><span class="cx"> 
</span><del>-    // Computes the status of an object after loading.  
</del><ins>+    // Computes the status of an object after loading.
</ins><span class="cx">     // Updates the expire date on the cache entry file
</span><span class="cx">     void finish();
</span><span class="cx"> 
</span><del>-    bool passesAccessControlCheck(SecurityOrigin&amp;);
-    bool passesSameOriginPolicyCheck(SecurityOrigin&amp;);
-
</del><span class="cx">     // Called by the cache if the object has been removed from the cache
</span><span class="cx">     // while still being referenced. This means the object should delete itself
</span><span class="cx">     // if the number of clients observing it ever drops to 0.
</span><span class="lines">@@ -193,7 +189,7 @@
</span><span class="cx">     // The resource can be brought back to cache after successful revalidation.
</span><span class="cx">     void setInCache(bool inCache) { m_inCache = inCache; }
</span><span class="cx">     bool inCache() const { return m_inCache; }
</span><del>-    
</del><ins>+
</ins><span class="cx">     void clearLoader();
</span><span class="cx"> 
</span><span class="cx">     SharedBuffer* resourceBuffer() const { return m_data.get(); }
</span><span class="lines">@@ -203,8 +199,6 @@
</span><span class="cx">     virtual bool shouldCacheResponse(const ResourceResponse&amp;) { return true; }
</span><span class="cx">     void setResponse(const ResourceResponse&amp;);
</span><span class="cx">     const ResourceResponse&amp; response() const { return m_response; }
</span><del>-    // This is the same as response() except after HTTP redirect to data: URL.
-    const ResourceResponse&amp; responseForSameOriginPolicyChecks() const;
</del><span class="cx"> 
</span><span class="cx">     void setCrossOrigin();
</span><span class="cx">     bool isCrossOrigin() const;
</span><span class="lines">@@ -295,7 +289,6 @@
</span><span class="cx">     ResourceLoaderOptions m_options;
</span><span class="cx">     ResourceResponse m_response;
</span><span class="cx">     ResourceResponse::Tainting m_responseTainting { ResourceResponse::Tainting::Basic };
</span><del>-    ResourceResponse m_redirectResponseForSameOriginPolicyChecks;
</del><span class="cx">     RefPtr&lt;SharedBuffer&gt; m_data;
</span><span class="cx">     DeferrableOneShotTimer m_decodedDataDeletionTimer;
</span><span class="cx"> 
</span><span class="lines">@@ -352,7 +345,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     CachedResourceLoader* m_owningCachedResourceLoader { nullptr }; // only non-null for resources that are not in the cache
</span><del>-    
</del><ins>+
</ins><span class="cx">     // 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
</span><span class="cx">     // using HTTP If-Modified-Since/If-None-Match headers. If the response is 304 all clients of this resource are moved
</span><span class="cx">     // to to be clients of m_resourceToRevalidate and the resource is deleted. If not, the field is zeroed and this
</span><span class="lines">@@ -395,5 +388,3 @@
</span><span class="cx"> SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::ToClassName) \
</span><span class="cx">     static bool isType(const WebCore::CachedResource&amp; resource) { return resource.type() == WebCore::CachedResourceType; } \
</span><span class="cx"> SPECIALIZE_TYPE_TRAITS_END()
</span><del>-
-#endif // CachedResource_h
</del></span></pre>
</div>
</div>

</body>
</html>