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 16 matching lines...) Expand all Loading... |
27 #ifndef ResourceResponse_h | 27 #ifndef ResourceResponse_h |
28 #define ResourceResponse_h | 28 #define ResourceResponse_h |
29 | 29 |
30 #include "platform/PlatformExport.h" | 30 #include "platform/PlatformExport.h" |
31 #include "platform/blob/BlobData.h" | 31 #include "platform/blob/BlobData.h" |
32 #include "platform/network/HTTPHeaderMap.h" | 32 #include "platform/network/HTTPHeaderMap.h" |
33 #include "platform/network/HTTPParsers.h" | 33 #include "platform/network/HTTPParsers.h" |
34 #include "platform/network/ResourceLoadInfo.h" | 34 #include "platform/network/ResourceLoadInfo.h" |
35 #include "platform/network/ResourceLoadTiming.h" | 35 #include "platform/network/ResourceLoadTiming.h" |
36 #include "platform/weborigin/KURL.h" | 36 #include "platform/weborigin/KURL.h" |
| 37 #include "public/platform/WebURLResponse.h" |
37 #include "public/platform/modules/serviceworker/WebServiceWorkerResponseType.h" | 38 #include "public/platform/modules/serviceworker/WebServiceWorkerResponseType.h" |
38 #include "wtf/RefCounted.h" | 39 #include "wtf/RefCounted.h" |
39 #include "wtf/RefPtr.h" | 40 #include "wtf/RefPtr.h" |
| 41 #include "wtf/Vector.h" |
40 #include "wtf/text/CString.h" | 42 #include "wtf/text/CString.h" |
41 #include <memory> | |
42 | 43 |
43 namespace blink { | 44 namespace blink { |
44 | 45 |
45 struct CrossThreadResourceResponseData; | 46 struct CrossThreadResourceResponseData; |
46 | 47 |
47 class PLATFORM_EXPORT ResourceResponse final { | 48 class PLATFORM_EXPORT ResourceResponse final { |
48 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); | 49 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); |
49 public: | 50 public: |
50 enum HTTPVersion { HTTPVersionUnknown, | 51 enum HTTPVersion { HTTPVersionUnknown, |
51 HTTPVersion_0_9, | 52 HTTPVersion_0_9, |
52 HTTPVersion_1_0, | 53 HTTPVersion_1_0, |
53 HTTPVersion_1_1, | 54 HTTPVersion_1_1, |
54 HTTPVersion_2_0 }; | 55 HTTPVersion_2_0 }; |
55 enum SecurityStyle { | 56 enum SecurityStyle { |
56 SecurityStyleUnknown, | 57 SecurityStyleUnknown, |
57 SecurityStyleUnauthenticated, | 58 SecurityStyleUnauthenticated, |
58 SecurityStyleAuthenticationBroken, | 59 SecurityStyleAuthenticationBroken, |
59 SecurityStyleWarning, | 60 SecurityStyleWarning, |
60 SecurityStyleAuthenticated | 61 SecurityStyleAuthenticated |
61 }; | 62 }; |
62 | 63 |
| 64 class SignedCertificateTimestamp { |
| 65 public: |
| 66 SignedCertificateTimestamp( |
| 67 String status, |
| 68 String origin, |
| 69 String logDescription, |
| 70 String logId, |
| 71 int64_t timestamp, |
| 72 String hashAlgorithm, |
| 73 String signatureAlgorithm, |
| 74 String signatureData) |
| 75 : m_status(status) |
| 76 , m_origin(origin) |
| 77 , m_logDescription(logDescription) |
| 78 , m_logId(logId) |
| 79 , m_timestamp(timestamp) |
| 80 , m_hashAlgorithm(hashAlgorithm) |
| 81 , m_signatureAlgorithm(signatureAlgorithm) |
| 82 , m_signatureData(signatureData) |
| 83 { |
| 84 } |
| 85 explicit SignedCertificateTimestamp( |
| 86 const struct blink::WebURLResponse::SignedCertificateTimestamp&); |
| 87 String m_status; |
| 88 String m_origin; |
| 89 String m_logDescription; |
| 90 String m_logId; |
| 91 int64_t m_timestamp; |
| 92 String m_hashAlgorithm; |
| 93 String m_signatureAlgorithm; |
| 94 String m_signatureData; |
| 95 }; |
| 96 |
| 97 using SignedCertificateTimestampList = WTF::Vector<SignedCertificateTimestam
p>; |
| 98 |
63 struct SecurityDetails { | 99 struct SecurityDetails { |
64 DISALLOW_NEW(); | 100 DISALLOW_NEW(); |
65 SecurityDetails() | 101 SecurityDetails() |
66 : certID(0) | 102 : certID(0) |
67 , numUnknownSCTs(0) | 103 , numUnknownSCTs(0) |
68 , numInvalidSCTs(0) | 104 , numInvalidSCTs(0) |
69 , numValidSCTs(0) | 105 , numValidSCTs(0) |
70 { | 106 { |
71 } | 107 } |
72 // All strings are human-readable values. | 108 // All strings are human-readable values. |
73 String protocol; | 109 String protocol; |
74 String keyExchange; | 110 String keyExchange; |
75 String cipher; | 111 String cipher; |
76 // mac is the empty string when the connection cipher suite does not | 112 // mac is the empty string when the connection cipher suite does not |
77 // have a separate MAC value (i.e. if the cipher suite is AEAD). | 113 // have a separate MAC value (i.e. if the cipher suite is AEAD). |
78 String mac; | 114 String mac; |
79 int certID; | 115 int certID; |
80 size_t numUnknownSCTs; | 116 size_t numUnknownSCTs; |
81 size_t numInvalidSCTs; | 117 size_t numInvalidSCTs; |
82 size_t numValidSCTs; | 118 size_t numValidSCTs; |
| 119 SignedCertificateTimestampList sctList; |
83 }; | 120 }; |
84 | 121 |
85 class ExtraData : public RefCounted<ExtraData> { | 122 class ExtraData : public RefCounted<ExtraData> { |
86 public: | 123 public: |
87 virtual ~ExtraData() { } | 124 virtual ~ExtraData() { } |
88 }; | 125 }; |
89 | 126 |
90 explicit ResourceResponse(CrossThreadResourceResponseData*); | 127 explicit ResourceResponse(CrossThreadResourceResponseData*); |
91 | 128 |
92 // Gets a copy of the data suitable for passing to another thread. | 129 // Gets a copy of the data suitable for passing to another thread. |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 const CString& getSecurityInfo() const { return m_securityInfo; } | 207 const CString& getSecurityInfo() const { return m_securityInfo; } |
171 void setSecurityInfo(const CString& securityInfo) { m_securityInfo = securit
yInfo; } | 208 void setSecurityInfo(const CString& securityInfo) { m_securityInfo = securit
yInfo; } |
172 | 209 |
173 bool hasMajorCertificateErrors() const { return m_hasMajorCertificateErrors;
} | 210 bool hasMajorCertificateErrors() const { return m_hasMajorCertificateErrors;
} |
174 void setHasMajorCertificateErrors(bool hasMajorCertificateErrors) { m_hasMaj
orCertificateErrors = hasMajorCertificateErrors; } | 211 void setHasMajorCertificateErrors(bool hasMajorCertificateErrors) { m_hasMaj
orCertificateErrors = hasMajorCertificateErrors; } |
175 | 212 |
176 SecurityStyle getSecurityStyle() const { return m_securityStyle; } | 213 SecurityStyle getSecurityStyle() const { return m_securityStyle; } |
177 void setSecurityStyle(SecurityStyle securityStyle) { m_securityStyle = secur
ityStyle; } | 214 void setSecurityStyle(SecurityStyle securityStyle) { m_securityStyle = secur
ityStyle; } |
178 | 215 |
179 const SecurityDetails* getSecurityDetails() const { return &m_securityDetail
s; } | 216 const SecurityDetails* getSecurityDetails() const { return &m_securityDetail
s; } |
180 void setSecurityDetails(const String& protocol, const String& keyExchange, c
onst String& cipher, const String& mac, int certId, size_t numUnknownScts, size_
t numInvalidScts, size_t numValidScts); | 217 void setSecurityDetails(const String& protocol, const String& keyExchange, c
onst String& cipher, const String& mac, int certId, size_t numUnknownScts, size_
t numInvalidScts, size_t numValidScts, const SignedCertificateTimestampList& sct
List); |
181 | 218 |
182 long long appCacheID() const { return m_appCacheID; } | 219 long long appCacheID() const { return m_appCacheID; } |
183 void setAppCacheID(long long id) { m_appCacheID = id; } | 220 void setAppCacheID(long long id) { m_appCacheID = id; } |
184 | 221 |
185 const KURL& appCacheManifestURL() const { return m_appCacheManifestURL; } | 222 const KURL& appCacheManifestURL() const { return m_appCacheManifestURL; } |
186 void setAppCacheManifestURL(const KURL& url) { m_appCacheManifestURL = url;
} | 223 void setAppCacheManifestURL(const KURL& url) { m_appCacheManifestURL = url;
} |
187 | 224 |
188 bool wasFetchedViaSPDY() const { return m_wasFetchedViaSPDY; } | 225 bool wasFetchedViaSPDY() const { return m_wasFetchedViaSPDY; } |
189 void setWasFetchedViaSPDY(bool value) { m_wasFetchedViaSPDY = value; } | 226 void setWasFetchedViaSPDY(bool value) { m_wasFetchedViaSPDY = value; } |
190 | 227 |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 int64_t m_responseTime; | 451 int64_t m_responseTime; |
415 String m_remoteIPAddress; | 452 String m_remoteIPAddress; |
416 unsigned short m_remotePort; | 453 unsigned short m_remotePort; |
417 String m_downloadedFilePath; | 454 String m_downloadedFilePath; |
418 RefPtr<BlobDataHandle> m_downloadedFileHandle; | 455 RefPtr<BlobDataHandle> m_downloadedFileHandle; |
419 }; | 456 }; |
420 | 457 |
421 } // namespace blink | 458 } // namespace blink |
422 | 459 |
423 #endif // ResourceResponse_h | 460 #endif // ResourceResponse_h |
OLD | NEW |