| 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 Google Inc. All rights reserved. | 3 * Copyright (C) 2009 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 if (encodingCount > 1) { | 56 if (encodingCount > 1) { |
| 57 encoding2 = data->m_responseContentDispositionEncodingFallbackArray[
1]; | 57 encoding2 = data->m_responseContentDispositionEncodingFallbackArray[
1]; |
| 58 if (encodingCount > 2) | 58 if (encodingCount > 2) |
| 59 encoding3 = data->m_responseContentDispositionEncodingFallbackAr
ray[2]; | 59 encoding3 = data->m_responseContentDispositionEncodingFallbackAr
ray[2]; |
| 60 } | 60 } |
| 61 ASSERT(encodingCount <= 3); | 61 ASSERT(encodingCount <= 3); |
| 62 request->setResponseContentDispositionEncodingFallbackArray(encoding1, e
ncoding2, encoding3); | 62 request->setResponseContentDispositionEncodingFallbackArray(encoding1, e
ncoding2, encoding3); |
| 63 } | 63 } |
| 64 request->setHTTPBody(data->m_httpBody); | 64 request->setHTTPBody(data->m_httpBody); |
| 65 request->setAllowHTTPCookies(data->m_allowHTTPCookies); | 65 request->setAllowHTTPCookies(data->m_allowHTTPCookies); |
| 66 #if ENABLE(APPLICATION_CACHE) |
| 67 request->setApplicationCacheContextID(data->m_appcacheContextID); |
| 68 #endif |
| 66 return request; | 69 return request; |
| 67 } | 70 } |
| 68 | 71 |
| 69 auto_ptr<CrossThreadResourceRequestData> ResourceRequestBase::copyData() const | 72 auto_ptr<CrossThreadResourceRequestData> ResourceRequestBase::copyData() const |
| 70 { | 73 { |
| 71 auto_ptr<CrossThreadResourceRequestData> data(new CrossThreadResourceRequest
Data()); | 74 auto_ptr<CrossThreadResourceRequestData> data(new CrossThreadResourceRequest
Data()); |
| 72 data->m_url = url().copy(); | 75 data->m_url = url().copy(); |
| 73 data->m_cachePolicy = cachePolicy(); | 76 data->m_cachePolicy = cachePolicy(); |
| 74 data->m_timeoutInterval = timeoutInterval(); | 77 data->m_timeoutInterval = timeoutInterval(); |
| 75 data->m_firstPartyForCookies = firstPartyForCookies().copy(); | 78 data->m_firstPartyForCookies = firstPartyForCookies().copy(); |
| 76 data->m_httpMethod = httpMethod().copy(); | 79 data->m_httpMethod = httpMethod().copy(); |
| 77 data->m_httpHeaders.adopt(httpHeaderFields().copyData()); | 80 data->m_httpHeaders.adopt(httpHeaderFields().copyData()); |
| 78 | 81 |
| 79 data->m_responseContentDispositionEncodingFallbackArray.reserveInitialCapaci
ty(m_responseContentDispositionEncodingFallbackArray.size()); | 82 data->m_responseContentDispositionEncodingFallbackArray.reserveInitialCapaci
ty(m_responseContentDispositionEncodingFallbackArray.size()); |
| 80 size_t encodingArraySize = m_responseContentDispositionEncodingFallbackArray
.size(); | 83 size_t encodingArraySize = m_responseContentDispositionEncodingFallbackArray
.size(); |
| 81 for (size_t index = 0; index < encodingArraySize; ++index) { | 84 for (size_t index = 0; index < encodingArraySize; ++index) { |
| 82 data->m_responseContentDispositionEncodingFallbackArray.append(m_respons
eContentDispositionEncodingFallbackArray[index].copy()); | 85 data->m_responseContentDispositionEncodingFallbackArray.append(m_respons
eContentDispositionEncodingFallbackArray[index].copy()); |
| 83 } | 86 } |
| 84 if (m_httpBody) | 87 if (m_httpBody) |
| 85 data->m_httpBody = m_httpBody->deepCopy(); | 88 data->m_httpBody = m_httpBody->deepCopy(); |
| 86 data->m_allowHTTPCookies = m_allowHTTPCookies; | 89 data->m_allowHTTPCookies = m_allowHTTPCookies; |
| 90 #if ENABLE(APPLICATION_CACHE) |
| 91 data->m_appcacheContextID = m_appcacheContextID; |
| 92 #endif |
| 87 return data; | 93 return data; |
| 88 } | 94 } |
| 89 | 95 |
| 90 bool ResourceRequestBase::isEmpty() const | 96 bool ResourceRequestBase::isEmpty() const |
| 91 { | 97 { |
| 92 updateResourceRequest(); | 98 updateResourceRequest(); |
| 93 | 99 |
| 94 return m_url.isEmpty(); | 100 return m_url.isEmpty(); |
| 95 } | 101 } |
| 96 | 102 |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 #if !PLATFORM(MAC) && !USE(CFNETWORK) | 364 #if !PLATFORM(MAC) && !USE(CFNETWORK) |
| 359 unsigned initializeMaximumHTTPConnectionCountPerHost() | 365 unsigned initializeMaximumHTTPConnectionCountPerHost() |
| 360 { | 366 { |
| 361 // This is used by the loader to control the number of issued parallel load
requests. | 367 // This is used by the loader to control the number of issued parallel load
requests. |
| 362 // Four seems to be a common default in HTTP frameworks. | 368 // Four seems to be a common default in HTTP frameworks. |
| 363 return 4; | 369 return 4; |
| 364 } | 370 } |
| 365 #endif | 371 #endif |
| 366 | 372 |
| 367 } | 373 } |
| OLD | NEW |