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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 void ResourceRequest::setHTTPReferrer(const Referrer& referrer) | 217 void ResourceRequest::setHTTPReferrer(const Referrer& referrer) |
218 { | 218 { |
219 if (referrer.referrer.isEmpty()) | 219 if (referrer.referrer.isEmpty()) |
220 m_httpHeaderFields.remove("Referer"); | 220 m_httpHeaderFields.remove("Referer"); |
221 else | 221 else |
222 setHTTPHeaderField("Referer", referrer.referrer); | 222 setHTTPHeaderField("Referer", referrer.referrer); |
223 m_referrerPolicy = referrer.referrerPolicy; | 223 m_referrerPolicy = referrer.referrerPolicy; |
224 m_didSetHTTPReferrer = true; | 224 m_didSetHTTPReferrer = true; |
225 } | 225 } |
226 | 226 |
227 void ResourceRequest::clearHTTPAuthorization() | |
228 { | |
229 m_httpHeaderFields.remove("Authorization"); | |
230 } | |
231 | |
232 void ResourceRequest::clearHTTPReferrer() | 227 void ResourceRequest::clearHTTPReferrer() |
233 { | 228 { |
234 m_httpHeaderFields.remove("Referer"); | 229 m_httpHeaderFields.remove("Referer"); |
235 m_referrerPolicy = ReferrerPolicyDefault; | 230 m_referrerPolicy = ReferrerPolicyDefault; |
236 m_didSetHTTPReferrer = false; | 231 m_didSetHTTPReferrer = false; |
237 } | 232 } |
238 | 233 |
239 void ResourceRequest::clearHTTPOrigin() | 234 void ResourceRequest::clearHTTPOrigin() |
240 { | 235 { |
241 m_httpHeaderFields.remove("Origin"); | 236 m_httpHeaderFields.remove("Origin"); |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 return cacheControlHeader().containsNoStore; | 411 return cacheControlHeader().containsNoStore; |
417 } | 412 } |
418 | 413 |
419 bool ResourceRequest::hasCacheValidatorFields() const | 414 bool ResourceRequest::hasCacheValidatorFields() const |
420 { | 415 { |
421 DEFINE_STATIC_LOCAL(const AtomicString, lastModifiedHeader, ("last-modified"
, AtomicString::ConstructFromLiteral)); | 416 DEFINE_STATIC_LOCAL(const AtomicString, lastModifiedHeader, ("last-modified"
, AtomicString::ConstructFromLiteral)); |
422 DEFINE_STATIC_LOCAL(const AtomicString, eTagHeader, ("etag", AtomicString::C
onstructFromLiteral)); | 417 DEFINE_STATIC_LOCAL(const AtomicString, eTagHeader, ("etag", AtomicString::C
onstructFromLiteral)); |
423 return !m_httpHeaderFields.get(lastModifiedHeader).isEmpty() || !m_httpHeade
rFields.get(eTagHeader).isEmpty(); | 418 return !m_httpHeaderFields.get(lastModifiedHeader).isEmpty() || !m_httpHeade
rFields.get(eTagHeader).isEmpty(); |
424 } | 419 } |
425 | 420 |
426 double ResourceRequest::defaultTimeoutInterval() | |
427 { | |
428 return s_defaultTimeoutInterval; | |
429 } | |
430 | |
431 void ResourceRequest::setDefaultTimeoutInterval(double timeoutInterval) | |
432 { | |
433 s_defaultTimeoutInterval = timeoutInterval; | |
434 } | |
435 | |
436 void ResourceRequest::initialize(const KURL& url) | 421 void ResourceRequest::initialize(const KURL& url) |
437 { | 422 { |
438 m_url = url; | 423 m_url = url; |
439 m_cachePolicy = UseProtocolCachePolicy; | 424 m_cachePolicy = UseProtocolCachePolicy; |
440 m_timeoutInterval = s_defaultTimeoutInterval; | 425 m_timeoutInterval = s_defaultTimeoutInterval; |
441 m_httpMethod = "GET"; | 426 m_httpMethod = "GET"; |
442 m_allowStoredCredentials = true; | 427 m_allowStoredCredentials = true; |
443 m_reportUploadProgress = false; | 428 m_reportUploadProgress = false; |
444 m_reportRawHeaders = false; | 429 m_reportRawHeaders = false; |
445 m_hasUserGesture = false; | 430 m_hasUserGesture = false; |
(...skipping 15 matching lines...) Expand all Loading... |
461 m_fetchCredentialsMode = WebURLRequest::FetchCredentialsModeSameOrigin; | 446 m_fetchCredentialsMode = WebURLRequest::FetchCredentialsModeSameOrigin; |
462 m_referrerPolicy = ReferrerPolicyDefault; | 447 m_referrerPolicy = ReferrerPolicyDefault; |
463 m_didSetHTTPReferrer = false; | 448 m_didSetHTTPReferrer = false; |
464 m_checkForBrowserSideNavigation = true; | 449 m_checkForBrowserSideNavigation = true; |
465 m_uiStartTime = 0; | 450 m_uiStartTime = 0; |
466 m_originatesFromReservedIPRange = false; | 451 m_originatesFromReservedIPRange = false; |
467 m_inputPerfMetricReportPolicy = InputToLoadPerfMetricReportPolicy::NoReport; | 452 m_inputPerfMetricReportPolicy = InputToLoadPerfMetricReportPolicy::NoReport; |
468 m_followedRedirect = false; | 453 m_followedRedirect = false; |
469 } | 454 } |
470 | 455 |
471 // This is used by the loader to control the number of issued parallel load requ
ests. | |
472 unsigned initializeMaximumHTTPConnectionCountPerHost() | |
473 { | |
474 // The chromium network stack already handles limiting the number of | |
475 // parallel requests per host, so there's no need to do it here. Therefore, | |
476 // this is set to a high value that should never be hit in practice. | |
477 return 10000; | |
478 } | |
479 | |
480 } // namespace blink | 456 } // namespace blink |
OLD | NEW |