Title: [220764] trunk/Source/WebCore
- Revision
- 220764
- Author
- [email protected]
- Date
- 2017-08-15 15:38:24 -0700 (Tue, 15 Aug 2017)
Log Message
[Cache API] Ensure ResourceResponse is not null when redirected/tainting/type fields are set
https://bugs.webkit.org/show_bug.cgi?id=175538
Patch by Youenn Fablet <[email protected]> on 2017-08-15
Reviewed by Chris Dumez.
No change of behavior.
This change ensures that response type is preserved when encoding/decoding ResourceResponse, in particular the error type.
This will allow Cache API to preserve responses when reading them from a different process.
* platform/network/ResourceResponseBase.cpp:
(WebCore::ResourceResponseBase::setType):
* platform/network/ResourceResponseBase.h:
(WebCore::ResourceResponseBase::setType):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (220763 => 220764)
--- trunk/Source/WebCore/ChangeLog 2017-08-15 22:34:48 UTC (rev 220763)
+++ trunk/Source/WebCore/ChangeLog 2017-08-15 22:38:24 UTC (rev 220764)
@@ -1,3 +1,19 @@
+2017-08-15 Youenn Fablet <[email protected]>
+
+ [Cache API] Ensure ResourceResponse is not null when redirected/tainting/type fields are set
+ https://bugs.webkit.org/show_bug.cgi?id=175538
+
+ Reviewed by Chris Dumez.
+
+ No change of behavior.
+ This change ensures that response type is preserved when encoding/decoding ResourceResponse, in particular the error type.
+ This will allow Cache API to preserve responses when reading them from a different process.
+
+ * platform/network/ResourceResponseBase.cpp:
+ (WebCore::ResourceResponseBase::setType):
+ * platform/network/ResourceResponseBase.h:
+ (WebCore::ResourceResponseBase::setType):
+
2017-08-15 Chris Dumez <[email protected]>
Update CachedResourceLoader::requestResource() to return a WTF::Expected
Modified: trunk/Source/WebCore/platform/network/ResourceResponseBase.cpp (220763 => 220764)
--- trunk/Source/WebCore/platform/network/ResourceResponseBase.cpp 2017-08-15 22:34:48 UTC (rev 220763)
+++ trunk/Source/WebCore/platform/network/ResourceResponseBase.cpp 2017-08-15 22:38:24 UTC (rev 220764)
@@ -232,6 +232,12 @@
// FIXME: Should invalidate or update platform response if present.
}
+void ResourceResponseBase::setType(Type type)
+{
+ m_isNull = false;
+ m_type = type;
+}
+
void ResourceResponseBase::includeCertificateInfo() const
{
if (m_certificateInfo)
Modified: trunk/Source/WebCore/platform/network/ResourceResponseBase.h (220763 => 220764)
--- trunk/Source/WebCore/platform/network/ResourceResponseBase.h 2017-08-15 22:34:48 UTC (rev 220763)
+++ trunk/Source/WebCore/platform/network/ResourceResponseBase.h 2017-08-15 22:38:24 UTC (rev 220764)
@@ -153,10 +153,11 @@
return 1280;
}
+ void setType(Type);
Type type() const { return m_type; }
- void setType(Type type) { m_type = type; }
+
+ void setRedirected(bool isRedirected) { m_isRedirected = isRedirected; }
bool isRedirected() const { return m_isRedirected; }
- void setRedirected(bool isRedirected) { m_isRedirected = isRedirected; }
void setTainting(Tainting tainting) { m_tainting = tainting; }
Tainting tainting() const { return m_tainting; }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes