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