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

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: Switched to constructors Created 6 years, 5 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 // This constructor should only be used for main resources ResourceRequests.
97 ResourceRequest(const KURL& url, bool isMainFrame)
98 {
99 initialize(url, UseProtocolCachePolicy);
100 setTargetTypeForMainResource(isMainFrame);
101 }
102
103 // This constructor should only be used for main resources ResourceRequests.
104 ResourceRequest(const KURL& url, bool isMainFrame, const Referrer& referrer, ResourceRequestCachePolicy cachePolicy = UseProtocolCachePolicy)
97 { 105 {
98 initialize(url, cachePolicy); 106 initialize(url, cachePolicy);
99 setHTTPReferrer(referrer); 107 setHTTPReferrer(referrer);
108 setTargetTypeForMainResource(isMainFrame);
100 } 109 }
101 110
102 static PassOwnPtr<ResourceRequest> adopt(PassOwnPtr<CrossThreadResourceReque stData>); 111 static PassOwnPtr<ResourceRequest> adopt(PassOwnPtr<CrossThreadResourceReque stData>);
103 112
104 // Gets a copy of the data suitable for passing to another thread. 113 // Gets a copy of the data suitable for passing to another thread.
105 PassOwnPtr<CrossThreadResourceRequestData> copyData() const; 114 PassOwnPtr<CrossThreadResourceRequestData> copyData() const;
106 115
107 bool isNull() const; 116 bool isNull() const;
108 bool isEmpty() const; 117 bool isEmpty() const;
109 118
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 bool hasCacheValidatorFields() const; 219 bool hasCacheValidatorFields() const;
211 220
212 static double defaultTimeoutInterval(); // May return 0 when using platform default. 221 static double defaultTimeoutInterval(); // May return 0 when using platform default.
213 static void setDefaultTimeoutInterval(double); 222 static void setDefaultTimeoutInterval(double);
214 223
215 static bool compare(const ResourceRequest&, const ResourceRequest&); 224 static bool compare(const ResourceRequest&, const ResourceRequest&);
216 225
217 private: 226 private:
218 void initialize(const KURL& url, ResourceRequestCachePolicy cachePolicy); 227 void initialize(const KURL& url, ResourceRequestCachePolicy cachePolicy);
219 228
229 void setTargetTypeForMainResource(bool isMainFrame);
230
220 const CacheControlHeader& cacheControlHeader() const; 231 const CacheControlHeader& cacheControlHeader() const;
221 232
222 KURL m_url; 233 KURL m_url;
223 ResourceRequestCachePolicy m_cachePolicy; 234 ResourceRequestCachePolicy m_cachePolicy;
224 double m_timeoutInterval; // 0 is a magic value for platform default on plat forms that have one. 235 double m_timeoutInterval; // 0 is a magic value for platform default on plat forms that have one.
225 KURL m_firstPartyForCookies; 236 KURL m_firstPartyForCookies;
226 AtomicString m_httpMethod; 237 AtomicString m_httpMethod;
227 HTTPHeaderMap m_httpHeaderFields; 238 HTTPHeaderMap m_httpHeaderFields;
228 RefPtr<FormData> m_httpBody; 239 RefPtr<FormData> m_httpBody;
229 bool m_allowStoredCredentials : 1; 240 bool m_allowStoredCredentials : 1;
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 int m_appCacheHostID; 285 int m_appCacheHostID;
275 ResourceRequest::TargetType m_targetType; 286 ResourceRequest::TargetType m_targetType;
276 ReferrerPolicy m_referrerPolicy; 287 ReferrerPolicy m_referrerPolicy;
277 }; 288 };
278 289
279 unsigned initializeMaximumHTTPConnectionCountPerHost(); 290 unsigned initializeMaximumHTTPConnectionCountPerHost();
280 291
281 } // namespace WebCore 292 } // namespace WebCore
282 293
283 #endif // ResourceRequest_h 294 #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