| 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 21 matching lines...) Expand all Loading... |
| 32 double ResourceRequest::s_defaultTimeoutInterval = INT_MAX; | 32 double ResourceRequest::s_defaultTimeoutInterval = INT_MAX; |
| 33 | 33 |
| 34 PassOwnPtr<ResourceRequest> ResourceRequest::adopt(PassOwnPtr<CrossThreadResourc
eRequestData> data) | 34 PassOwnPtr<ResourceRequest> ResourceRequest::adopt(PassOwnPtr<CrossThreadResourc
eRequestData> data) |
| 35 { | 35 { |
| 36 OwnPtr<ResourceRequest> request = adoptPtr(new ResourceRequest()); | 36 OwnPtr<ResourceRequest> request = adoptPtr(new ResourceRequest()); |
| 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, data->m_intraPriorityValue); |
| 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->setAllowStoredCredentials(data->m_allowStoredCredentials); | 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 data->m_intraPriorityValue = m_intraPriorityValue; |
| 69 | 70 |
| 70 if (m_httpBody) | 71 if (m_httpBody) |
| 71 data->m_httpBody = m_httpBody->deepCopy(); | 72 data->m_httpBody = m_httpBody->deepCopy(); |
| 72 data->m_allowStoredCredentials = m_allowStoredCredentials; | 73 data->m_allowStoredCredentials = m_allowStoredCredentials; |
| 73 data->m_reportUploadProgress = m_reportUploadProgress; | 74 data->m_reportUploadProgress = m_reportUploadProgress; |
| 74 data->m_hasUserGesture = m_hasUserGesture; | 75 data->m_hasUserGesture = m_hasUserGesture; |
| 75 data->m_downloadToFile = m_downloadToFile; | 76 data->m_downloadToFile = m_downloadToFile; |
| 76 data->m_requestorID = m_requestorID; | 77 data->m_requestorID = m_requestorID; |
| 77 data->m_requestorProcessID = m_requestorProcessID; | 78 data->m_requestorProcessID = m_requestorProcessID; |
| 78 data->m_appCacheHostID = m_appCacheHostID; | 79 data->m_appCacheHostID = m_appCacheHostID; |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 void ResourceRequest::setAllowStoredCredentials(bool allowCredentials) | 225 void ResourceRequest::setAllowStoredCredentials(bool allowCredentials) |
| 225 { | 226 { |
| 226 m_allowStoredCredentials = allowCredentials; | 227 m_allowStoredCredentials = allowCredentials; |
| 227 } | 228 } |
| 228 | 229 |
| 229 ResourceLoadPriority ResourceRequest::priority() const | 230 ResourceLoadPriority ResourceRequest::priority() const |
| 230 { | 231 { |
| 231 return m_priority; | 232 return m_priority; |
| 232 } | 233 } |
| 233 | 234 |
| 234 void ResourceRequest::setPriority(ResourceLoadPriority priority) | 235 void ResourceRequest::setPriority(ResourceLoadPriority priority, int intraPriori
tyValue) |
| 235 { | 236 { |
| 236 m_priority = priority; | 237 m_priority = priority; |
| 238 m_intraPriorityValue = intraPriorityValue; |
| 237 } | 239 } |
| 238 | 240 |
| 239 void ResourceRequest::addHTTPHeaderField(const AtomicString& name, const AtomicS
tring& value) | 241 void ResourceRequest::addHTTPHeaderField(const AtomicString& name, const AtomicS
tring& value) |
| 240 { | 242 { |
| 241 HTTPHeaderMap::AddResult result = m_httpHeaderFields.add(name, value); | 243 HTTPHeaderMap::AddResult result = m_httpHeaderFields.add(name, value); |
| 242 if (!result.isNewEntry) | 244 if (!result.isNewEntry) |
| 243 result.storedValue->value = result.storedValue->value + ',' + value; | 245 result.storedValue->value = result.storedValue->value + ',' + value; |
| 244 } | 246 } |
| 245 | 247 |
| 246 void ResourceRequest::addHTTPHeaderFields(const HTTPHeaderMap& headerFields) | 248 void ResourceRequest::addHTTPHeaderFields(const HTTPHeaderMap& headerFields) |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 m_cachePolicy = cachePolicy; | 334 m_cachePolicy = cachePolicy; |
| 333 m_timeoutInterval = s_defaultTimeoutInterval; | 335 m_timeoutInterval = s_defaultTimeoutInterval; |
| 334 m_httpMethod = "GET"; | 336 m_httpMethod = "GET"; |
| 335 m_allowStoredCredentials = true; | 337 m_allowStoredCredentials = true; |
| 336 m_reportUploadProgress = false; | 338 m_reportUploadProgress = false; |
| 337 m_reportLoadTiming = false; | 339 m_reportLoadTiming = false; |
| 338 m_reportRawHeaders = false; | 340 m_reportRawHeaders = false; |
| 339 m_hasUserGesture = false; | 341 m_hasUserGesture = false; |
| 340 m_downloadToFile = false; | 342 m_downloadToFile = false; |
| 341 m_priority = ResourceLoadPriorityLow; | 343 m_priority = ResourceLoadPriorityLow; |
| 344 m_intraPriorityValue = 0; |
| 342 m_requestorID = 0; | 345 m_requestorID = 0; |
| 343 m_requestorProcessID = 0; | 346 m_requestorProcessID = 0; |
| 344 m_appCacheHostID = 0; | 347 m_appCacheHostID = 0; |
| 345 m_targetType = TargetIsUnspecified; | 348 m_targetType = TargetIsUnspecified; |
| 346 m_referrerPolicy = ReferrerPolicyDefault; | 349 m_referrerPolicy = ReferrerPolicyDefault; |
| 347 } | 350 } |
| 348 | 351 |
| 349 // This is used by the loader to control the number of issued parallel load requ
ests. | 352 // This is used by the loader to control the number of issued parallel load requ
ests. |
| 350 unsigned initializeMaximumHTTPConnectionCountPerHost() | 353 unsigned initializeMaximumHTTPConnectionCountPerHost() |
| 351 { | 354 { |
| 352 // The chromium network stack already handles limiting the number of | 355 // 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, | 356 // 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. | 357 // this is set to a high value that should never be hit in practice. |
| 355 return 10000; | 358 return 10000; |
| 356 } | 359 } |
| 357 | 360 |
| 358 } | 361 } |
| OLD | NEW |