Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(27)

Side by Side Diff: third_party/WebKit/Source/platform/network/ResourceRequest.cpp

Issue 1858533002: Introduce WebCachePolicy to merge cache policy enums (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: self review, minor fixes Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 140
140 void ResourceRequest::removeCredentials() 141 void ResourceRequest::removeCredentials()
141 { 142 {
142 if (m_url.user().isEmpty() && m_url.pass().isEmpty()) 143 if (m_url.user().isEmpty() && m_url.pass().isEmpty())
143 return; 144 return;
144 145
145 m_url.setUser(String()); 146 m_url.setUser(String());
146 m_url.setPass(String()); 147 m_url.setPass(String());
147 } 148 }
148 149
149 ResourceRequestCachePolicy ResourceRequest::getCachePolicy() const 150 WebCachePolicy ResourceRequest::getCachePolicy() const
150 { 151 {
151 return m_cachePolicy; 152 return m_cachePolicy;
152 } 153 }
153 154
154 void ResourceRequest::setCachePolicy(ResourceRequestCachePolicy cachePolicy) 155 void ResourceRequest::setCachePolicy(WebCachePolicy cachePolicy)
155 { 156 {
156 m_cachePolicy = cachePolicy; 157 m_cachePolicy = cachePolicy;
157 } 158 }
158 159
159 double ResourceRequest::timeoutInterval() const 160 double ResourceRequest::timeoutInterval() const
160 { 161 {
161 return m_timeoutInterval; 162 return m_timeoutInterval;
162 } 163 }
163 164
164 void ResourceRequest::setTimeoutInterval(double timeoutInterval) 165 void ResourceRequest::setTimeoutInterval(double timeoutInterval)
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 } 421 }
421 422
422 bool ResourceRequest::hasCacheValidatorFields() const 423 bool ResourceRequest::hasCacheValidatorFields() const
423 { 424 {
424 return !m_httpHeaderFields.get(HTTPNames::Last_Modified).isEmpty() || !m_htt pHeaderFields.get(HTTPNames::ETag).isEmpty(); 425 return !m_httpHeaderFields.get(HTTPNames::Last_Modified).isEmpty() || !m_htt pHeaderFields.get(HTTPNames::ETag).isEmpty();
425 } 426 }
426 427
427 void ResourceRequest::initialize(const KURL& url) 428 void ResourceRequest::initialize(const KURL& url)
428 { 429 {
429 m_url = url; 430 m_url = url;
430 m_cachePolicy = UseProtocolCachePolicy; 431 m_cachePolicy = WebCachePolicy::UseProtocolCachePolicy;
431 m_timeoutInterval = s_defaultTimeoutInterval; 432 m_timeoutInterval = s_defaultTimeoutInterval;
432 m_httpMethod = HTTPNames::GET; 433 m_httpMethod = HTTPNames::GET;
433 m_allowStoredCredentials = true; 434 m_allowStoredCredentials = true;
434 m_reportUploadProgress = false; 435 m_reportUploadProgress = false;
435 m_reportRawHeaders = false; 436 m_reportRawHeaders = false;
436 m_hasUserGesture = false; 437 m_hasUserGesture = false;
437 m_downloadToFile = false; 438 m_downloadToFile = false;
438 m_useStreamOnResponse = false; 439 m_useStreamOnResponse = false;
439 m_skipServiceWorker = false; 440 m_skipServiceWorker = false;
440 m_shouldResetAppCache = false; 441 m_shouldResetAppCache = false;
(...skipping 12 matching lines...) Expand all
453 m_didSetHTTPReferrer = false; 454 m_didSetHTTPReferrer = false;
454 m_checkForBrowserSideNavigation = true; 455 m_checkForBrowserSideNavigation = true;
455 m_uiStartTime = 0; 456 m_uiStartTime = 0;
456 m_isExternalRequest = false; 457 m_isExternalRequest = false;
457 m_inputPerfMetricReportPolicy = InputToLoadPerfMetricReportPolicy::NoReport; 458 m_inputPerfMetricReportPolicy = InputToLoadPerfMetricReportPolicy::NoReport;
458 m_followedRedirect = false; 459 m_followedRedirect = false;
459 m_requestorOrigin = SecurityOrigin::createUnique(); 460 m_requestorOrigin = SecurityOrigin::createUnique();
460 } 461 }
461 462
462 } // namespace blink 463 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698