[Cache API] Ensure ResourceResponse is not null when redirected/tainting/type fields...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 Aug 2017 22:38:24 +0000 (22:38 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 Aug 2017 22:38:24 +0000 (22:38 +0000)
https://bugs.webkit.org/show_bug.cgi?id=175538

Patch by Youenn Fablet <youenn@apple.com> 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):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220764 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/network/ResourceResponseBase.cpp
Source/WebCore/platform/network/ResourceResponseBase.h

index e4c1872440124b29c5e58f7ab660a3b1b39c7fcf..9fae8c6e219de8fafb57d05df7dd240ecdab54f3 100644 (file)
@@ -1,3 +1,19 @@
+2017-08-15  Youenn Fablet  <youenn@apple.com>
+
+        [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  <cdumez@apple.com>
 
         Update CachedResourceLoader::requestResource() to return a WTF::Expected
 2017-08-15  Chris Dumez  <cdumez@apple.com>
 
         Update CachedResourceLoader::requestResource() to return a WTF::Expected
index 8d88d38b7acbb4128ec5f78cf07e3da631eda50f..bad7e8e3e46df1780b3e54527b2a58bb81dbf16c 100644 (file)
@@ -232,6 +232,12 @@ void ResourceResponseBase::setTextEncodingName(const String& encodingName)
     // FIXME: Should invalidate or update platform response if present.
 }
 
     // 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)
 void ResourceResponseBase::includeCertificateInfo() const
 {
     if (m_certificateInfo)
index c3d9eca9930b466d1f8105dfe8a65516b2790902..abcdcead779cacdb74f2ff2fb6dbacbdb49eea3f 100644 (file)
@@ -153,10 +153,11 @@ public:
         return 1280;
     }
 
         return 1280;
     }
 
+    void setType(Type);
     Type type() const { return m_type; }
     Type type() const { return m_type; }
-    void setType(Type type) { m_type = type; }
-    bool isRedirected() const { return m_isRedirected; }
+
     void setRedirected(bool isRedirected) { m_isRedirected = isRedirected; }
     void setRedirected(bool isRedirected) { m_isRedirected = isRedirected; }
+    bool isRedirected() const { return m_isRedirected; }
 
     void setTainting(Tainting tainting) { m_tainting = tainting; }
     Tainting tainting() const { return m_tainting; }
 
     void setTainting(Tainting tainting) { m_tainting = tainting; }
     Tainting tainting() const { return m_tainting; }