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