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 12 matching lines...) Expand all Loading... |
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
25 */ | 25 */ |
26 | 26 |
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/ResourceLoadInfo.h" | 34 #include "platform/network/ResourceLoadInfo.h" |
34 #include "platform/network/ResourceLoadTiming.h" | 35 #include "platform/network/ResourceLoadTiming.h" |
35 #include "platform/weborigin/KURL.h" | 36 #include "platform/weborigin/KURL.h" |
36 #include "wtf/PassOwnPtr.h" | 37 #include "wtf/PassOwnPtr.h" |
37 #include "wtf/RefPtr.h" | 38 #include "wtf/RefPtr.h" |
38 #include "wtf/text/CString.h" | 39 #include "wtf/text/CString.h" |
39 | 40 |
40 namespace WebCore { | 41 namespace WebCore { |
41 | 42 |
42 struct CrossThreadResourceResponseData; | 43 struct CrossThreadResourceResponseData; |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 | 97 |
97 bool isAttachment() const; | 98 bool isAttachment() const; |
98 | 99 |
99 // FIXME: These are used by PluginStream on some platforms. Calculations may
differ from just returning plain Last-Modified header. | 100 // FIXME: These are used by PluginStream on some platforms. Calculations may
differ from just returning plain Last-Modified header. |
100 // Leaving it for now but this should go away in favor of generic solution. | 101 // Leaving it for now but this should go away in favor of generic solution. |
101 void setLastModifiedDate(time_t); | 102 void setLastModifiedDate(time_t); |
102 time_t lastModifiedDate() const; | 103 time_t lastModifiedDate() const; |
103 | 104 |
104 // These functions return parsed values of the corresponding response header
s. | 105 // These functions return parsed values of the corresponding response header
s. |
105 // NaN means that the header was not present or had invalid value. | 106 // NaN means that the header was not present or had invalid value. |
106 bool cacheControlContainsNoCache() const; | 107 bool cacheControlContainsNoCache(); |
107 bool cacheControlContainsNoStore() const; | 108 bool cacheControlContainsNoStore(); |
108 bool cacheControlContainsMustRevalidate() const; | 109 bool cacheControlContainsMustRevalidate(); |
109 bool hasCacheValidatorFields() const; | 110 bool hasCacheValidatorFields() const; |
110 double cacheControlMaxAge() const; | 111 double cacheControlMaxAge(); |
111 double date() const; | 112 double date() const; |
112 double age() const; | 113 double age() const; |
113 double expires() const; | 114 double expires() const; |
114 double lastModified() const; | 115 double lastModified() const; |
115 | 116 |
116 unsigned connectionID() const; | 117 unsigned connectionID() const; |
117 void setConnectionID(unsigned); | 118 void setConnectionID(unsigned); |
118 | 119 |
119 bool connectionReused() const; | 120 bool connectionReused() const; |
120 void setConnectionReused(bool); | 121 void setConnectionReused(bool); |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 // The ResourceResponse subclass may "shadow" this method to provide platfor
m-specific memory usage information | 181 // The ResourceResponse subclass may "shadow" this method to provide platfor
m-specific memory usage information |
181 unsigned memoryUsage() const | 182 unsigned memoryUsage() const |
182 { | 183 { |
183 // average size, mostly due to URL and Header Map strings | 184 // average size, mostly due to URL and Header Map strings |
184 return 1280; | 185 return 1280; |
185 } | 186 } |
186 | 187 |
187 static bool compare(const ResourceResponse&, const ResourceResponse&); | 188 static bool compare(const ResourceResponse&, const ResourceResponse&); |
188 | 189 |
189 private: | 190 private: |
190 void parseCacheControlDirectives() const; | |
191 void updateHeaderParsedState(const AtomicString& name); | 191 void updateHeaderParsedState(const AtomicString& name); |
192 | 192 |
193 KURL m_url; | 193 KURL m_url; |
194 AtomicString m_mimeType; | 194 AtomicString m_mimeType; |
195 long long m_expectedContentLength; | 195 long long m_expectedContentLength; |
196 AtomicString m_textEncodingName; | 196 AtomicString m_textEncodingName; |
197 String m_suggestedFilename; | 197 String m_suggestedFilename; |
198 int m_httpStatusCode; | 198 int m_httpStatusCode; |
199 AtomicString m_httpStatusText; | 199 AtomicString m_httpStatusText; |
200 HTTPHeaderMap m_httpHeaderFields; | 200 HTTPHeaderMap m_httpHeaderFields; |
201 time_t m_lastModifiedDate; | 201 time_t m_lastModifiedDate; |
202 bool m_wasCached : 1; | 202 bool m_wasCached : 1; |
203 unsigned m_connectionID; | 203 unsigned m_connectionID; |
204 bool m_connectionReused : 1; | 204 bool m_connectionReused : 1; |
205 RefPtr<ResourceLoadTiming> m_resourceLoadTiming; | 205 RefPtr<ResourceLoadTiming> m_resourceLoadTiming; |
206 RefPtr<ResourceLoadInfo> m_resourceLoadInfo; | 206 RefPtr<ResourceLoadInfo> m_resourceLoadInfo; |
207 | 207 |
208 bool m_isNull : 1; | 208 bool m_isNull : 1; |
209 | 209 |
210 mutable bool m_haveParsedCacheControlHeader : 1; | 210 CacheControlHeader m_cacheControlHeader; |
| 211 |
211 mutable bool m_haveParsedAgeHeader : 1; | 212 mutable bool m_haveParsedAgeHeader : 1; |
212 mutable bool m_haveParsedDateHeader : 1; | 213 mutable bool m_haveParsedDateHeader : 1; |
213 mutable bool m_haveParsedExpiresHeader : 1; | 214 mutable bool m_haveParsedExpiresHeader : 1; |
214 mutable bool m_haveParsedLastModifiedHeader : 1; | 215 mutable bool m_haveParsedLastModifiedHeader : 1; |
215 | 216 |
216 mutable bool m_cacheControlContainsNoCache : 1; | |
217 mutable bool m_cacheControlContainsNoStore : 1; | |
218 mutable bool m_cacheControlContainsMustRevalidate : 1; | |
219 mutable double m_cacheControlMaxAge; | |
220 | |
221 mutable double m_age; | 217 mutable double m_age; |
222 mutable double m_date; | 218 mutable double m_date; |
223 mutable double m_expires; | 219 mutable double m_expires; |
224 mutable double m_lastModified; | 220 mutable double m_lastModified; |
225 | 221 |
226 // An opaque value that contains some information regarding the security of | 222 // An opaque value that contains some information regarding the security of |
227 // the connection for this request, such as SSL connection info (empty | 223 // the connection for this request, such as SSL connection info (empty |
228 // string if not over HTTPS). | 224 // string if not over HTTPS). |
229 CString m_securityInfo; | 225 CString m_securityInfo; |
230 | 226 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 double m_responseTime; | 301 double m_responseTime; |
306 String m_remoteIPAddress; | 302 String m_remoteIPAddress; |
307 unsigned short m_remotePort; | 303 unsigned short m_remotePort; |
308 String m_downloadedFilePath; | 304 String m_downloadedFilePath; |
309 RefPtr<BlobDataHandle> m_downloadedFileHandle; | 305 RefPtr<BlobDataHandle> m_downloadedFileHandle; |
310 }; | 306 }; |
311 | 307 |
312 } // namespace WebCore | 308 } // namespace WebCore |
313 | 309 |
314 #endif // ResourceResponse_h | 310 #endif // ResourceResponse_h |
OLD | NEW |