| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2009 Google Inc. All rights reserved. | 3 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 | 26 |
| 27 #include "platform/network/ResourceResponse.h" | 27 #include "platform/network/ResourceResponse.h" |
| 28 | 28 |
| 29 #include "wtf/CurrentTime.h" | 29 #include "wtf/CurrentTime.h" |
| 30 #include "wtf/PtrUtil.h" | 30 #include "wtf/PtrUtil.h" |
| 31 #include "wtf/StdLibExtras.h" | 31 #include "wtf/StdLibExtras.h" |
| 32 #include <memory> | 32 #include <memory> |
| 33 | 33 |
| 34 namespace blink { | 34 namespace blink { |
| 35 | 35 |
| 36 namespace { |
| 37 |
| 38 Vector<ResourceResponse::SignedCertificateTimestamp> isolatedCopy(const Vector<R
esourceResponse::SignedCertificateTimestamp>& src) |
| 39 { |
| 40 Vector<ResourceResponse::SignedCertificateTimestamp> result; |
| 41 result.reserveCapacity(src.size()); |
| 42 for (const auto& timestamp : src) { |
| 43 result.append(timestamp.isolatedCopy()); |
| 44 } |
| 45 return result; |
| 46 } |
| 47 |
| 48 } // namespace |
| 49 |
| 36 ResourceResponse::SignedCertificateTimestamp::SignedCertificateTimestamp( | 50 ResourceResponse::SignedCertificateTimestamp::SignedCertificateTimestamp( |
| 37 const blink::WebURLResponse::SignedCertificateTimestamp& sct) | 51 const blink::WebURLResponse::SignedCertificateTimestamp& sct) |
| 38 : m_status(sct.status) | 52 : m_status(sct.status) |
| 39 , m_origin(sct.origin) | 53 , m_origin(sct.origin) |
| 40 , m_logDescription(sct.logDescription) | 54 , m_logDescription(sct.logDescription) |
| 41 , m_logId(sct.logId) | 55 , m_logId(sct.logId) |
| 42 , m_timestamp(sct.timestamp) | 56 , m_timestamp(sct.timestamp) |
| 43 , m_hashAlgorithm(sct.hashAlgorithm) | 57 , m_hashAlgorithm(sct.hashAlgorithm) |
| 44 , m_signatureAlgorithm(sct.signatureAlgorithm) | 58 , m_signatureAlgorithm(sct.signatureAlgorithm) |
| 45 , m_signatureData(sct.signatureData) | 59 , m_signatureData(sct.signatureData) |
| 46 { | 60 { |
| 47 } | 61 } |
| 48 | 62 |
| 63 ResourceResponse::SignedCertificateTimestamp ResourceResponse::SignedCertificate
Timestamp::isolatedCopy() const |
| 64 { |
| 65 return SignedCertificateTimestamp( |
| 66 m_status.isolatedCopy(), |
| 67 m_origin.isolatedCopy(), |
| 68 m_logDescription.isolatedCopy(), |
| 69 m_logId.isolatedCopy(), |
| 70 m_timestamp, |
| 71 m_hashAlgorithm.isolatedCopy(), |
| 72 m_signatureAlgorithm.isolatedCopy(), |
| 73 m_signatureData.isolatedCopy()); |
| 74 } |
| 75 |
| 49 ResourceResponse::ResourceResponse() | 76 ResourceResponse::ResourceResponse() |
| 50 : m_expectedContentLength(0) | 77 : m_expectedContentLength(0) |
| 51 , m_httpStatusCode(0) | 78 , m_httpStatusCode(0) |
| 52 , m_lastModifiedDate(0) | 79 , m_lastModifiedDate(0) |
| 53 , m_wasCached(false) | 80 , m_wasCached(false) |
| 54 , m_connectionID(0) | 81 , m_connectionID(0) |
| 55 , m_connectionReused(false) | 82 , m_connectionReused(false) |
| 56 , m_isNull(true) | 83 , m_isNull(true) |
| 57 , m_haveParsedAgeHeader(false) | 84 , m_haveParsedAgeHeader(false) |
| 58 , m_haveParsedDateHeader(false) | 85 , m_haveParsedDateHeader(false) |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 data->m_hasMajorCertificateErrors = m_hasMajorCertificateErrors; | 209 data->m_hasMajorCertificateErrors = m_hasMajorCertificateErrors; |
| 183 data->m_securityStyle = m_securityStyle; | 210 data->m_securityStyle = m_securityStyle; |
| 184 data->m_securityDetails.protocol = m_securityDetails.protocol.isolatedCopy()
; | 211 data->m_securityDetails.protocol = m_securityDetails.protocol.isolatedCopy()
; |
| 185 data->m_securityDetails.cipher = m_securityDetails.cipher.isolatedCopy(); | 212 data->m_securityDetails.cipher = m_securityDetails.cipher.isolatedCopy(); |
| 186 data->m_securityDetails.keyExchange = m_securityDetails.keyExchange.isolated
Copy(); | 213 data->m_securityDetails.keyExchange = m_securityDetails.keyExchange.isolated
Copy(); |
| 187 data->m_securityDetails.mac = m_securityDetails.mac.isolatedCopy(); | 214 data->m_securityDetails.mac = m_securityDetails.mac.isolatedCopy(); |
| 188 data->m_securityDetails.certID = m_securityDetails.certID; | 215 data->m_securityDetails.certID = m_securityDetails.certID; |
| 189 data->m_securityDetails.numUnknownSCTs = m_securityDetails.numUnknownSCTs; | 216 data->m_securityDetails.numUnknownSCTs = m_securityDetails.numUnknownSCTs; |
| 190 data->m_securityDetails.numInvalidSCTs = m_securityDetails.numInvalidSCTs; | 217 data->m_securityDetails.numInvalidSCTs = m_securityDetails.numInvalidSCTs; |
| 191 data->m_securityDetails.numValidSCTs = m_securityDetails.numValidSCTs; | 218 data->m_securityDetails.numValidSCTs = m_securityDetails.numValidSCTs; |
| 192 data->m_securityDetails.sctList = m_securityDetails.sctList; | 219 data->m_securityDetails.sctList = isolatedCopy(m_securityDetails.sctList); |
| 193 data->m_httpVersion = m_httpVersion; | 220 data->m_httpVersion = m_httpVersion; |
| 194 data->m_appCacheID = m_appCacheID; | 221 data->m_appCacheID = m_appCacheID; |
| 195 data->m_appCacheManifestURL = m_appCacheManifestURL.copy(); | 222 data->m_appCacheManifestURL = m_appCacheManifestURL.copy(); |
| 196 data->m_multipartBoundary = m_multipartBoundary; | 223 data->m_multipartBoundary = m_multipartBoundary; |
| 197 data->m_wasFetchedViaSPDY = m_wasFetchedViaSPDY; | 224 data->m_wasFetchedViaSPDY = m_wasFetchedViaSPDY; |
| 198 data->m_wasNpnNegotiated = m_wasNpnNegotiated; | 225 data->m_wasNpnNegotiated = m_wasNpnNegotiated; |
| 199 data->m_wasAlternateProtocolAvailable = m_wasAlternateProtocolAvailable; | 226 data->m_wasAlternateProtocolAvailable = m_wasAlternateProtocolAvailable; |
| 200 data->m_wasFetchedViaProxy = m_wasFetchedViaProxy; | 227 data->m_wasFetchedViaProxy = m_wasFetchedViaProxy; |
| 201 data->m_wasFetchedViaServiceWorker = m_wasFetchedViaServiceWorker; | 228 data->m_wasFetchedViaServiceWorker = m_wasFetchedViaServiceWorker; |
| 202 data->m_wasFallbackRequiredByServiceWorker = m_wasFallbackRequiredByServiceW
orker; | 229 data->m_wasFallbackRequiredByServiceWorker = m_wasFallbackRequiredByServiceW
orker; |
| (...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 587 if (a.httpHeaderFields() != b.httpHeaderFields()) | 614 if (a.httpHeaderFields() != b.httpHeaderFields()) |
| 588 return false; | 615 return false; |
| 589 if (a.resourceLoadTiming() && b.resourceLoadTiming() && *a.resourceLoadTimin
g() == *b.resourceLoadTiming()) | 616 if (a.resourceLoadTiming() && b.resourceLoadTiming() && *a.resourceLoadTimin
g() == *b.resourceLoadTiming()) |
| 590 return true; | 617 return true; |
| 591 if (a.resourceLoadTiming() != b.resourceLoadTiming()) | 618 if (a.resourceLoadTiming() != b.resourceLoadTiming()) |
| 592 return false; | 619 return false; |
| 593 return true; | 620 return true; |
| 594 } | 621 } |
| 595 | 622 |
| 596 } // namespace blink | 623 } // namespace blink |
| OLD | NEW |