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

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: Rebase 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
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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
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)
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);
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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 bool downloadToFile() const { return m_downloadToFile; } 203 bool downloadToFile() const { return m_downloadToFile; }
198 void setDownloadToFile(bool downloadToFile) { m_downloadToFile = downloadToF ile; } 204 void setDownloadToFile(bool downloadToFile) { m_downloadToFile = downloadToF ile; }
199 205
200 // Extra data associated with this request. 206 // Extra data associated with this request.
201 ExtraData* extraData() const { return m_extraData.get(); } 207 ExtraData* extraData() const { return m_extraData.get(); }
202 void setExtraData(PassRefPtr<ExtraData> extraData) { m_extraData = extraData ; } 208 void setExtraData(PassRefPtr<ExtraData> extraData) { m_extraData = extraData ; }
203 209
204 // What this request is for. 210 // What this request is for.
205 TargetType targetType() const { return m_targetType; } 211 TargetType targetType() const { return m_targetType; }
206 void setTargetType(TargetType type) { m_targetType = type; } 212 void setTargetType(TargetType type) { m_targetType = type; }
213 void setTargetTypeForMainResource(bool isMainFrame);
ppi 2014/06/24 12:22:21 Do we still need this in public: ?
clamy 2014/06/24 13:57:07 Done.
207 214
208 bool cacheControlContainsNoCache() const; 215 bool cacheControlContainsNoCache() const;
209 bool cacheControlContainsNoStore() const; 216 bool cacheControlContainsNoStore() const;
210 bool hasCacheValidatorFields() const; 217 bool hasCacheValidatorFields() const;
211 218
212 static double defaultTimeoutInterval(); // May return 0 when using platform default. 219 static double defaultTimeoutInterval(); // May return 0 when using platform default.
213 static void setDefaultTimeoutInterval(double); 220 static void setDefaultTimeoutInterval(double);
214 221
215 static bool compare(const ResourceRequest&, const ResourceRequest&); 222 static bool compare(const ResourceRequest&, const ResourceRequest&);
216 223
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 int m_appCacheHostID; 281 int m_appCacheHostID;
275 ResourceRequest::TargetType m_targetType; 282 ResourceRequest::TargetType m_targetType;
276 ReferrerPolicy m_referrerPolicy; 283 ReferrerPolicy m_referrerPolicy;
277 }; 284 };
278 285
279 unsigned initializeMaximumHTTPConnectionCountPerHost(); 286 unsigned initializeMaximumHTTPConnectionCountPerHost();
280 287
281 } // namespace WebCore 288 } // namespace WebCore
282 289
283 #endif // ResourceRequest_h 290 #endif // ResourceRequest_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698