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 16 matching lines...) Expand all Loading... |
27 | 27 |
28 #ifndef ResourceRequest_h | 28 #ifndef ResourceRequest_h |
29 #define ResourceRequest_h | 29 #define ResourceRequest_h |
30 | 30 |
31 #include "platform/network/FormData.h" | 31 #include "platform/network/FormData.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/ResourceLoadPriority.h" | 34 #include "platform/network/ResourceLoadPriority.h" |
35 #include "platform/weborigin/KURL.h" | 35 #include "platform/weborigin/KURL.h" |
36 #include "platform/weborigin/Referrer.h" | 36 #include "platform/weborigin/Referrer.h" |
| 37 #include "platform/weborigin/SecurityOrigin.h" |
37 #include "public/platform/WebURLRequest.h" | 38 #include "public/platform/WebURLRequest.h" |
38 #include "wtf/OwnPtr.h" | 39 #include "wtf/OwnPtr.h" |
39 | 40 |
40 namespace blink { | 41 namespace blink { |
41 | 42 |
42 enum ResourceRequestCachePolicy { | 43 enum ResourceRequestCachePolicy { |
43 UseProtocolCachePolicy, // normal load | 44 UseProtocolCachePolicy, // normal load |
44 ReloadIgnoringCacheData, // reload | 45 ReloadIgnoringCacheData, // reload |
45 ReturnCacheDataElseLoad, // back/forward or encoding change - allow stale da
ta | 46 ReturnCacheDataElseLoad, // back/forward or encoding change - allow stale da
ta |
46 ReturnCacheDataDontLoad, // results of a post - allow stale data and only us
e cache | 47 ReturnCacheDataDontLoad, // results of a post - allow stale data and only us
e cache |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 | 94 |
94 ResourceRequestCachePolicy cachePolicy() const; | 95 ResourceRequestCachePolicy cachePolicy() const; |
95 void setCachePolicy(ResourceRequestCachePolicy cachePolicy); | 96 void setCachePolicy(ResourceRequestCachePolicy cachePolicy); |
96 | 97 |
97 double timeoutInterval() const; // May return 0 when using platform default. | 98 double timeoutInterval() const; // May return 0 when using platform default. |
98 void setTimeoutInterval(double timeoutInterval); | 99 void setTimeoutInterval(double timeoutInterval); |
99 | 100 |
100 const KURL& firstPartyForCookies() const; | 101 const KURL& firstPartyForCookies() const; |
101 void setFirstPartyForCookies(const KURL& firstPartyForCookies); | 102 void setFirstPartyForCookies(const KURL& firstPartyForCookies); |
102 | 103 |
| 104 PassRefPtr<SecurityOrigin> requestorOrigin() const; |
| 105 void setRequestorOrigin(PassRefPtr<SecurityOrigin>); |
| 106 |
103 const AtomicString& httpMethod() const; | 107 const AtomicString& httpMethod() const; |
104 void setHTTPMethod(const AtomicString&); | 108 void setHTTPMethod(const AtomicString&); |
105 | 109 |
106 const HTTPHeaderMap& httpHeaderFields() const; | 110 const HTTPHeaderMap& httpHeaderFields() const; |
107 const AtomicString& httpHeaderField(const AtomicString& name) const; | 111 const AtomicString& httpHeaderField(const AtomicString& name) const; |
108 const AtomicString& httpHeaderField(const char* name) const; | 112 const AtomicString& httpHeaderField(const char* name) const; |
109 void setHTTPHeaderField(const AtomicString& name, const AtomicString& value)
; | 113 void setHTTPHeaderField(const AtomicString& name, const AtomicString& value)
; |
110 void setHTTPHeaderField(const char* name, const AtomicString& value); | 114 void setHTTPHeaderField(const char* name, const AtomicString& value); |
111 void addHTTPHeaderField(const AtomicString& name, const AtomicString& value)
; | 115 void addHTTPHeaderField(const AtomicString& name, const AtomicString& value)
; |
112 void addHTTPHeaderFields(const HTTPHeaderMap& headerFields); | 116 void addHTTPHeaderFields(const HTTPHeaderMap& headerFields); |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 | 237 |
234 private: | 238 private: |
235 void initialize(const KURL&); | 239 void initialize(const KURL&); |
236 | 240 |
237 const CacheControlHeader& cacheControlHeader() const; | 241 const CacheControlHeader& cacheControlHeader() const; |
238 | 242 |
239 KURL m_url; | 243 KURL m_url; |
240 ResourceRequestCachePolicy m_cachePolicy; | 244 ResourceRequestCachePolicy m_cachePolicy; |
241 double m_timeoutInterval; // 0 is a magic value for platform default on plat
forms that have one. | 245 double m_timeoutInterval; // 0 is a magic value for platform default on plat
forms that have one. |
242 KURL m_firstPartyForCookies; | 246 KURL m_firstPartyForCookies; |
| 247 RefPtr<SecurityOrigin> m_requestorOrigin; |
243 AtomicString m_httpMethod; | 248 AtomicString m_httpMethod; |
244 HTTPHeaderMap m_httpHeaderFields; | 249 HTTPHeaderMap m_httpHeaderFields; |
245 RefPtr<FormData> m_httpBody; | 250 RefPtr<FormData> m_httpBody; |
246 bool m_allowStoredCredentials : 1; | 251 bool m_allowStoredCredentials : 1; |
247 bool m_reportUploadProgress : 1; | 252 bool m_reportUploadProgress : 1; |
248 bool m_reportRawHeaders : 1; | 253 bool m_reportRawHeaders : 1; |
249 bool m_hasUserGesture : 1; | 254 bool m_hasUserGesture : 1; |
250 bool m_downloadToFile : 1; | 255 bool m_downloadToFile : 1; |
251 bool m_useStreamOnResponse : 1; | 256 bool m_useStreamOnResponse : 1; |
252 bool m_skipServiceWorker : 1; | 257 bool m_skipServiceWorker : 1; |
(...skipping 29 matching lines...) Expand all Loading... |
282 | 287 |
283 struct CrossThreadResourceRequestData { | 288 struct CrossThreadResourceRequestData { |
284 WTF_MAKE_NONCOPYABLE(CrossThreadResourceRequestData); WTF_MAKE_FAST_ALLOCATE
D(CrossThreadResourceRequestData); | 289 WTF_MAKE_NONCOPYABLE(CrossThreadResourceRequestData); WTF_MAKE_FAST_ALLOCATE
D(CrossThreadResourceRequestData); |
285 public: | 290 public: |
286 CrossThreadResourceRequestData() { } | 291 CrossThreadResourceRequestData() { } |
287 KURL m_url; | 292 KURL m_url; |
288 | 293 |
289 ResourceRequestCachePolicy m_cachePolicy; | 294 ResourceRequestCachePolicy m_cachePolicy; |
290 double m_timeoutInterval; | 295 double m_timeoutInterval; |
291 KURL m_firstPartyForCookies; | 296 KURL m_firstPartyForCookies; |
| 297 RefPtr<SecurityOrigin> m_requestorOrigin; |
292 | 298 |
293 String m_httpMethod; | 299 String m_httpMethod; |
294 OwnPtr<CrossThreadHTTPHeaderMapData> m_httpHeaders; | 300 OwnPtr<CrossThreadHTTPHeaderMapData> m_httpHeaders; |
295 RefPtr<FormData> m_httpBody; | 301 RefPtr<FormData> m_httpBody; |
296 bool m_allowStoredCredentials; | 302 bool m_allowStoredCredentials; |
297 bool m_reportUploadProgress; | 303 bool m_reportUploadProgress; |
298 bool m_hasUserGesture; | 304 bool m_hasUserGesture; |
299 bool m_downloadToFile; | 305 bool m_downloadToFile; |
300 bool m_skipServiceWorker; | 306 bool m_skipServiceWorker; |
301 bool m_useStreamOnResponse; | 307 bool m_useStreamOnResponse; |
(...skipping 14 matching lines...) Expand all Loading... |
316 bool m_originatesFromReservedIPRange; | 322 bool m_originatesFromReservedIPRange; |
317 InputToLoadPerfMetricReportPolicy m_inputPerfMetricReportPolicy; | 323 InputToLoadPerfMetricReportPolicy m_inputPerfMetricReportPolicy; |
318 bool m_followedRedirect; | 324 bool m_followedRedirect; |
319 }; | 325 }; |
320 | 326 |
321 unsigned initializeMaximumHTTPConnectionCountPerHost(); | 327 unsigned initializeMaximumHTTPConnectionCountPerHost(); |
322 | 328 |
323 } // namespace blink | 329 } // namespace blink |
324 | 330 |
325 #endif // ResourceRequest_h | 331 #endif // ResourceRequest_h |
OLD | NEW |