| 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, 2012 Google Inc. All rights reserved. | 4 * Copyright (C) 2009, 2012 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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 void setAppCacheHostID(int id) { m_appCacheHostID = id; } | 170 void setAppCacheHostID(int id) { m_appCacheHostID = id; } |
| 171 | 171 |
| 172 // True if request was user initiated. | 172 // True if request was user initiated. |
| 173 bool hasUserGesture() const { return m_hasUserGesture; } | 173 bool hasUserGesture() const { return m_hasUserGesture; } |
| 174 void setHasUserGesture(bool hasUserGesture) { m_hasUserGesture = hasUserGest
ure; } | 174 void setHasUserGesture(bool hasUserGesture) { m_hasUserGesture = hasUserGest
ure; } |
| 175 | 175 |
| 176 // True if request should be downloaded to file. | 176 // True if request should be downloaded to file. |
| 177 bool downloadToFile() const { return m_downloadToFile; } | 177 bool downloadToFile() const { return m_downloadToFile; } |
| 178 void setDownloadToFile(bool downloadToFile) { m_downloadToFile = downloadToF
ile; } | 178 void setDownloadToFile(bool downloadToFile) { m_downloadToFile = downloadToF
ile; } |
| 179 | 179 |
| 180 // True if the request should not be handled by the ServiceWorker. | |
| 181 bool skipServiceWorker() const { return m_skipServiceWorker; } | |
| 182 void setSkipServiceWorker(bool skipServiceWorker) { m_skipServiceWorker = sk
ipServiceWorker; } | |
| 183 | |
| 184 // Extra data associated with this request. | 180 // Extra data associated with this request. |
| 185 ExtraData* extraData() const { return m_extraData.get(); } | 181 ExtraData* extraData() const { return m_extraData.get(); } |
| 186 void setExtraData(PassRefPtr<ExtraData> extraData) { m_extraData = extraData
; } | 182 void setExtraData(PassRefPtr<ExtraData> extraData) { m_extraData = extraData
; } |
| 187 | 183 |
| 188 blink::WebURLRequest::RequestContext requestContext() const { return m_reque
stContext; } | 184 blink::WebURLRequest::RequestContext requestContext() const { return m_reque
stContext; } |
| 189 void setRequestContext(blink::WebURLRequest::RequestContext context) { m_req
uestContext = context; } | 185 void setRequestContext(blink::WebURLRequest::RequestContext context) { m_req
uestContext = context; } |
| 190 | 186 |
| 191 blink::WebURLRequest::FrameType frameType() const { return m_frameType; } | 187 blink::WebURLRequest::FrameType frameType() const { return m_frameType; } |
| 192 void setFrameType(blink::WebURLRequest::FrameType frameType) { m_frameType =
frameType; } | 188 void setFrameType(blink::WebURLRequest::FrameType frameType) { m_frameType =
frameType; } |
| 193 | 189 |
| 190 blink::WebURLRequest::ServiceWorkerRequestMode serviceWorkerRequestMode() co
nst { return m_serviceWorkerRequestMode; } |
| 191 void setServiceWorkerRequestMode(blink::WebURLRequest::ServiceWorkerRequestM
ode mode) { m_serviceWorkerRequestMode = mode; } |
| 192 |
| 194 bool cacheControlContainsNoCache() const; | 193 bool cacheControlContainsNoCache() const; |
| 195 bool cacheControlContainsNoStore() const; | 194 bool cacheControlContainsNoStore() const; |
| 196 bool hasCacheValidatorFields() const; | 195 bool hasCacheValidatorFields() const; |
| 197 | 196 |
| 198 static double defaultTimeoutInterval(); // May return 0 when using platform
default. | 197 static double defaultTimeoutInterval(); // May return 0 when using platform
default. |
| 199 static void setDefaultTimeoutInterval(double); | 198 static void setDefaultTimeoutInterval(double); |
| 200 | 199 |
| 201 static bool compare(const ResourceRequest&, const ResourceRequest&); | 200 static bool compare(const ResourceRequest&, const ResourceRequest&); |
| 202 | 201 |
| 203 private: | 202 private: |
| 204 void initialize(const KURL& url, ResourceRequestCachePolicy cachePolicy); | 203 void initialize(const KURL& url, ResourceRequestCachePolicy cachePolicy); |
| 205 | 204 |
| 206 const CacheControlHeader& cacheControlHeader() const; | 205 const CacheControlHeader& cacheControlHeader() const; |
| 207 | 206 |
| 208 KURL m_url; | 207 KURL m_url; |
| 209 ResourceRequestCachePolicy m_cachePolicy; | 208 ResourceRequestCachePolicy m_cachePolicy; |
| 210 double m_timeoutInterval; // 0 is a magic value for platform default on plat
forms that have one. | 209 double m_timeoutInterval; // 0 is a magic value for platform default on plat
forms that have one. |
| 211 KURL m_firstPartyForCookies; | 210 KURL m_firstPartyForCookies; |
| 212 AtomicString m_httpMethod; | 211 AtomicString m_httpMethod; |
| 213 HTTPHeaderMap m_httpHeaderFields; | 212 HTTPHeaderMap m_httpHeaderFields; |
| 214 RefPtr<FormData> m_httpBody; | 213 RefPtr<FormData> m_httpBody; |
| 215 bool m_allowStoredCredentials : 1; | 214 bool m_allowStoredCredentials : 1; |
| 216 bool m_reportUploadProgress : 1; | 215 bool m_reportUploadProgress : 1; |
| 217 bool m_reportRawHeaders : 1; | 216 bool m_reportRawHeaders : 1; |
| 218 bool m_hasUserGesture : 1; | 217 bool m_hasUserGesture : 1; |
| 219 bool m_downloadToFile : 1; | 218 bool m_downloadToFile : 1; |
| 220 bool m_skipServiceWorker : 1; | |
| 221 ResourceLoadPriority m_priority; | 219 ResourceLoadPriority m_priority; |
| 222 int m_intraPriorityValue; | 220 int m_intraPriorityValue; |
| 223 int m_requestorID; | 221 int m_requestorID; |
| 224 int m_requestorProcessID; | 222 int m_requestorProcessID; |
| 225 int m_appCacheHostID; | 223 int m_appCacheHostID; |
| 226 RefPtr<ExtraData> m_extraData; | 224 RefPtr<ExtraData> m_extraData; |
| 227 blink::WebURLRequest::RequestContext m_requestContext; | 225 blink::WebURLRequest::RequestContext m_requestContext; |
| 228 blink::WebURLRequest::FrameType m_frameType; | 226 blink::WebURLRequest::FrameType m_frameType; |
| 227 blink::WebURLRequest::ServiceWorkerRequestMode m_serviceWorkerRequestMode; |
| 229 ReferrerPolicy m_referrerPolicy; | 228 ReferrerPolicy m_referrerPolicy; |
| 230 | 229 |
| 231 mutable CacheControlHeader m_cacheControlHeaderCache; | 230 mutable CacheControlHeader m_cacheControlHeaderCache; |
| 232 | 231 |
| 233 static double s_defaultTimeoutInterval; | 232 static double s_defaultTimeoutInterval; |
| 234 }; | 233 }; |
| 235 | 234 |
| 236 bool equalIgnoringHeaderFields(const ResourceRequest&, const ResourceRequest&); | 235 bool equalIgnoringHeaderFields(const ResourceRequest&, const ResourceRequest&); |
| 237 | 236 |
| 238 inline bool operator==(const ResourceRequest& a, const ResourceRequest& b) { ret
urn ResourceRequest::compare(a, b); } | 237 inline bool operator==(const ResourceRequest& a, const ResourceRequest& b) { ret
urn ResourceRequest::compare(a, b); } |
| 239 inline bool operator!=(ResourceRequest& a, const ResourceRequest& b) { return !(
a == b); } | 238 inline bool operator!=(ResourceRequest& a, const ResourceRequest& b) { return !(
a == b); } |
| 240 | 239 |
| 241 struct CrossThreadResourceRequestData { | 240 struct CrossThreadResourceRequestData { |
| 242 WTF_MAKE_NONCOPYABLE(CrossThreadResourceRequestData); WTF_MAKE_FAST_ALLOCATE
D; | 241 WTF_MAKE_NONCOPYABLE(CrossThreadResourceRequestData); WTF_MAKE_FAST_ALLOCATE
D; |
| 243 public: | 242 public: |
| 244 CrossThreadResourceRequestData() { } | 243 CrossThreadResourceRequestData() { } |
| 245 KURL m_url; | 244 KURL m_url; |
| 246 | 245 |
| 247 ResourceRequestCachePolicy m_cachePolicy; | 246 ResourceRequestCachePolicy m_cachePolicy; |
| 248 double m_timeoutInterval; | 247 double m_timeoutInterval; |
| 249 KURL m_firstPartyForCookies; | 248 KURL m_firstPartyForCookies; |
| 250 | 249 |
| 251 String m_httpMethod; | 250 String m_httpMethod; |
| 252 OwnPtr<CrossThreadHTTPHeaderMapData> m_httpHeaders; | 251 OwnPtr<CrossThreadHTTPHeaderMapData> m_httpHeaders; |
| 253 RefPtr<FormData> m_httpBody; | 252 RefPtr<FormData> m_httpBody; |
| 254 bool m_allowStoredCredentials; | 253 bool m_allowStoredCredentials; |
| 255 bool m_reportUploadProgress; | 254 bool m_reportUploadProgress; |
| 256 bool m_hasUserGesture; | 255 bool m_hasUserGesture; |
| 257 bool m_downloadToFile; | 256 bool m_downloadToFile; |
| 258 bool m_skipServiceWorker; | |
| 259 ResourceLoadPriority m_priority; | 257 ResourceLoadPriority m_priority; |
| 260 int m_intraPriorityValue; | 258 int m_intraPriorityValue; |
| 261 int m_requestorID; | 259 int m_requestorID; |
| 262 int m_requestorProcessID; | 260 int m_requestorProcessID; |
| 263 int m_appCacheHostID; | 261 int m_appCacheHostID; |
| 264 blink::WebURLRequest::RequestContext m_requestContext; | 262 blink::WebURLRequest::RequestContext m_requestContext; |
| 265 blink::WebURLRequest::FrameType m_frameType; | 263 blink::WebURLRequest::FrameType m_frameType; |
| 264 blink::WebURLRequest::ServiceWorkerRequestMode m_serviceWorkerRequestMode; |
| 266 ReferrerPolicy m_referrerPolicy; | 265 ReferrerPolicy m_referrerPolicy; |
| 267 }; | 266 }; |
| 268 | 267 |
| 269 unsigned initializeMaximumHTTPConnectionCountPerHost(); | 268 unsigned initializeMaximumHTTPConnectionCountPerHost(); |
| 270 | 269 |
| 271 } // namespace blink | 270 } // namespace blink |
| 272 | 271 |
| 273 #endif // ResourceRequest_h | 272 #endif // ResourceRequest_h |
| OLD | NEW |