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) 2009, 2012 Google Inc. All rights reserved. | 3 * Copyright (C) 2009, 2012 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 26 matching lines...) Expand all Loading... |
37 request->setURL(data->m_url); | 37 request->setURL(data->m_url); |
38 request->setCachePolicy(data->m_cachePolicy); | 38 request->setCachePolicy(data->m_cachePolicy); |
39 request->setTimeoutInterval(data->m_timeoutInterval); | 39 request->setTimeoutInterval(data->m_timeoutInterval); |
40 request->setFirstPartyForCookies(data->m_firstPartyForCookies); | 40 request->setFirstPartyForCookies(data->m_firstPartyForCookies); |
41 request->setHTTPMethod(AtomicString(data->m_httpMethod)); | 41 request->setHTTPMethod(AtomicString(data->m_httpMethod)); |
42 request->setPriority(data->m_priority); | 42 request->setPriority(data->m_priority); |
43 | 43 |
44 request->m_httpHeaderFields.adopt(data->m_httpHeaders.release()); | 44 request->m_httpHeaderFields.adopt(data->m_httpHeaders.release()); |
45 | 45 |
46 request->setHTTPBody(data->m_httpBody); | 46 request->setHTTPBody(data->m_httpBody); |
47 request->setAllowCookies(data->m_allowCookies); | 47 request->setAllowStoredCredentials(data->m_allowStoredCredentials); |
48 request->setReportUploadProgress(data->m_reportUploadProgress); | 48 request->setReportUploadProgress(data->m_reportUploadProgress); |
49 request->setHasUserGesture(data->m_hasUserGesture); | 49 request->setHasUserGesture(data->m_hasUserGesture); |
50 request->setDownloadToFile(data->m_downloadToFile); | 50 request->setDownloadToFile(data->m_downloadToFile); |
51 request->setRequestorID(data->m_requestorID); | 51 request->setRequestorID(data->m_requestorID); |
52 request->setRequestorProcessID(data->m_requestorProcessID); | 52 request->setRequestorProcessID(data->m_requestorProcessID); |
53 request->setAppCacheHostID(data->m_appCacheHostID); | 53 request->setAppCacheHostID(data->m_appCacheHostID); |
54 request->setTargetType(data->m_targetType); | 54 request->setTargetType(data->m_targetType); |
55 request->m_referrerPolicy = data->m_referrerPolicy; | 55 request->m_referrerPolicy = data->m_referrerPolicy; |
56 return request.release(); | 56 return request.release(); |
57 } | 57 } |
58 | 58 |
59 PassOwnPtr<CrossThreadResourceRequestData> ResourceRequest::copyData() const | 59 PassOwnPtr<CrossThreadResourceRequestData> ResourceRequest::copyData() const |
60 { | 60 { |
61 OwnPtr<CrossThreadResourceRequestData> data = adoptPtr(new CrossThreadResour
ceRequestData()); | 61 OwnPtr<CrossThreadResourceRequestData> data = adoptPtr(new CrossThreadResour
ceRequestData()); |
62 data->m_url = url().copy(); | 62 data->m_url = url().copy(); |
63 data->m_cachePolicy = cachePolicy(); | 63 data->m_cachePolicy = cachePolicy(); |
64 data->m_timeoutInterval = timeoutInterval(); | 64 data->m_timeoutInterval = timeoutInterval(); |
65 data->m_firstPartyForCookies = firstPartyForCookies().copy(); | 65 data->m_firstPartyForCookies = firstPartyForCookies().copy(); |
66 data->m_httpMethod = httpMethod().string().isolatedCopy(); | 66 data->m_httpMethod = httpMethod().string().isolatedCopy(); |
67 data->m_httpHeaders = httpHeaderFields().copyData(); | 67 data->m_httpHeaders = httpHeaderFields().copyData(); |
68 data->m_priority = priority(); | 68 data->m_priority = priority(); |
69 | 69 |
70 if (m_httpBody) | 70 if (m_httpBody) |
71 data->m_httpBody = m_httpBody->deepCopy(); | 71 data->m_httpBody = m_httpBody->deepCopy(); |
72 data->m_allowCookies = m_allowCookies; | 72 data->m_allowStoredCredentials = m_allowStoredCredentials; |
73 data->m_reportUploadProgress = m_reportUploadProgress; | 73 data->m_reportUploadProgress = m_reportUploadProgress; |
74 data->m_hasUserGesture = m_hasUserGesture; | 74 data->m_hasUserGesture = m_hasUserGesture; |
75 data->m_downloadToFile = m_downloadToFile; | 75 data->m_downloadToFile = m_downloadToFile; |
76 data->m_requestorID = m_requestorID; | 76 data->m_requestorID = m_requestorID; |
77 data->m_requestorProcessID = m_requestorProcessID; | 77 data->m_requestorProcessID = m_requestorProcessID; |
78 data->m_appCacheHostID = m_appCacheHostID; | 78 data->m_appCacheHostID = m_appCacheHostID; |
79 data->m_targetType = m_targetType; | 79 data->m_targetType = m_targetType; |
80 data->m_referrerPolicy = m_referrerPolicy; | 80 data->m_referrerPolicy = m_referrerPolicy; |
81 return data.release(); | 81 return data.release(); |
82 } | 82 } |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 FormData* ResourceRequest::httpBody() const | 209 FormData* ResourceRequest::httpBody() const |
210 { | 210 { |
211 return m_httpBody.get(); | 211 return m_httpBody.get(); |
212 } | 212 } |
213 | 213 |
214 void ResourceRequest::setHTTPBody(PassRefPtr<FormData> httpBody) | 214 void ResourceRequest::setHTTPBody(PassRefPtr<FormData> httpBody) |
215 { | 215 { |
216 m_httpBody = httpBody; | 216 m_httpBody = httpBody; |
217 } | 217 } |
218 | 218 |
219 bool ResourceRequest::allowCookies() const | 219 bool ResourceRequest::allowStoredCredentials() const |
220 { | 220 { |
221 return m_allowCookies; | 221 return m_allowStoredCredentials; |
222 } | 222 } |
223 | 223 |
224 void ResourceRequest::setAllowCookies(bool allowCookies) | 224 void ResourceRequest::setAllowStoredCredentials(bool allowCredentials) |
225 { | 225 { |
226 m_allowCookies = allowCookies; | 226 m_allowStoredCredentials = allowCredentials; |
227 } | 227 } |
228 | 228 |
229 ResourceLoadPriority ResourceRequest::priority() const | 229 ResourceLoadPriority ResourceRequest::priority() const |
230 { | 230 { |
231 return m_priority; | 231 return m_priority; |
232 } | 232 } |
233 | 233 |
234 void ResourceRequest::setPriority(ResourceLoadPriority priority) | 234 void ResourceRequest::setPriority(ResourceLoadPriority priority) |
235 { | 235 { |
236 m_priority = priority; | 236 m_priority = priority; |
(...skipping 28 matching lines...) Expand all Loading... |
265 | 265 |
266 if (a.timeoutInterval() != b.timeoutInterval()) | 266 if (a.timeoutInterval() != b.timeoutInterval()) |
267 return false; | 267 return false; |
268 | 268 |
269 if (a.firstPartyForCookies() != b.firstPartyForCookies()) | 269 if (a.firstPartyForCookies() != b.firstPartyForCookies()) |
270 return false; | 270 return false; |
271 | 271 |
272 if (a.httpMethod() != b.httpMethod()) | 272 if (a.httpMethod() != b.httpMethod()) |
273 return false; | 273 return false; |
274 | 274 |
275 if (a.allowCookies() != b.allowCookies()) | 275 if (a.allowStoredCredentials() != b.allowStoredCredentials()) |
276 return false; | 276 return false; |
277 | 277 |
278 if (a.priority() != b.priority()) | 278 if (a.priority() != b.priority()) |
279 return false; | 279 return false; |
280 | 280 |
281 if (a.referrerPolicy() != b.referrerPolicy()) | 281 if (a.referrerPolicy() != b.referrerPolicy()) |
282 return false; | 282 return false; |
283 | 283 |
284 FormData* formDataA = a.httpBody(); | 284 FormData* formDataA = a.httpBody(); |
285 FormData* formDataB = b.httpBody(); | 285 FormData* formDataB = b.httpBody(); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 { | 325 { |
326 s_defaultTimeoutInterval = timeoutInterval; | 326 s_defaultTimeoutInterval = timeoutInterval; |
327 } | 327 } |
328 | 328 |
329 void ResourceRequest::initialize(const KURL& url, ResourceRequestCachePolicy cac
hePolicy) | 329 void ResourceRequest::initialize(const KURL& url, ResourceRequestCachePolicy cac
hePolicy) |
330 { | 330 { |
331 m_url = url; | 331 m_url = url; |
332 m_cachePolicy = cachePolicy; | 332 m_cachePolicy = cachePolicy; |
333 m_timeoutInterval = s_defaultTimeoutInterval; | 333 m_timeoutInterval = s_defaultTimeoutInterval; |
334 m_httpMethod = "GET"; | 334 m_httpMethod = "GET"; |
335 m_allowCookies = true; | 335 m_allowStoredCredentials = true; |
336 m_reportUploadProgress = false; | 336 m_reportUploadProgress = false; |
337 m_reportLoadTiming = false; | 337 m_reportLoadTiming = false; |
338 m_reportRawHeaders = false; | 338 m_reportRawHeaders = false; |
339 m_hasUserGesture = false; | 339 m_hasUserGesture = false; |
340 m_downloadToFile = false; | 340 m_downloadToFile = false; |
341 m_priority = ResourceLoadPriorityLow; | 341 m_priority = ResourceLoadPriorityLow; |
342 m_requestorID = 0; | 342 m_requestorID = 0; |
343 m_requestorProcessID = 0; | 343 m_requestorProcessID = 0; |
344 m_appCacheHostID = 0; | 344 m_appCacheHostID = 0; |
345 m_targetType = TargetIsUnspecified; | 345 m_targetType = TargetIsUnspecified; |
346 m_referrerPolicy = ReferrerPolicyDefault; | 346 m_referrerPolicy = ReferrerPolicyDefault; |
347 } | 347 } |
348 | 348 |
349 // This is used by the loader to control the number of issued parallel load requ
ests. | 349 // This is used by the loader to control the number of issued parallel load requ
ests. |
350 unsigned initializeMaximumHTTPConnectionCountPerHost() | 350 unsigned initializeMaximumHTTPConnectionCountPerHost() |
351 { | 351 { |
352 // The chromium network stack already handles limiting the number of | 352 // The chromium network stack already handles limiting the number of |
353 // parallel requests per host, so there's no need to do it here. Therefore, | 353 // parallel requests per host, so there's no need to do it here. Therefore, |
354 // this is set to a high value that should never be hit in practice. | 354 // this is set to a high value that should never be hit in practice. |
355 return 10000; | 355 return 10000; |
356 } | 356 } |
357 | 357 |
358 } | 358 } |
OLD | NEW |