OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2003, 2006 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2003, 2006 Apple Computer, Inc. All rights reserved. |
3 * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> | 3 * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> |
4 * Copyright (C) 2009 Google Inc. All rights reserved. | 4 * Copyright (C) 2009 Google Inc. All rights reserved. |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 13 matching lines...) Expand all Loading... |
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
25 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 */ | 26 */ |
27 | 27 |
28 #ifndef ResourceRequestBase_h | 28 #ifndef ResourceRequestBase_h |
29 #define ResourceRequestBase_h | 29 #define ResourceRequestBase_h |
30 | 30 |
31 #include "FormData.h" | 31 #include "FormData.h" |
32 #include "KURL.h" | 32 #include "KURL.h" |
33 #include "HTTPHeaderMap.h" | 33 #include "HTTPHeaderMap.h" |
| 34 #if ENABLE(APPLICATION_CACHE) |
| 35 #include "ApplicationCacheCommon.h" |
| 36 #endif |
34 | 37 |
35 #include <memory> | 38 #include <memory> |
36 #include <wtf/OwnPtr.h> | 39 #include <wtf/OwnPtr.h> |
37 | 40 |
38 namespace WebCore { | 41 namespace WebCore { |
39 | 42 |
40 enum ResourceRequestCachePolicy { | 43 enum ResourceRequestCachePolicy { |
41 UseProtocolCachePolicy, // normal load | 44 UseProtocolCachePolicy, // normal load |
42 ReloadIgnoringCacheData, // reload | 45 ReloadIgnoringCacheData, // reload |
43 ReturnCacheDataElseLoad, // back/forward or encoding change - allow stal
e data | 46 ReturnCacheDataElseLoad, // back/forward or encoding change - allow stal
e data |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 bool allowHTTPCookies() const; | 111 bool allowHTTPCookies() const; |
109 void setAllowHTTPCookies(bool allowHTTPCookies); | 112 void setAllowHTTPCookies(bool allowHTTPCookies); |
110 | 113 |
111 bool isConditional() const; | 114 bool isConditional() const; |
112 | 115 |
113 // Whether the associated ResourceHandleClient needs to be notified of | 116 // Whether the associated ResourceHandleClient needs to be notified of |
114 // upload progress made for that resource. | 117 // upload progress made for that resource. |
115 bool reportUploadProgress() const { return m_reportUploadProgress; } | 118 bool reportUploadProgress() const { return m_reportUploadProgress; } |
116 void setReportUploadProgress(bool reportUploadProgress) { m_reportUpload
Progress = reportUploadProgress; } | 119 void setReportUploadProgress(bool reportUploadProgress) { m_reportUpload
Progress = reportUploadProgress; } |
117 | 120 |
| 121 #if ENABLE(APPLICATION_CACHE) |
| 122 // Allows the request to be matched up with its cache context. |
| 123 GlobalApplicationCacheContextID applicationCacheContextID() const { retu
rn m_appcacheContextID; } |
| 124 void setApplicationCacheContextID(GlobalApplicationCacheContextID id) {
m_appcacheContextID = id; } |
| 125 #endif |
| 126 |
118 protected: | 127 protected: |
119 // Used when ResourceRequest is initialized from a platform representati
on of the request | 128 // Used when ResourceRequest is initialized from a platform representati
on of the request |
120 ResourceRequestBase() | 129 ResourceRequestBase() |
121 : m_resourceRequestUpdated(false) | 130 : m_resourceRequestUpdated(false) |
122 , m_platformRequestUpdated(true) | 131 , m_platformRequestUpdated(true) |
123 , m_reportUploadProgress(false) | 132 , m_reportUploadProgress(false) |
124 { | 133 { |
125 } | 134 } |
126 | 135 |
127 ResourceRequestBase(const KURL& url, ResourceRequestCachePolicy policy) | 136 ResourceRequestBase(const KURL& url, ResourceRequestCachePolicy policy) |
(...skipping 17 matching lines...) Expand all Loading... |
145 double m_timeoutInterval; | 154 double m_timeoutInterval; |
146 KURL m_firstPartyForCookies; | 155 KURL m_firstPartyForCookies; |
147 String m_httpMethod; | 156 String m_httpMethod; |
148 HTTPHeaderMap m_httpHeaderFields; | 157 HTTPHeaderMap m_httpHeaderFields; |
149 Vector<String> m_responseContentDispositionEncodingFallbackArray; | 158 Vector<String> m_responseContentDispositionEncodingFallbackArray; |
150 RefPtr<FormData> m_httpBody; | 159 RefPtr<FormData> m_httpBody; |
151 bool m_allowHTTPCookies; | 160 bool m_allowHTTPCookies; |
152 mutable bool m_resourceRequestUpdated; | 161 mutable bool m_resourceRequestUpdated; |
153 mutable bool m_platformRequestUpdated; | 162 mutable bool m_platformRequestUpdated; |
154 bool m_reportUploadProgress; | 163 bool m_reportUploadProgress; |
155 | 164 #if ENABLE(APPLICATION_CACHE) |
| 165 GlobalApplicationCacheContextID m_appcacheContextID; |
| 166 #endif |
156 private: | 167 private: |
157 const ResourceRequest& asResourceRequest() const; | 168 const ResourceRequest& asResourceRequest() const; |
158 }; | 169 }; |
159 | 170 |
160 bool equalIgnoringHeaderFields(const ResourceRequestBase&, const ResourceReq
uestBase&); | 171 bool equalIgnoringHeaderFields(const ResourceRequestBase&, const ResourceReq
uestBase&); |
161 | 172 |
162 bool operator==(const ResourceRequestBase&, const ResourceRequestBase&); | 173 bool operator==(const ResourceRequestBase&, const ResourceRequestBase&); |
163 inline bool operator!=(ResourceRequestBase& a, const ResourceRequestBase& b)
{ return !(a == b); } | 174 inline bool operator!=(ResourceRequestBase& a, const ResourceRequestBase& b)
{ return !(a == b); } |
164 | 175 |
165 struct CrossThreadResourceRequestData { | 176 struct CrossThreadResourceRequestData { |
166 KURL m_url; | 177 KURL m_url; |
167 | 178 |
168 ResourceRequestCachePolicy m_cachePolicy; | 179 ResourceRequestCachePolicy m_cachePolicy; |
169 double m_timeoutInterval; | 180 double m_timeoutInterval; |
170 KURL m_firstPartyForCookies; | 181 KURL m_firstPartyForCookies; |
171 | 182 |
172 String m_httpMethod; | 183 String m_httpMethod; |
173 OwnPtr<CrossThreadHTTPHeaderMapData> m_httpHeaders; | 184 OwnPtr<CrossThreadHTTPHeaderMapData> m_httpHeaders; |
174 Vector<String> m_responseContentDispositionEncodingFallbackArray; | 185 Vector<String> m_responseContentDispositionEncodingFallbackArray; |
175 RefPtr<FormData> m_httpBody; | 186 RefPtr<FormData> m_httpBody; |
176 bool m_allowHTTPCookies; | 187 bool m_allowHTTPCookies; |
| 188 #if ENABLE(APPLICATION_CACHE) |
| 189 GlobalApplicationCacheContextID m_appcacheContextID; |
| 190 #endif |
177 }; | 191 }; |
178 | 192 |
179 unsigned initializeMaximumHTTPConnectionCountPerHost(); | 193 unsigned initializeMaximumHTTPConnectionCountPerHost(); |
180 | 194 |
181 } // namespace WebCore | 195 } // namespace WebCore |
182 | 196 |
183 #endif // ResourceRequestBase_h | 197 #endif // ResourceRequestBase_h |
OLD | NEW |