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

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

Issue 339593005: Set the target type when creating the request for main resource (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Made the setter method private Created 6 years, 6 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
« no previous file with comments | « Source/platform/exported/WebURLRequest.cpp ('k') | Source/platform/network/ResourceRequest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 ResourceRequest(const String& urlString) 86 ResourceRequest(const String& urlString)
87 { 87 {
88 initialize(KURL(ParsedURLString, urlString), UseProtocolCachePolicy); 88 initialize(KURL(ParsedURLString, urlString), UseProtocolCachePolicy);
89 } 89 }
90 90
91 ResourceRequest(const KURL& url) 91 ResourceRequest(const KURL& url)
92 { 92 {
93 initialize(url, UseProtocolCachePolicy); 93 initialize(url, UseProtocolCachePolicy);
94 } 94 }
95 95
96 ResourceRequest(const KURL& url, const Referrer& referrer, ResourceRequestCa chePolicy cachePolicy = UseProtocolCachePolicy) 96 ResourceRequest(const KURL& url, const Referrer& referrer, ResourceRequestCa chePolicy cachePolicy = UseProtocolCachePolicy)
Nate Chapin 2014/06/24 18:28:54 Is this constructor actually used for subresource
clamy 2014/06/25 15:47:11 You're right it is only used by main resources. I
97 { 97 {
98 initialize(url, cachePolicy); 98 initialize(url, cachePolicy);
99 setHTTPReferrer(referrer); 99 setHTTPReferrer(referrer);
100 } 100 }
101 101
102 // Factory methods that should be used when creating a ResourceRequest for a
103 // main resource.
104 static ResourceRequest createMainResourceRequest(const KURL&, bool isMainFra me);
Nate Chapin 2014/06/24 18:28:54 Why is it better to have these static factory meth
clamy 2014/06/25 15:47:11 I thought it was more explicit that they give you
105 static ResourceRequest createMainResourceRequest(
106 const KURL&, bool isMainFrame, const Referrer&, ResourceRequestCachePoli cy = UseProtocolCachePolicy);
107
102 static PassOwnPtr<ResourceRequest> adopt(PassOwnPtr<CrossThreadResourceReque stData>); 108 static PassOwnPtr<ResourceRequest> adopt(PassOwnPtr<CrossThreadResourceReque stData>);
103 109
104 // Gets a copy of the data suitable for passing to another thread. 110 // Gets a copy of the data suitable for passing to another thread.
105 PassOwnPtr<CrossThreadResourceRequestData> copyData() const; 111 PassOwnPtr<CrossThreadResourceRequestData> copyData() const;
106 112
107 bool isNull() const; 113 bool isNull() const;
108 bool isEmpty() const; 114 bool isEmpty() const;
109 115
110 const KURL& url() const; 116 const KURL& url() const;
111 void setURL(const KURL& url); 117 void setURL(const KURL& url);
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 bool hasCacheValidatorFields() const; 216 bool hasCacheValidatorFields() const;
211 217
212 static double defaultTimeoutInterval(); // May return 0 when using platform default. 218 static double defaultTimeoutInterval(); // May return 0 when using platform default.
213 static void setDefaultTimeoutInterval(double); 219 static void setDefaultTimeoutInterval(double);
214 220
215 static bool compare(const ResourceRequest&, const ResourceRequest&); 221 static bool compare(const ResourceRequest&, const ResourceRequest&);
216 222
217 private: 223 private:
218 void initialize(const KURL& url, ResourceRequestCachePolicy cachePolicy); 224 void initialize(const KURL& url, ResourceRequestCachePolicy cachePolicy);
219 225
226 void setTargetTypeForMainResource(bool isMainFrame);
227
220 const CacheControlHeader& cacheControlHeader() const; 228 const CacheControlHeader& cacheControlHeader() const;
221 229
222 KURL m_url; 230 KURL m_url;
223 ResourceRequestCachePolicy m_cachePolicy; 231 ResourceRequestCachePolicy m_cachePolicy;
224 double m_timeoutInterval; // 0 is a magic value for platform default on plat forms that have one. 232 double m_timeoutInterval; // 0 is a magic value for platform default on plat forms that have one.
225 KURL m_firstPartyForCookies; 233 KURL m_firstPartyForCookies;
226 AtomicString m_httpMethod; 234 AtomicString m_httpMethod;
227 HTTPHeaderMap m_httpHeaderFields; 235 HTTPHeaderMap m_httpHeaderFields;
228 RefPtr<FormData> m_httpBody; 236 RefPtr<FormData> m_httpBody;
229 bool m_allowStoredCredentials : 1; 237 bool m_allowStoredCredentials : 1;
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 int m_appCacheHostID; 282 int m_appCacheHostID;
275 ResourceRequest::TargetType m_targetType; 283 ResourceRequest::TargetType m_targetType;
276 ReferrerPolicy m_referrerPolicy; 284 ReferrerPolicy m_referrerPolicy;
277 }; 285 };
278 286
279 unsigned initializeMaximumHTTPConnectionCountPerHost(); 287 unsigned initializeMaximumHTTPConnectionCountPerHost();
280 288
281 } // namespace WebCore 289 } // namespace WebCore
282 290
283 #endif // ResourceRequest_h 291 #endif // ResourceRequest_h
OLDNEW
« no previous file with comments | « Source/platform/exported/WebURLRequest.cpp ('k') | Source/platform/network/ResourceRequest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698