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 for (auto& cert : data->m_certificate) |
| 179 m_securityDetails.certificate.append(AtomicString(cert)); |
173 m_securityDetails.sctList = data->m_securityDetails.sctList; | 180 m_securityDetails.sctList = data->m_securityDetails.sctList; |
174 m_httpVersion = data->m_httpVersion; | 181 m_httpVersion = data->m_httpVersion; |
175 m_appCacheID = data->m_appCacheID; | 182 m_appCacheID = data->m_appCacheID; |
176 m_appCacheManifestURL = data->m_appCacheManifestURL.copy(); | 183 m_appCacheManifestURL = data->m_appCacheManifestURL.copy(); |
177 m_multipartBoundary = data->m_multipartBoundary; | 184 m_multipartBoundary = data->m_multipartBoundary; |
178 m_wasFetchedViaSPDY = data->m_wasFetchedViaSPDY; | 185 m_wasFetchedViaSPDY = data->m_wasFetchedViaSPDY; |
179 m_wasNpnNegotiated = data->m_wasNpnNegotiated; | 186 m_wasNpnNegotiated = data->m_wasNpnNegotiated; |
180 m_wasAlternateProtocolAvailable = data->m_wasAlternateProtocolAvailable; | 187 m_wasAlternateProtocolAvailable = data->m_wasAlternateProtocolAvailable; |
181 m_wasFetchedViaProxy = data->m_wasFetchedViaProxy; | 188 m_wasFetchedViaProxy = data->m_wasFetchedViaProxy; |
182 m_wasFetchedViaServiceWorker = data->m_wasFetchedViaServiceWorker; | 189 m_wasFetchedViaServiceWorker = data->m_wasFetchedViaServiceWorker; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 data->m_lastModifiedDate = lastModifiedDate(); | 221 data->m_lastModifiedDate = lastModifiedDate(); |
215 if (m_resourceLoadTiming) | 222 if (m_resourceLoadTiming) |
216 data->m_resourceLoadTiming = m_resourceLoadTiming->deepCopy(); | 223 data->m_resourceLoadTiming = m_resourceLoadTiming->deepCopy(); |
217 data->m_securityInfo = CString(m_securityInfo.data(), m_securityInfo.length(
)); | 224 data->m_securityInfo = CString(m_securityInfo.data(), m_securityInfo.length(
)); |
218 data->m_hasMajorCertificateErrors = m_hasMajorCertificateErrors; | 225 data->m_hasMajorCertificateErrors = m_hasMajorCertificateErrors; |
219 data->m_securityStyle = m_securityStyle; | 226 data->m_securityStyle = m_securityStyle; |
220 data->m_securityDetails.protocol = m_securityDetails.protocol.isolatedCopy()
; | 227 data->m_securityDetails.protocol = m_securityDetails.protocol.isolatedCopy()
; |
221 data->m_securityDetails.cipher = m_securityDetails.cipher.isolatedCopy(); | 228 data->m_securityDetails.cipher = m_securityDetails.cipher.isolatedCopy(); |
222 data->m_securityDetails.keyExchange = m_securityDetails.keyExchange.isolated
Copy(); | 229 data->m_securityDetails.keyExchange = m_securityDetails.keyExchange.isolated
Copy(); |
223 data->m_securityDetails.mac = m_securityDetails.mac.isolatedCopy(); | 230 data->m_securityDetails.mac = m_securityDetails.mac.isolatedCopy(); |
224 data->m_securityDetails.certID = m_securityDetails.certID; | 231 data->m_securityDetails.subjectName = m_securityDetails.subjectName.isolated
Copy(); |
| 232 data->m_securityDetails.sanList = isolatedCopy(m_securityDetails.sanList); |
| 233 data->m_securityDetails.issuer = m_securityDetails.issuer.isolatedCopy(); |
| 234 data->m_securityDetails.validFrom = m_securityDetails.validFrom; |
| 235 data->m_securityDetails.validTo = m_securityDetails.validTo; |
| 236 for (auto& cert : m_securityDetails.certificate) |
| 237 data->m_certificate.append(cert.getString().isolatedCopy()); |
225 data->m_securityDetails.sctList = isolatedCopy(m_securityDetails.sctList); | 238 data->m_securityDetails.sctList = isolatedCopy(m_securityDetails.sctList); |
226 data->m_httpVersion = m_httpVersion; | 239 data->m_httpVersion = m_httpVersion; |
227 data->m_appCacheID = m_appCacheID; | 240 data->m_appCacheID = m_appCacheID; |
228 data->m_appCacheManifestURL = m_appCacheManifestURL.copy(); | 241 data->m_appCacheManifestURL = m_appCacheManifestURL.copy(); |
229 data->m_multipartBoundary = m_multipartBoundary; | 242 data->m_multipartBoundary = m_multipartBoundary; |
230 data->m_wasFetchedViaSPDY = m_wasFetchedViaSPDY; | 243 data->m_wasFetchedViaSPDY = m_wasFetchedViaSPDY; |
231 data->m_wasNpnNegotiated = m_wasNpnNegotiated; | 244 data->m_wasNpnNegotiated = m_wasNpnNegotiated; |
232 data->m_wasAlternateProtocolAvailable = m_wasAlternateProtocolAvailable; | 245 data->m_wasAlternateProtocolAvailable = m_wasAlternateProtocolAvailable; |
233 data->m_wasFetchedViaProxy = m_wasFetchedViaProxy; | 246 data->m_wasFetchedViaProxy = m_wasFetchedViaProxy; |
234 data->m_wasFetchedViaServiceWorker = m_wasFetchedViaServiceWorker; | 247 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())) | 383 else if (equalIgnoringCase(name, cacheControlHeaderString()) || equalIgnorin
gCase(name, pragmaHeaderString())) |
371 m_cacheControlHeader = CacheControlHeader(); | 384 m_cacheControlHeader = CacheControlHeader(); |
372 else if (equalIgnoringCase(name, dateHeader)) | 385 else if (equalIgnoringCase(name, dateHeader)) |
373 m_haveParsedDateHeader = false; | 386 m_haveParsedDateHeader = false; |
374 else if (equalIgnoringCase(name, expiresHeader)) | 387 else if (equalIgnoringCase(name, expiresHeader)) |
375 m_haveParsedExpiresHeader = false; | 388 m_haveParsedExpiresHeader = false; |
376 else if (equalIgnoringCase(name, lastModifiedHeader)) | 389 else if (equalIgnoringCase(name, lastModifiedHeader)) |
377 m_haveParsedLastModifiedHeader = false; | 390 m_haveParsedLastModifiedHeader = false; |
378 } | 391 } |
379 | 392 |
380 void ResourceResponse::setSecurityDetails(const String& protocol, const String&
keyExchange, const String& cipher, const String& mac, int certId, const SignedCe
rtificateTimestampList& sctList) | 393 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 Vector<AtomicString>& certificate, const SignedCertificateTimestam
pList& sctList) |
381 { | 394 { |
382 m_securityDetails.protocol = protocol; | 395 m_securityDetails.protocol = protocol; |
383 m_securityDetails.keyExchange = keyExchange; | 396 m_securityDetails.keyExchange = keyExchange; |
384 m_securityDetails.cipher = cipher; | 397 m_securityDetails.cipher = cipher; |
385 m_securityDetails.mac = mac; | 398 m_securityDetails.mac = mac; |
386 m_securityDetails.certID = certId; | 399 m_securityDetails.subjectName = subjectName; |
| 400 m_securityDetails.sanList = sanList; |
| 401 m_securityDetails.issuer = issuer; |
| 402 m_securityDetails.validFrom = validFrom; |
| 403 m_securityDetails.validTo = validTo; |
| 404 m_securityDetails.certificate = certificate; |
387 m_securityDetails.sctList = sctList; | 405 m_securityDetails.sctList = sctList; |
388 } | 406 } |
389 | 407 |
390 void ResourceResponse::setHTTPHeaderField(const AtomicString& name, const Atomic
String& value) | 408 void ResourceResponse::setHTTPHeaderField(const AtomicString& name, const Atomic
String& value) |
391 { | 409 { |
392 updateHeaderParsedState(name); | 410 updateHeaderParsedState(name); |
393 | 411 |
394 m_httpHeaderFields.set(name, value); | 412 m_httpHeaderFields.set(name, value); |
395 } | 413 } |
396 | 414 |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
634 if (a.resourceLoadTiming() != b.resourceLoadTiming()) | 652 if (a.resourceLoadTiming() != b.resourceLoadTiming()) |
635 return false; | 653 return false; |
636 if (a.encodedBodyLength() != b.encodedBodyLength()) | 654 if (a.encodedBodyLength() != b.encodedBodyLength()) |
637 return false; | 655 return false; |
638 if (a.decodedBodyLength() != b.decodedBodyLength()) | 656 if (a.decodedBodyLength() != b.decodedBodyLength()) |
639 return false; | 657 return false; |
640 return true; | 658 return true; |
641 } | 659 } |
642 | 660 |
643 } // namespace blink | 661 } // namespace blink |
OLD | NEW |