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

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

Issue 1858533002: Introduce WebCachePolicy to merge cache policy enums (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: hiroshige review 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) 2006 Samuel Weinig <sam.weinig@gmail.com> 3 * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
4 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. 4 * Copyright (C) 2009, 2012 Google Inc. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 24 matching lines...) Expand all
35 #include "platform/network/ResourceLoadPriority.h" 35 #include "platform/network/ResourceLoadPriority.h"
36 #include "platform/weborigin/KURL.h" 36 #include "platform/weborigin/KURL.h"
37 #include "platform/weborigin/Referrer.h" 37 #include "platform/weborigin/Referrer.h"
38 #include "platform/weborigin/SecurityOrigin.h" 38 #include "platform/weborigin/SecurityOrigin.h"
39 #include "public/platform/WebAddressSpace.h" 39 #include "public/platform/WebAddressSpace.h"
40 #include "public/platform/WebURLRequest.h" 40 #include "public/platform/WebURLRequest.h"
41 #include "wtf/OwnPtr.h" 41 #include "wtf/OwnPtr.h"
42 42
43 namespace blink { 43 namespace blink {
44 44
45 // Should be same with WebURLRequest::CachePolicy. 45 enum class WebCachePolicy;
46 // TODO(crbug.com/599364): Merge this with WebURLRequest::CachePolicy
47 enum ResourceRequestCachePolicy {
48 UseProtocolCachePolicy, // normal load
49 ValidatingCacheData, // reload
50 BypassingCache, // end-to-end reload
51 ReturnCacheDataElseLoad, // back/forward or encoding change - allow stale da ta
52 ReturnCacheDataDontLoad, // results of a post - allow stale data and only us e cache
53 };
54 46
55 enum ResourceRequestBlockedReason { 47 enum ResourceRequestBlockedReason {
56 ResourceRequestBlockedReasonCSP, 48 ResourceRequestBlockedReasonCSP,
57 ResourceRequestBlockedReasonMixedContent, 49 ResourceRequestBlockedReasonMixedContent,
58 ResourceRequestBlockedReasonOrigin, 50 ResourceRequestBlockedReasonOrigin,
59 ResourceRequestBlockedReasonInspector, 51 ResourceRequestBlockedReasonInspector,
60 ResourceRequestBlockedReasonOther, 52 ResourceRequestBlockedReasonOther,
61 ResourceRequestBlockedReasonNone 53 ResourceRequestBlockedReasonNone
62 }; 54 };
63 55
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 PassOwnPtr<CrossThreadResourceRequestData> copyData() const; 90 PassOwnPtr<CrossThreadResourceRequestData> copyData() const;
99 91
100 bool isNull() const; 92 bool isNull() const;
101 bool isEmpty() const; 93 bool isEmpty() const;
102 94
103 const KURL& url() const; 95 const KURL& url() const;
104 void setURL(const KURL& url); 96 void setURL(const KURL& url);
105 97
106 void removeCredentials(); 98 void removeCredentials();
107 99
108 ResourceRequestCachePolicy getCachePolicy() const; 100 WebCachePolicy getCachePolicy() const;
109 void setCachePolicy(ResourceRequestCachePolicy cachePolicy); 101 void setCachePolicy(WebCachePolicy);
110 102
111 double timeoutInterval() const; // May return 0 when using platform default. 103 double timeoutInterval() const; // May return 0 when using platform default.
112 void setTimeoutInterval(double timeoutInterval); 104 void setTimeoutInterval(double timeoutInterval);
113 105
114 const KURL& firstPartyForCookies() const; 106 const KURL& firstPartyForCookies() const;
115 void setFirstPartyForCookies(const KURL& firstPartyForCookies); 107 void setFirstPartyForCookies(const KURL& firstPartyForCookies);
116 108
117 PassRefPtr<SecurityOrigin> requestorOrigin() const; 109 PassRefPtr<SecurityOrigin> requestorOrigin() const;
118 void setRequestorOrigin(PassRefPtr<SecurityOrigin>); 110 void setRequestorOrigin(PassRefPtr<SecurityOrigin>);
119 111
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 242
251 void setFollowedRedirect(bool followed) { m_followedRedirect = followed; } 243 void setFollowedRedirect(bool followed) { m_followedRedirect = followed; }
252 bool followedRedirect() const { return m_followedRedirect; } 244 bool followedRedirect() const { return m_followedRedirect; }
253 245
254 private: 246 private:
255 void initialize(const KURL&); 247 void initialize(const KURL&);
256 248
257 const CacheControlHeader& cacheControlHeader() const; 249 const CacheControlHeader& cacheControlHeader() const;
258 250
259 KURL m_url; 251 KURL m_url;
260 ResourceRequestCachePolicy m_cachePolicy; 252 WebCachePolicy m_cachePolicy;
261 double m_timeoutInterval; // 0 is a magic value for platform default on plat forms that have one. 253 double m_timeoutInterval; // 0 is a magic value for platform default on plat forms that have one.
262 KURL m_firstPartyForCookies; 254 KURL m_firstPartyForCookies;
263 RefPtr<SecurityOrigin> m_requestorOrigin; 255 RefPtr<SecurityOrigin> m_requestorOrigin;
264 AtomicString m_httpMethod; 256 AtomicString m_httpMethod;
265 HTTPHeaderMap m_httpHeaderFields; 257 HTTPHeaderMap m_httpHeaderFields;
266 RefPtr<EncodedFormData> m_httpBody; 258 RefPtr<EncodedFormData> m_httpBody;
267 RefPtr<EncodedFormData> m_attachedCredential; 259 RefPtr<EncodedFormData> m_attachedCredential;
268 bool m_allowStoredCredentials : 1; 260 bool m_allowStoredCredentials : 1;
269 bool m_reportUploadProgress : 1; 261 bool m_reportUploadProgress : 1;
270 bool m_reportRawHeaders : 1; 262 bool m_reportRawHeaders : 1;
(...skipping 27 matching lines...) Expand all
298 290
299 bool m_followedRedirect; 291 bool m_followedRedirect;
300 }; 292 };
301 293
302 struct CrossThreadResourceRequestData { 294 struct CrossThreadResourceRequestData {
303 WTF_MAKE_NONCOPYABLE(CrossThreadResourceRequestData); USING_FAST_MALLOC(Cros sThreadResourceRequestData); 295 WTF_MAKE_NONCOPYABLE(CrossThreadResourceRequestData); USING_FAST_MALLOC(Cros sThreadResourceRequestData);
304 public: 296 public:
305 CrossThreadResourceRequestData() { } 297 CrossThreadResourceRequestData() { }
306 KURL m_url; 298 KURL m_url;
307 299
308 ResourceRequestCachePolicy m_cachePolicy; 300 WebCachePolicy m_cachePolicy;
309 double m_timeoutInterval; 301 double m_timeoutInterval;
310 KURL m_firstPartyForCookies; 302 KURL m_firstPartyForCookies;
311 RefPtr<SecurityOrigin> m_requestorOrigin; 303 RefPtr<SecurityOrigin> m_requestorOrigin;
312 304
313 String m_httpMethod; 305 String m_httpMethod;
314 OwnPtr<CrossThreadHTTPHeaderMapData> m_httpHeaders; 306 OwnPtr<CrossThreadHTTPHeaderMapData> m_httpHeaders;
315 RefPtr<EncodedFormData> m_httpBody; 307 RefPtr<EncodedFormData> m_httpBody;
316 RefPtr<EncodedFormData> m_attachedCredential; 308 RefPtr<EncodedFormData> m_attachedCredential;
317 bool m_allowStoredCredentials; 309 bool m_allowStoredCredentials;
318 bool m_reportUploadProgress; 310 bool m_reportUploadProgress;
(...skipping 18 matching lines...) Expand all
337 bool m_checkForBrowserSideNavigation; 329 bool m_checkForBrowserSideNavigation;
338 double m_uiStartTime; 330 double m_uiStartTime;
339 bool m_isExternalRequest; 331 bool m_isExternalRequest;
340 InputToLoadPerfMetricReportPolicy m_inputPerfMetricReportPolicy; 332 InputToLoadPerfMetricReportPolicy m_inputPerfMetricReportPolicy;
341 bool m_followedRedirect; 333 bool m_followedRedirect;
342 }; 334 };
343 335
344 } // namespace blink 336 } // namespace blink
345 337
346 #endif // ResourceRequest_h 338 #endif // ResourceRequest_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698