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 22 matching lines...) Expand all Loading... | |
33 | 33 |
34 double ResourceRequest::s_defaultTimeoutInterval = INT_MAX; | 34 double ResourceRequest::s_defaultTimeoutInterval = INT_MAX; |
35 | 35 |
36 PassOwnPtr<ResourceRequest> ResourceRequest::adopt(PassOwnPtr<CrossThreadResourc eRequestData> data) | 36 PassOwnPtr<ResourceRequest> ResourceRequest::adopt(PassOwnPtr<CrossThreadResourc eRequestData> data) |
37 { | 37 { |
38 OwnPtr<ResourceRequest> request = adoptPtr(new ResourceRequest()); | 38 OwnPtr<ResourceRequest> request = adoptPtr(new ResourceRequest()); |
39 request->setURL(data->m_url); | 39 request->setURL(data->m_url); |
40 request->setCachePolicy(data->m_cachePolicy); | 40 request->setCachePolicy(data->m_cachePolicy); |
41 request->setTimeoutInterval(data->m_timeoutInterval); | 41 request->setTimeoutInterval(data->m_timeoutInterval); |
42 request->setFirstPartyForCookies(data->m_firstPartyForCookies); | 42 request->setFirstPartyForCookies(data->m_firstPartyForCookies); |
43 request->setRequestorURL(data->m_requestorURL); | |
43 request->setHTTPMethod(AtomicString(data->m_httpMethod)); | 44 request->setHTTPMethod(AtomicString(data->m_httpMethod)); |
44 request->setPriority(data->m_priority, data->m_intraPriorityValue); | 45 request->setPriority(data->m_priority, data->m_intraPriorityValue); |
45 | 46 |
46 request->m_httpHeaderFields.adopt(data->m_httpHeaders.release()); | 47 request->m_httpHeaderFields.adopt(data->m_httpHeaders.release()); |
47 | 48 |
48 request->setHTTPBody(data->m_httpBody); | 49 request->setHTTPBody(data->m_httpBody); |
49 request->setAllowStoredCredentials(data->m_allowStoredCredentials); | 50 request->setAllowStoredCredentials(data->m_allowStoredCredentials); |
50 request->setReportUploadProgress(data->m_reportUploadProgress); | 51 request->setReportUploadProgress(data->m_reportUploadProgress); |
51 request->setHasUserGesture(data->m_hasUserGesture); | 52 request->setHasUserGesture(data->m_hasUserGesture); |
52 request->setDownloadToFile(data->m_downloadToFile); | 53 request->setDownloadToFile(data->m_downloadToFile); |
(...skipping 17 matching lines...) Expand all Loading... | |
70 return request.release(); | 71 return request.release(); |
71 } | 72 } |
72 | 73 |
73 PassOwnPtr<CrossThreadResourceRequestData> ResourceRequest::copyData() const | 74 PassOwnPtr<CrossThreadResourceRequestData> ResourceRequest::copyData() const |
74 { | 75 { |
75 OwnPtr<CrossThreadResourceRequestData> data = adoptPtr(new CrossThreadResour ceRequestData()); | 76 OwnPtr<CrossThreadResourceRequestData> data = adoptPtr(new CrossThreadResour ceRequestData()); |
76 data->m_url = url().copy(); | 77 data->m_url = url().copy(); |
77 data->m_cachePolicy = cachePolicy(); | 78 data->m_cachePolicy = cachePolicy(); |
78 data->m_timeoutInterval = timeoutInterval(); | 79 data->m_timeoutInterval = timeoutInterval(); |
79 data->m_firstPartyForCookies = firstPartyForCookies().copy(); | 80 data->m_firstPartyForCookies = firstPartyForCookies().copy(); |
81 data->m_requestorURL = requestorURL().copy(); | |
80 data->m_httpMethod = httpMethod().string().isolatedCopy(); | 82 data->m_httpMethod = httpMethod().string().isolatedCopy(); |
81 data->m_httpHeaders = httpHeaderFields().copyData(); | 83 data->m_httpHeaders = httpHeaderFields().copyData(); |
82 data->m_priority = priority(); | 84 data->m_priority = priority(); |
83 data->m_intraPriorityValue = m_intraPriorityValue; | 85 data->m_intraPriorityValue = m_intraPriorityValue; |
84 | 86 |
85 if (m_httpBody) | 87 if (m_httpBody) |
86 data->m_httpBody = m_httpBody->deepCopy(); | 88 data->m_httpBody = m_httpBody->deepCopy(); |
87 data->m_allowStoredCredentials = m_allowStoredCredentials; | 89 data->m_allowStoredCredentials = m_allowStoredCredentials; |
88 data->m_reportUploadProgress = m_reportUploadProgress; | 90 data->m_reportUploadProgress = m_reportUploadProgress; |
89 data->m_hasUserGesture = m_hasUserGesture; | 91 data->m_hasUserGesture = m_hasUserGesture; |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
160 const KURL& ResourceRequest::firstPartyForCookies() const | 162 const KURL& ResourceRequest::firstPartyForCookies() const |
161 { | 163 { |
162 return m_firstPartyForCookies; | 164 return m_firstPartyForCookies; |
163 } | 165 } |
164 | 166 |
165 void ResourceRequest::setFirstPartyForCookies(const KURL& firstPartyForCookies) | 167 void ResourceRequest::setFirstPartyForCookies(const KURL& firstPartyForCookies) |
166 { | 168 { |
167 m_firstPartyForCookies = firstPartyForCookies; | 169 m_firstPartyForCookies = firstPartyForCookies; |
168 } | 170 } |
169 | 171 |
172 const KURL& ResourceRequest::requestorURL() const | |
173 { | |
174 return m_requestorURL; | |
175 } | |
176 | |
177 void ResourceRequest::setRequestorURL(const KURL& requestorURL) | |
178 { | |
179 m_requestorURL = requestorURL; | |
180 } | |
181 | |
170 const AtomicString& ResourceRequest::httpMethod() const | 182 const AtomicString& ResourceRequest::httpMethod() const |
171 { | 183 { |
172 return m_httpMethod; | 184 return m_httpMethod; |
173 } | 185 } |
174 | 186 |
175 void ResourceRequest::setHTTPMethod(const AtomicString& httpMethod) | 187 void ResourceRequest::setHTTPMethod(const AtomicString& httpMethod) |
176 { | 188 { |
177 m_httpMethod = httpMethod; | 189 m_httpMethod = httpMethod; |
178 } | 190 } |
179 | 191 |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
317 | 329 |
318 if (a.cachePolicy() != b.cachePolicy()) | 330 if (a.cachePolicy() != b.cachePolicy()) |
319 return false; | 331 return false; |
320 | 332 |
321 if (a.timeoutInterval() != b.timeoutInterval()) | 333 if (a.timeoutInterval() != b.timeoutInterval()) |
322 return false; | 334 return false; |
323 | 335 |
324 if (a.firstPartyForCookies() != b.firstPartyForCookies()) | 336 if (a.firstPartyForCookies() != b.firstPartyForCookies()) |
325 return false; | 337 return false; |
326 | 338 |
339 if (a.requestorURL() != b.requestorURL()) | |
jochen (gone - plz use gerrit)
2015/04/13 13:07:02
my main concern is whether this will negatively im
Mike West
2015/04/21 12:46:23
That's a fair concern. I suppose we can drop this
| |
340 return false; | |
341 | |
327 if (a.httpMethod() != b.httpMethod()) | 342 if (a.httpMethod() != b.httpMethod()) |
328 return false; | 343 return false; |
329 | 344 |
330 if (a.allowStoredCredentials() != b.allowStoredCredentials()) | 345 if (a.allowStoredCredentials() != b.allowStoredCredentials()) |
331 return false; | 346 return false; |
332 | 347 |
333 if (a.priority() != b.priority()) | 348 if (a.priority() != b.priority()) |
334 return false; | 349 return false; |
335 | 350 |
336 if (a.referrerPolicy() != b.referrerPolicy()) | 351 if (a.referrerPolicy() != b.referrerPolicy()) |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
459 // This is used by the loader to control the number of issued parallel load requ ests. | 474 // This is used by the loader to control the number of issued parallel load requ ests. |
460 unsigned initializeMaximumHTTPConnectionCountPerHost() | 475 unsigned initializeMaximumHTTPConnectionCountPerHost() |
461 { | 476 { |
462 // The chromium network stack already handles limiting the number of | 477 // The chromium network stack already handles limiting the number of |
463 // parallel requests per host, so there's no need to do it here. Therefore, | 478 // parallel requests per host, so there's no need to do it here. Therefore, |
464 // this is set to a high value that should never be hit in practice. | 479 // this is set to a high value that should never be hit in practice. |
465 return 10000; | 480 return 10000; |
466 } | 481 } |
467 | 482 |
468 } // namespace blink | 483 } // namespace blink |
OLD | NEW |