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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 ResourceRequestBlockedReasonOther, | 54 ResourceRequestBlockedReasonOther, |
55 ResourceRequestBlockedReasonNone | 55 ResourceRequestBlockedReasonNone |
56 }; | 56 }; |
57 | 57 |
58 enum InputToLoadPerfMetricReportPolicy { | 58 enum InputToLoadPerfMetricReportPolicy { |
59 NoReport, // Don't report metrics for this ResourceRequest. | 59 NoReport, // Don't report metrics for this ResourceRequest. |
60 ReportLink, // Report metrics for this request as initiated by a link click. | 60 ReportLink, // Report metrics for this request as initiated by a link click. |
61 ReportIntent, // Report metrics for this request as initiated by an intent. | 61 ReportIntent, // Report metrics for this request as initiated by an intent. |
62 }; | 62 }; |
63 | 63 |
| 64 enum InterventionsFlag { |
| 65 InterventionNone = 0, |
| 66 // Indicates that the doc written script was blocked and this is an async |
| 67 // fetch for it. This is currently used to set the lowest priority. |
| 68 InterventionBlockedDocWriteScriptAsyncFetch = 1 << 0, |
| 69 }; |
| 70 |
64 struct CrossThreadResourceRequestData; | 71 struct CrossThreadResourceRequestData; |
65 | 72 |
66 class PLATFORM_EXPORT ResourceRequest final { | 73 class PLATFORM_EXPORT ResourceRequest final { |
67 DISALLOW_NEW(); | 74 DISALLOW_NEW(); |
68 public: | 75 public: |
69 enum class RedirectStatus { FollowedRedirect, NoRedirect }; | 76 enum class RedirectStatus { FollowedRedirect, NoRedirect }; |
70 | 77 |
71 class ExtraData : public RefCounted<ExtraData> { | 78 class ExtraData : public RefCounted<ExtraData> { |
72 public: | 79 public: |
73 virtual ~ExtraData() { } | 80 virtual ~ExtraData() { } |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 void setHTTPBody(PassRefPtr<EncodedFormData>); | 147 void setHTTPBody(PassRefPtr<EncodedFormData>); |
141 | 148 |
142 EncodedFormData* attachedCredential() const; | 149 EncodedFormData* attachedCredential() const; |
143 void setAttachedCredential(PassRefPtr<EncodedFormData>); | 150 void setAttachedCredential(PassRefPtr<EncodedFormData>); |
144 | 151 |
145 bool allowStoredCredentials() const; | 152 bool allowStoredCredentials() const; |
146 void setAllowStoredCredentials(bool allowCredentials); | 153 void setAllowStoredCredentials(bool allowCredentials); |
147 | 154 |
148 ResourceLoadPriority priority() const; | 155 ResourceLoadPriority priority() const; |
149 void setPriority(ResourceLoadPriority, int intraPriorityValue = 0); | 156 void setPriority(ResourceLoadPriority, int intraPriorityValue = 0); |
| 157 ResourceLoadPriority computePriorityForInterventions(ResourceLoadPriority) c
onst; |
150 | 158 |
151 bool isConditional() const; | 159 bool isConditional() const; |
152 | 160 |
153 // Whether the associated ResourceHandleClient needs to be notified of | 161 // Whether the associated ResourceHandleClient needs to be notified of |
154 // upload progress made for that resource. | 162 // upload progress made for that resource. |
155 bool reportUploadProgress() const { return m_reportUploadProgress; } | 163 bool reportUploadProgress() const { return m_reportUploadProgress; } |
156 void setReportUploadProgress(bool reportUploadProgress) { m_reportUploadProg
ress = reportUploadProgress; } | 164 void setReportUploadProgress(bool reportUploadProgress) { m_reportUploadProg
ress = reportUploadProgress; } |
157 | 165 |
158 // Whether actual headers being sent/received should be collected and report
ed for the request. | 166 // Whether actual headers being sent/received should be collected and report
ed for the request. |
159 bool reportRawHeaders() const { return m_reportRawHeaders; } | 167 bool reportRawHeaders() const { return m_reportRawHeaders; } |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 // https://mikewest.github.io/cors-rfc1918/#external-request | 238 // https://mikewest.github.io/cors-rfc1918/#external-request |
231 bool isExternalRequest() const { return m_isExternalRequest; } | 239 bool isExternalRequest() const { return m_isExternalRequest; } |
232 void setExternalRequestStateFromRequestorAddressSpace(WebAddressSpace); | 240 void setExternalRequestStateFromRequestorAddressSpace(WebAddressSpace); |
233 | 241 |
234 InputToLoadPerfMetricReportPolicy inputPerfMetricReportPolicy() const { retu
rn m_inputPerfMetricReportPolicy; } | 242 InputToLoadPerfMetricReportPolicy inputPerfMetricReportPolicy() const { retu
rn m_inputPerfMetricReportPolicy; } |
235 void setInputPerfMetricReportPolicy(InputToLoadPerfMetricReportPolicy inputP
erfMetricReportPolicy) { m_inputPerfMetricReportPolicy = inputPerfMetricReportPo
licy; } | 243 void setInputPerfMetricReportPolicy(InputToLoadPerfMetricReportPolicy inputP
erfMetricReportPolicy) { m_inputPerfMetricReportPolicy = inputPerfMetricReportPo
licy; } |
236 | 244 |
237 void setRedirectStatus(RedirectStatus status) { m_redirectStatus = status; } | 245 void setRedirectStatus(RedirectStatus status) { m_redirectStatus = status; } |
238 RedirectStatus redirectStatus() const { return m_redirectStatus; } | 246 RedirectStatus redirectStatus() const { return m_redirectStatus; } |
239 | 247 |
| 248 void setInterventionsInfo(int flag) { m_interventionsInfo = m_interventionsI
nfo | flag; } |
| 249 |
240 private: | 250 private: |
241 void initialize(const KURL&); | 251 void initialize(const KURL&); |
242 | 252 |
243 const CacheControlHeader& cacheControlHeader() const; | 253 const CacheControlHeader& cacheControlHeader() const; |
244 | 254 |
245 KURL m_url; | 255 KURL m_url; |
246 WebCachePolicy m_cachePolicy; | 256 WebCachePolicy m_cachePolicy; |
247 double m_timeoutInterval; // 0 is a magic value for platform default on plat
forms that have one. | 257 double m_timeoutInterval; // 0 is a magic value for platform default on plat
forms that have one. |
248 KURL m_firstPartyForCookies; | 258 KURL m_firstPartyForCookies; |
249 RefPtr<SecurityOrigin> m_requestorOrigin; | 259 RefPtr<SecurityOrigin> m_requestorOrigin; |
250 AtomicString m_httpMethod; | 260 AtomicString m_httpMethod; |
251 HTTPHeaderMap m_httpHeaderFields; | 261 HTTPHeaderMap m_httpHeaderFields; |
252 RefPtr<EncodedFormData> m_httpBody; | 262 RefPtr<EncodedFormData> m_httpBody; |
253 RefPtr<EncodedFormData> m_attachedCredential; | 263 RefPtr<EncodedFormData> m_attachedCredential; |
254 bool m_allowStoredCredentials : 1; | 264 bool m_allowStoredCredentials : 1; |
255 bool m_reportUploadProgress : 1; | 265 bool m_reportUploadProgress : 1; |
256 bool m_reportRawHeaders : 1; | 266 bool m_reportRawHeaders : 1; |
257 bool m_hasUserGesture : 1; | 267 bool m_hasUserGesture : 1; |
258 bool m_downloadToFile : 1; | 268 bool m_downloadToFile : 1; |
259 bool m_useStreamOnResponse : 1; | 269 bool m_useStreamOnResponse : 1; |
260 bool m_shouldResetAppCache : 1; | 270 bool m_shouldResetAppCache : 1; |
| 271 int m_interventionsInfo; |
261 WebURLRequest::SkipServiceWorker m_skipServiceWorker; | 272 WebURLRequest::SkipServiceWorker m_skipServiceWorker; |
262 ResourceLoadPriority m_priority; | 273 ResourceLoadPriority m_priority; |
263 int m_intraPriorityValue; | 274 int m_intraPriorityValue; |
264 int m_requestorID; | 275 int m_requestorID; |
265 int m_requestorProcessID; | 276 int m_requestorProcessID; |
266 int m_appCacheHostID; | 277 int m_appCacheHostID; |
267 RefPtr<ExtraData> m_extraData; | 278 RefPtr<ExtraData> m_extraData; |
268 WebURLRequest::RequestContext m_requestContext; | 279 WebURLRequest::RequestContext m_requestContext; |
269 WebURLRequest::FrameType m_frameType; | 280 WebURLRequest::FrameType m_frameType; |
270 WebURLRequest::FetchRequestMode m_fetchRequestMode; | 281 WebURLRequest::FetchRequestMode m_fetchRequestMode; |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 bool m_checkForBrowserSideNavigation; | 334 bool m_checkForBrowserSideNavigation; |
324 double m_uiStartTime; | 335 double m_uiStartTime; |
325 bool m_isExternalRequest; | 336 bool m_isExternalRequest; |
326 InputToLoadPerfMetricReportPolicy m_inputPerfMetricReportPolicy; | 337 InputToLoadPerfMetricReportPolicy m_inputPerfMetricReportPolicy; |
327 ResourceRequest::RedirectStatus m_redirectStatus; | 338 ResourceRequest::RedirectStatus m_redirectStatus; |
328 }; | 339 }; |
329 | 340 |
330 } // namespace blink | 341 } // namespace blink |
331 | 342 |
332 #endif // ResourceRequest_h | 343 #endif // ResourceRequest_h |
OLD | NEW |