Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(117)

Side by Side Diff: third_party/WebKit/Source/platform/network/ResourceResponse.h

Issue 1772603002: Addition of Certificate Transparency details to Security panel of DevTools (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removed version, renamed Blink variables, simplified some comments, handled a few MAX values Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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>
dgozman 2016/06/04 00:27:37 Are we allowed to use vector in platform/ ? Could
estark 2016/06/08 16:51:55 Daniel, this should probably be wtf/Vector.h, simi
dwaxweiler 2016/06/08 19:31:10 Acknowledged.
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 {
dgozman 2016/06/04 00:27:37 I'm surprised why we don't reuse public/platform v
dwaxweiler 2016/06/08 19:31:10 I don't know whether a reuse is permitted.
67 public:
68 SignedCertificateTimestamp(
69 String status,
70 String origin,
71 String logDescription,
72 String logId,
73 int64_t timestamp,
74 String hashAlgorithm,
75 String signatureAlgorithm,
76 String signatureData)
77 : m_status(status)
78 , m_origin(origin)
79 , m_logDescription(logDescription)
80 , m_logId(logId)
81 , m_timestamp(timestamp)
82 , m_hashAlgorithm(hashAlgorithm)
83 , m_signatureAlgorithm(signatureAlgorithm)
84 , m_signatureData(signatureData)
85 {
86 }
87 SignedCertificateTimestamp(
dgozman 2016/06/04 00:27:37 explicit?
dwaxweiler 2016/06/08 19:31:10 Acknowledged.
88 const struct blink::WebURLResponse::SignedCertificateTimestamp&);
89 String m_status;
90 String m_origin;
91 String m_logDescription;
92 String m_logId;
93 int64_t m_timestamp;
94 String m_hashAlgorithm;
95 String m_signatureAlgorithm;
96 String m_signatureData;
97 };
98
99 using SignedCertificateTimestampList = std::vector<SignedCertificateTimestam p>;
100
63 struct SecurityDetails { 101 struct SecurityDetails {
64 DISALLOW_NEW(); 102 DISALLOW_NEW();
65 SecurityDetails() 103 SecurityDetails()
66 : certID(0) 104 : certID(0)
67 , numUnknownSCTs(0) 105 , numUnknownSCTs(0)
68 , numInvalidSCTs(0) 106 , numInvalidSCTs(0)
69 , numValidSCTs(0) 107 , numValidSCTs(0)
70 { 108 {
71 } 109 }
72 // All strings are human-readable values. 110 // All strings are human-readable values.
73 String protocol; 111 String protocol;
74 String keyExchange; 112 String keyExchange;
75 String cipher; 113 String cipher;
76 // mac is the empty string when the connection cipher suite does not 114 // 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). 115 // have a separate MAC value (i.e. if the cipher suite is AEAD).
78 String mac; 116 String mac;
79 int certID; 117 int certID;
80 size_t numUnknownSCTs; 118 size_t numUnknownSCTs;
81 size_t numInvalidSCTs; 119 size_t numInvalidSCTs;
82 size_t numValidSCTs; 120 size_t numValidSCTs;
121 SignedCertificateTimestampList sctList;
83 }; 122 };
84 123
85 class ExtraData : public RefCounted<ExtraData> { 124 class ExtraData : public RefCounted<ExtraData> {
86 public: 125 public:
87 virtual ~ExtraData() { } 126 virtual ~ExtraData() { }
88 }; 127 };
89 128
90 explicit ResourceResponse(CrossThreadResourceResponseData*); 129 explicit ResourceResponse(CrossThreadResourceResponseData*);
91 130
92 // Gets a copy of the data suitable for passing to another thread. 131 // Gets a copy of the data suitable for passing to another thread.
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 const CString& getSecurityInfo() const { return m_securityInfo; } 209 const CString& getSecurityInfo() const { return m_securityInfo; }
171 void setSecurityInfo(const CString& securityInfo) { m_securityInfo = securit yInfo; } 210 void setSecurityInfo(const CString& securityInfo) { m_securityInfo = securit yInfo; }
172 211
173 bool hasMajorCertificateErrors() const { return m_hasMajorCertificateErrors; } 212 bool hasMajorCertificateErrors() const { return m_hasMajorCertificateErrors; }
174 void setHasMajorCertificateErrors(bool hasMajorCertificateErrors) { m_hasMaj orCertificateErrors = hasMajorCertificateErrors; } 213 void setHasMajorCertificateErrors(bool hasMajorCertificateErrors) { m_hasMaj orCertificateErrors = hasMajorCertificateErrors; }
175 214
176 SecurityStyle getSecurityStyle() const { return m_securityStyle; } 215 SecurityStyle getSecurityStyle() const { return m_securityStyle; }
177 void setSecurityStyle(SecurityStyle securityStyle) { m_securityStyle = secur ityStyle; } 216 void setSecurityStyle(SecurityStyle securityStyle) { m_securityStyle = secur ityStyle; }
178 217
179 const SecurityDetails* getSecurityDetails() const { return &m_securityDetail s; } 218 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); 219 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 220
182 long long appCacheID() const { return m_appCacheID; } 221 long long appCacheID() const { return m_appCacheID; }
183 void setAppCacheID(long long id) { m_appCacheID = id; } 222 void setAppCacheID(long long id) { m_appCacheID = id; }
184 223
185 const KURL& appCacheManifestURL() const { return m_appCacheManifestURL; } 224 const KURL& appCacheManifestURL() const { return m_appCacheManifestURL; }
186 void setAppCacheManifestURL(const KURL& url) { m_appCacheManifestURL = url; } 225 void setAppCacheManifestURL(const KURL& url) { m_appCacheManifestURL = url; }
187 226
188 bool wasFetchedViaSPDY() const { return m_wasFetchedViaSPDY; } 227 bool wasFetchedViaSPDY() const { return m_wasFetchedViaSPDY; }
189 void setWasFetchedViaSPDY(bool value) { m_wasFetchedViaSPDY = value; } 228 void setWasFetchedViaSPDY(bool value) { m_wasFetchedViaSPDY = value; }
190 229
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 int64_t m_responseTime; 453 int64_t m_responseTime;
415 String m_remoteIPAddress; 454 String m_remoteIPAddress;
416 unsigned short m_remotePort; 455 unsigned short m_remotePort;
417 String m_downloadedFilePath; 456 String m_downloadedFilePath;
418 RefPtr<BlobDataHandle> m_downloadedFileHandle; 457 RefPtr<BlobDataHandle> m_downloadedFileHandle;
419 }; 458 };
420 459
421 } // namespace blink 460 } // namespace blink
422 461
423 #endif // ResourceResponse_h 462 #endif // ResourceResponse_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698