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 13 matching lines...) Expand all Loading... |
24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
25 */ | 25 */ |
26 | 26 |
27 #include "platform/network/ResourceRequest.h" | 27 #include "platform/network/ResourceRequest.h" |
28 | 28 |
29 #include "platform/HTTPNames.h" | 29 #include "platform/HTTPNames.h" |
30 #include "platform/RuntimeEnabledFeatures.h" | 30 #include "platform/RuntimeEnabledFeatures.h" |
31 #include "platform/weborigin/SecurityOrigin.h" | 31 #include "platform/weborigin/SecurityOrigin.h" |
32 #include "public/platform/Platform.h" | 32 #include "public/platform/Platform.h" |
33 #include "public/platform/WebAddressSpace.h" | 33 #include "public/platform/WebAddressSpace.h" |
| 34 #include "public/platform/WebCachePolicy.h" |
34 #include "public/platform/WebURLRequest.h" | 35 #include "public/platform/WebURLRequest.h" |
35 | 36 |
36 namespace blink { | 37 namespace blink { |
37 | 38 |
38 double ResourceRequest::s_defaultTimeoutInterval = INT_MAX; | 39 double ResourceRequest::s_defaultTimeoutInterval = INT_MAX; |
39 | 40 |
40 ResourceRequest::ResourceRequest(CrossThreadResourceRequestData* data) | 41 ResourceRequest::ResourceRequest(CrossThreadResourceRequestData* data) |
41 : ResourceRequest() | 42 : ResourceRequest() |
42 { | 43 { |
43 setURL(data->m_url); | 44 setURL(data->m_url); |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 | 143 |
143 void ResourceRequest::removeCredentials() | 144 void ResourceRequest::removeCredentials() |
144 { | 145 { |
145 if (m_url.user().isEmpty() && m_url.pass().isEmpty()) | 146 if (m_url.user().isEmpty() && m_url.pass().isEmpty()) |
146 return; | 147 return; |
147 | 148 |
148 m_url.setUser(String()); | 149 m_url.setUser(String()); |
149 m_url.setPass(String()); | 150 m_url.setPass(String()); |
150 } | 151 } |
151 | 152 |
152 ResourceRequestCachePolicy ResourceRequest::getCachePolicy() const | 153 WebCachePolicy ResourceRequest::getCachePolicy() const |
153 { | 154 { |
154 return m_cachePolicy; | 155 return m_cachePolicy; |
155 } | 156 } |
156 | 157 |
157 void ResourceRequest::setCachePolicy(ResourceRequestCachePolicy cachePolicy) | 158 void ResourceRequest::setCachePolicy(WebCachePolicy cachePolicy) |
158 { | 159 { |
159 m_cachePolicy = cachePolicy; | 160 m_cachePolicy = cachePolicy; |
160 } | 161 } |
161 | 162 |
162 double ResourceRequest::timeoutInterval() const | 163 double ResourceRequest::timeoutInterval() const |
163 { | 164 { |
164 return m_timeoutInterval; | 165 return m_timeoutInterval; |
165 } | 166 } |
166 | 167 |
167 void ResourceRequest::setTimeoutInterval(double timeoutInterval) | 168 void ResourceRequest::setTimeoutInterval(double timeoutInterval) |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 } | 391 } |
391 | 392 |
392 bool ResourceRequest::hasCacheValidatorFields() const | 393 bool ResourceRequest::hasCacheValidatorFields() const |
393 { | 394 { |
394 return !m_httpHeaderFields.get(HTTPNames::Last_Modified).isEmpty() || !m_htt
pHeaderFields.get(HTTPNames::ETag).isEmpty(); | 395 return !m_httpHeaderFields.get(HTTPNames::Last_Modified).isEmpty() || !m_htt
pHeaderFields.get(HTTPNames::ETag).isEmpty(); |
395 } | 396 } |
396 | 397 |
397 void ResourceRequest::initialize(const KURL& url) | 398 void ResourceRequest::initialize(const KURL& url) |
398 { | 399 { |
399 m_url = url; | 400 m_url = url; |
400 m_cachePolicy = UseProtocolCachePolicy; | 401 m_cachePolicy = WebCachePolicy::UseProtocolCachePolicy; |
401 m_timeoutInterval = s_defaultTimeoutInterval; | 402 m_timeoutInterval = s_defaultTimeoutInterval; |
402 m_httpMethod = HTTPNames::GET; | 403 m_httpMethod = HTTPNames::GET; |
403 m_allowStoredCredentials = true; | 404 m_allowStoredCredentials = true; |
404 m_reportUploadProgress = false; | 405 m_reportUploadProgress = false; |
405 m_reportRawHeaders = false; | 406 m_reportRawHeaders = false; |
406 m_hasUserGesture = false; | 407 m_hasUserGesture = false; |
407 m_downloadToFile = false; | 408 m_downloadToFile = false; |
408 m_useStreamOnResponse = false; | 409 m_useStreamOnResponse = false; |
409 m_skipServiceWorker = false; | 410 m_skipServiceWorker = false; |
410 m_shouldResetAppCache = false; | 411 m_shouldResetAppCache = false; |
(...skipping 12 matching lines...) Expand all Loading... |
423 m_didSetHTTPReferrer = false; | 424 m_didSetHTTPReferrer = false; |
424 m_checkForBrowserSideNavigation = true; | 425 m_checkForBrowserSideNavigation = true; |
425 m_uiStartTime = 0; | 426 m_uiStartTime = 0; |
426 m_isExternalRequest = false; | 427 m_isExternalRequest = false; |
427 m_inputPerfMetricReportPolicy = InputToLoadPerfMetricReportPolicy::NoReport; | 428 m_inputPerfMetricReportPolicy = InputToLoadPerfMetricReportPolicy::NoReport; |
428 m_followedRedirect = false; | 429 m_followedRedirect = false; |
429 m_requestorOrigin = SecurityOrigin::createUnique(); | 430 m_requestorOrigin = SecurityOrigin::createUnique(); |
430 } | 431 } |
431 | 432 |
432 } // namespace blink | 433 } // namespace blink |
OLD | NEW |