| 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 17 matching lines...) Expand all Loading... |
| 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 { | 36 namespace { |
| 37 | 37 |
| 38 Vector<ResourceResponse::SignedCertificateTimestamp> isolatedCopy(const Vector<R
esourceResponse::SignedCertificateTimestamp>& src) | 38 template <typename Interface> |
| 39 Vector<Interface> isolatedCopy(const Vector<Interface>& src) |
| 39 { | 40 { |
| 40 Vector<ResourceResponse::SignedCertificateTimestamp> result; | 41 Vector<Interface> result; |
| 41 result.reserveCapacity(src.size()); | 42 result.reserveCapacity(src.size()); |
| 42 for (const auto& timestamp : src) { | 43 for (const auto& timestamp : src) { |
| 43 result.append(timestamp.isolatedCopy()); | 44 result.append(timestamp.isolatedCopy()); |
| 44 } | 45 } |
| 45 return result; | 46 return result; |
| 46 } | 47 } |
| 47 | 48 |
| 48 } // namespace | 49 } // namespace |
| 49 | 50 |
| 50 ResourceResponse::SignedCertificateTimestamp::SignedCertificateTimestamp( | 51 ResourceResponse::SignedCertificateTimestamp::SignedCertificateTimestamp( |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 m_httpHeaderFields.adopt(std::move(data->m_httpHeaders)); | 163 m_httpHeaderFields.adopt(std::move(data->m_httpHeaders)); |
| 163 setLastModifiedDate(data->m_lastModifiedDate); | 164 setLastModifiedDate(data->m_lastModifiedDate); |
| 164 setResourceLoadTiming(data->m_resourceLoadTiming.release()); | 165 setResourceLoadTiming(data->m_resourceLoadTiming.release()); |
| 165 m_securityInfo = data->m_securityInfo; | 166 m_securityInfo = data->m_securityInfo; |
| 166 m_hasMajorCertificateErrors = data->m_hasMajorCertificateErrors; | 167 m_hasMajorCertificateErrors = data->m_hasMajorCertificateErrors; |
| 167 m_securityStyle = data->m_securityStyle; | 168 m_securityStyle = data->m_securityStyle; |
| 168 m_securityDetails.protocol = data->m_securityDetails.protocol; | 169 m_securityDetails.protocol = data->m_securityDetails.protocol; |
| 169 m_securityDetails.cipher = data->m_securityDetails.cipher; | 170 m_securityDetails.cipher = data->m_securityDetails.cipher; |
| 170 m_securityDetails.keyExchange = data->m_securityDetails.keyExchange; | 171 m_securityDetails.keyExchange = data->m_securityDetails.keyExchange; |
| 171 m_securityDetails.mac = data->m_securityDetails.mac; | 172 m_securityDetails.mac = data->m_securityDetails.mac; |
| 172 m_securityDetails.certID = data->m_securityDetails.certID; | 173 m_securityDetails.subjectName = data->m_securityDetails.subjectName; |
| 174 m_securityDetails.sanList = data->m_securityDetails.sanList; |
| 175 m_securityDetails.issuer = data->m_securityDetails.issuer; |
| 176 m_securityDetails.validFrom = data->m_securityDetails.validFrom; |
| 177 m_securityDetails.validTo = data->m_securityDetails.validTo; |
| 178 m_securityDetails.certificate = AtomicString(data->m_certificate); |
| 173 m_securityDetails.sctList = data->m_securityDetails.sctList; | 179 m_securityDetails.sctList = data->m_securityDetails.sctList; |
| 174 m_httpVersion = data->m_httpVersion; | 180 m_httpVersion = data->m_httpVersion; |
| 175 m_appCacheID = data->m_appCacheID; | 181 m_appCacheID = data->m_appCacheID; |
| 176 m_appCacheManifestURL = data->m_appCacheManifestURL.copy(); | 182 m_appCacheManifestURL = data->m_appCacheManifestURL.copy(); |
| 177 m_multipartBoundary = data->m_multipartBoundary; | 183 m_multipartBoundary = data->m_multipartBoundary; |
| 178 m_wasFetchedViaSPDY = data->m_wasFetchedViaSPDY; | 184 m_wasFetchedViaSPDY = data->m_wasFetchedViaSPDY; |
| 179 m_wasNpnNegotiated = data->m_wasNpnNegotiated; | 185 m_wasNpnNegotiated = data->m_wasNpnNegotiated; |
| 180 m_wasAlternateProtocolAvailable = data->m_wasAlternateProtocolAvailable; | 186 m_wasAlternateProtocolAvailable = data->m_wasAlternateProtocolAvailable; |
| 181 m_wasFetchedViaProxy = data->m_wasFetchedViaProxy; | 187 m_wasFetchedViaProxy = data->m_wasFetchedViaProxy; |
| 182 m_wasFetchedViaServiceWorker = data->m_wasFetchedViaServiceWorker; | 188 m_wasFetchedViaServiceWorker = data->m_wasFetchedViaServiceWorker; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 data->m_lastModifiedDate = lastModifiedDate(); | 220 data->m_lastModifiedDate = lastModifiedDate(); |
| 215 if (m_resourceLoadTiming) | 221 if (m_resourceLoadTiming) |
| 216 data->m_resourceLoadTiming = m_resourceLoadTiming->deepCopy(); | 222 data->m_resourceLoadTiming = m_resourceLoadTiming->deepCopy(); |
| 217 data->m_securityInfo = CString(m_securityInfo.data(), m_securityInfo.length(
)); | 223 data->m_securityInfo = CString(m_securityInfo.data(), m_securityInfo.length(
)); |
| 218 data->m_hasMajorCertificateErrors = m_hasMajorCertificateErrors; | 224 data->m_hasMajorCertificateErrors = m_hasMajorCertificateErrors; |
| 219 data->m_securityStyle = m_securityStyle; | 225 data->m_securityStyle = m_securityStyle; |
| 220 data->m_securityDetails.protocol = m_securityDetails.protocol.isolatedCopy()
; | 226 data->m_securityDetails.protocol = m_securityDetails.protocol.isolatedCopy()
; |
| 221 data->m_securityDetails.cipher = m_securityDetails.cipher.isolatedCopy(); | 227 data->m_securityDetails.cipher = m_securityDetails.cipher.isolatedCopy(); |
| 222 data->m_securityDetails.keyExchange = m_securityDetails.keyExchange.isolated
Copy(); | 228 data->m_securityDetails.keyExchange = m_securityDetails.keyExchange.isolated
Copy(); |
| 223 data->m_securityDetails.mac = m_securityDetails.mac.isolatedCopy(); | 229 data->m_securityDetails.mac = m_securityDetails.mac.isolatedCopy(); |
| 224 data->m_securityDetails.certID = m_securityDetails.certID; | 230 data->m_securityDetails.subjectName = m_securityDetails.subjectName.isolated
Copy(); |
| 231 data->m_securityDetails.sanList = isolatedCopy(m_securityDetails.sanList); |
| 232 data->m_securityDetails.issuer = m_securityDetails.issuer.isolatedCopy(); |
| 233 data->m_securityDetails.validFrom = m_securityDetails.validFrom; |
| 234 data->m_securityDetails.validTo = m_securityDetails.validTo; |
| 235 data->m_certificate = m_securityDetails.certificate.getString().isolatedCopy
(); |
| 225 data->m_securityDetails.sctList = isolatedCopy(m_securityDetails.sctList); | 236 data->m_securityDetails.sctList = isolatedCopy(m_securityDetails.sctList); |
| 226 data->m_httpVersion = m_httpVersion; | 237 data->m_httpVersion = m_httpVersion; |
| 227 data->m_appCacheID = m_appCacheID; | 238 data->m_appCacheID = m_appCacheID; |
| 228 data->m_appCacheManifestURL = m_appCacheManifestURL.copy(); | 239 data->m_appCacheManifestURL = m_appCacheManifestURL.copy(); |
| 229 data->m_multipartBoundary = m_multipartBoundary; | 240 data->m_multipartBoundary = m_multipartBoundary; |
| 230 data->m_wasFetchedViaSPDY = m_wasFetchedViaSPDY; | 241 data->m_wasFetchedViaSPDY = m_wasFetchedViaSPDY; |
| 231 data->m_wasNpnNegotiated = m_wasNpnNegotiated; | 242 data->m_wasNpnNegotiated = m_wasNpnNegotiated; |
| 232 data->m_wasAlternateProtocolAvailable = m_wasAlternateProtocolAvailable; | 243 data->m_wasAlternateProtocolAvailable = m_wasAlternateProtocolAvailable; |
| 233 data->m_wasFetchedViaProxy = m_wasFetchedViaProxy; | 244 data->m_wasFetchedViaProxy = m_wasFetchedViaProxy; |
| 234 data->m_wasFetchedViaServiceWorker = m_wasFetchedViaServiceWorker; | 245 data->m_wasFetchedViaServiceWorker = m_wasFetchedViaServiceWorker; |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 else if (equalIgnoringCase(name, cacheControlHeaderString()) || equalIgnorin
gCase(name, pragmaHeaderString())) | 381 else if (equalIgnoringCase(name, cacheControlHeaderString()) || equalIgnorin
gCase(name, pragmaHeaderString())) |
| 371 m_cacheControlHeader = CacheControlHeader(); | 382 m_cacheControlHeader = CacheControlHeader(); |
| 372 else if (equalIgnoringCase(name, dateHeader)) | 383 else if (equalIgnoringCase(name, dateHeader)) |
| 373 m_haveParsedDateHeader = false; | 384 m_haveParsedDateHeader = false; |
| 374 else if (equalIgnoringCase(name, expiresHeader)) | 385 else if (equalIgnoringCase(name, expiresHeader)) |
| 375 m_haveParsedExpiresHeader = false; | 386 m_haveParsedExpiresHeader = false; |
| 376 else if (equalIgnoringCase(name, lastModifiedHeader)) | 387 else if (equalIgnoringCase(name, lastModifiedHeader)) |
| 377 m_haveParsedLastModifiedHeader = false; | 388 m_haveParsedLastModifiedHeader = false; |
| 378 } | 389 } |
| 379 | 390 |
| 380 void ResourceResponse::setSecurityDetails(const String& protocol, const String&
keyExchange, const String& cipher, const String& mac, int certId, const SignedCe
rtificateTimestampList& sctList) | 391 void ResourceResponse::setSecurityDetails(const String& protocol, const String&
keyExchange, const String& cipher, const String& mac, const String& subjectName,
const Vector<String>& sanList, const String& issuer, time_t validFrom, time_t v
alidTo, const AtomicString& certificate, const SignedCertificateTimestampList& s
ctList) |
| 381 { | 392 { |
| 382 m_securityDetails.protocol = protocol; | 393 m_securityDetails.protocol = protocol; |
| 383 m_securityDetails.keyExchange = keyExchange; | 394 m_securityDetails.keyExchange = keyExchange; |
| 384 m_securityDetails.cipher = cipher; | 395 m_securityDetails.cipher = cipher; |
| 385 m_securityDetails.mac = mac; | 396 m_securityDetails.mac = mac; |
| 386 m_securityDetails.certID = certId; | 397 m_securityDetails.subjectName = subjectName; |
| 398 m_securityDetails.sanList = sanList; |
| 399 m_securityDetails.issuer = issuer; |
| 400 m_securityDetails.validFrom = validFrom; |
| 401 m_securityDetails.validTo = validTo; |
| 402 m_securityDetails.certificate = certificate; |
| 387 m_securityDetails.sctList = sctList; | 403 m_securityDetails.sctList = sctList; |
| 388 } | 404 } |
| 389 | 405 |
| 390 void ResourceResponse::setHTTPHeaderField(const AtomicString& name, const Atomic
String& value) | 406 void ResourceResponse::setHTTPHeaderField(const AtomicString& name, const Atomic
String& value) |
| 391 { | 407 { |
| 392 updateHeaderParsedState(name); | 408 updateHeaderParsedState(name); |
| 393 | 409 |
| 394 m_httpHeaderFields.set(name, value); | 410 m_httpHeaderFields.set(name, value); |
| 395 } | 411 } |
| 396 | 412 |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 634 if (a.resourceLoadTiming() != b.resourceLoadTiming()) | 650 if (a.resourceLoadTiming() != b.resourceLoadTiming()) |
| 635 return false; | 651 return false; |
| 636 if (a.encodedBodyLength() != b.encodedBodyLength()) | 652 if (a.encodedBodyLength() != b.encodedBodyLength()) |
| 637 return false; | 653 return false; |
| 638 if (a.decodedBodyLength() != b.decodedBodyLength()) | 654 if (a.decodedBodyLength() != b.decodedBodyLength()) |
| 639 return false; | 655 return false; |
| 640 return true; | 656 return true; |
| 641 } | 657 } |
| 642 | 658 |
| 643 } // namespace blink | 659 } // namespace blink |
| OLD | NEW |