Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Unified Diff: third_party/WebKit/Source/platform/network/ResourceResponse.cpp

Issue 2135143002: Implement SignedCertificateTimestamp::isolatedCopy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/network/ResourceResponse.cpp
diff --git a/third_party/WebKit/Source/platform/network/ResourceResponse.cpp b/third_party/WebKit/Source/platform/network/ResourceResponse.cpp
index d1a85c9ad9916f056f8f7d425d27d13f3060fd51..bc533abce9612d2bd2d496d7ac4209559112a632 100644
--- a/third_party/WebKit/Source/platform/network/ResourceResponse.cpp
+++ b/third_party/WebKit/Source/platform/network/ResourceResponse.cpp
@@ -33,6 +33,20 @@
namespace blink {
+namespace {
+
+Vector<ResourceResponse::SignedCertificateTimestamp> isolatedCopy(const Vector<ResourceResponse::SignedCertificateTimestamp>& src)
+{
+ Vector<ResourceResponse::SignedCertificateTimestamp> result;
+ result.reserveCapacity(src.size());
+ for (const auto& timestamp : src) {
+ result.append(timestamp.isolatedCopy());
+ }
+ return result;
+}
+
+} // namespace
+
ResourceResponse::SignedCertificateTimestamp::SignedCertificateTimestamp(
const blink::WebURLResponse::SignedCertificateTimestamp& sct)
: m_status(sct.status)
@@ -46,6 +60,19 @@ ResourceResponse::SignedCertificateTimestamp::SignedCertificateTimestamp(
{
}
+ResourceResponse::SignedCertificateTimestamp ResourceResponse::SignedCertificateTimestamp::isolatedCopy() const
+{
+ return SignedCertificateTimestamp(
+ m_status.isolatedCopy(),
+ m_origin.isolatedCopy(),
+ m_logDescription.isolatedCopy(),
+ m_logId.isolatedCopy(),
+ m_timestamp,
+ m_hashAlgorithm.isolatedCopy(),
+ m_signatureAlgorithm.isolatedCopy(),
+ m_signatureData.isolatedCopy());
+}
+
ResourceResponse::ResourceResponse()
: m_expectedContentLength(0)
, m_httpStatusCode(0)
@@ -189,7 +216,7 @@ std::unique_ptr<CrossThreadResourceResponseData> ResourceResponse::copyData() co
data->m_securityDetails.numUnknownSCTs = m_securityDetails.numUnknownSCTs;
data->m_securityDetails.numInvalidSCTs = m_securityDetails.numInvalidSCTs;
data->m_securityDetails.numValidSCTs = m_securityDetails.numValidSCTs;
- data->m_securityDetails.sctList = m_securityDetails.sctList;
+ data->m_securityDetails.sctList = isolatedCopy(m_securityDetails.sctList);
data->m_httpVersion = m_httpVersion;
data->m_appCacheID = m_appCacheID;
data->m_appCacheManifestURL = m_appCacheManifestURL.copy();

Powered by Google App Engine
This is Rietveld 408576698