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

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

Issue 2254693002: Delay generation of User-Agent header to URLRequestHttpJob and accept custom User-Agent from XHR/Fe… Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changed Android test Created 4 years, 4 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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 void clearHTTPReferrer(); 123 void clearHTTPReferrer();
124 124
125 const AtomicString& httpOrigin() const { return httpHeaderField(HTTPNames::O rigin); } 125 const AtomicString& httpOrigin() const { return httpHeaderField(HTTPNames::O rigin); }
126 const AtomicString& httpSuborigin() const { return httpHeaderField(HTTPNames ::Suborigin); } 126 const AtomicString& httpSuborigin() const { return httpHeaderField(HTTPNames ::Suborigin); }
127 // Note that these will also set and clear, respectively, the 127 // Note that these will also set and clear, respectively, the
128 // Suborigin header, if appropriate. 128 // Suborigin header, if appropriate.
129 void setHTTPOrigin(PassRefPtr<SecurityOrigin>); 129 void setHTTPOrigin(PassRefPtr<SecurityOrigin>);
130 void clearHTTPOrigin(); 130 void clearHTTPOrigin();
131 void addHTTPOriginIfNeeded(PassRefPtr<SecurityOrigin>); 131 void addHTTPOriginIfNeeded(PassRefPtr<SecurityOrigin>);
132 132
133 const AtomicString& httpUserAgent() const { return httpHeaderField(HTTPNames ::User_Agent); }
134 void setHTTPUserAgent(const AtomicString& httpUserAgent) { setHTTPHeaderFiel d(HTTPNames::User_Agent, httpUserAgent); }
135 void clearHTTPUserAgent(); 133 void clearHTTPUserAgent();
136 134
135 const AtomicString& defaultHTTPUserAgent() const { return m_defaultHTTPUserA gent; }
136 void setDefaultHTTPUserAgent(const AtomicString& defaultHTTPUserAgent) { m_d efaultHTTPUserAgent = defaultHTTPUserAgent; }
137
137 void setHTTPAccept(const AtomicString& httpAccept) { setHTTPHeaderField(HTTP Names::Accept, httpAccept); } 138 void setHTTPAccept(const AtomicString& httpAccept) { setHTTPHeaderField(HTTP Names::Accept, httpAccept); }
138 139
139 EncodedFormData* httpBody() const; 140 EncodedFormData* httpBody() const;
140 void setHTTPBody(PassRefPtr<EncodedFormData>); 141 void setHTTPBody(PassRefPtr<EncodedFormData>);
141 142
142 EncodedFormData* attachedCredential() const; 143 EncodedFormData* attachedCredential() const;
143 void setAttachedCredential(PassRefPtr<EncodedFormData>); 144 void setAttachedCredential(PassRefPtr<EncodedFormData>);
144 145
145 bool allowStoredCredentials() const; 146 bool allowStoredCredentials() const;
146 void setAllowStoredCredentials(bool allowCredentials); 147 void setAllowStoredCredentials(bool allowCredentials);
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 243
243 const CacheControlHeader& cacheControlHeader() const; 244 const CacheControlHeader& cacheControlHeader() const;
244 245
245 KURL m_url; 246 KURL m_url;
246 WebCachePolicy m_cachePolicy; 247 WebCachePolicy m_cachePolicy;
247 double m_timeoutInterval; // 0 is a magic value for platform default on plat forms that have one. 248 double m_timeoutInterval; // 0 is a magic value for platform default on plat forms that have one.
248 KURL m_firstPartyForCookies; 249 KURL m_firstPartyForCookies;
249 RefPtr<SecurityOrigin> m_requestorOrigin; 250 RefPtr<SecurityOrigin> m_requestorOrigin;
250 AtomicString m_httpMethod; 251 AtomicString m_httpMethod;
251 HTTPHeaderMap m_httpHeaderFields; 252 HTTPHeaderMap m_httpHeaderFields;
253 AtomicString m_defaultHTTPUserAgent;
252 RefPtr<EncodedFormData> m_httpBody; 254 RefPtr<EncodedFormData> m_httpBody;
253 RefPtr<EncodedFormData> m_attachedCredential; 255 RefPtr<EncodedFormData> m_attachedCredential;
254 bool m_allowStoredCredentials : 1; 256 bool m_allowStoredCredentials : 1;
255 bool m_reportUploadProgress : 1; 257 bool m_reportUploadProgress : 1;
256 bool m_reportRawHeaders : 1; 258 bool m_reportRawHeaders : 1;
257 bool m_hasUserGesture : 1; 259 bool m_hasUserGesture : 1;
258 bool m_downloadToFile : 1; 260 bool m_downloadToFile : 1;
259 bool m_useStreamOnResponse : 1; 261 bool m_useStreamOnResponse : 1;
260 bool m_shouldResetAppCache : 1; 262 bool m_shouldResetAppCache : 1;
261 WebURLRequest::SkipServiceWorker m_skipServiceWorker; 263 WebURLRequest::SkipServiceWorker m_skipServiceWorker;
(...skipping 29 matching lines...) Expand all
291 CrossThreadResourceRequestData() { } 293 CrossThreadResourceRequestData() { }
292 KURL m_url; 294 KURL m_url;
293 295
294 WebCachePolicy m_cachePolicy; 296 WebCachePolicy m_cachePolicy;
295 double m_timeoutInterval; 297 double m_timeoutInterval;
296 KURL m_firstPartyForCookies; 298 KURL m_firstPartyForCookies;
297 RefPtr<SecurityOrigin> m_requestorOrigin; 299 RefPtr<SecurityOrigin> m_requestorOrigin;
298 300
299 String m_httpMethod; 301 String m_httpMethod;
300 std::unique_ptr<CrossThreadHTTPHeaderMapData> m_httpHeaders; 302 std::unique_ptr<CrossThreadHTTPHeaderMapData> m_httpHeaders;
303 String m_defaultHTTPUserAgent;
301 RefPtr<EncodedFormData> m_httpBody; 304 RefPtr<EncodedFormData> m_httpBody;
302 RefPtr<EncodedFormData> m_attachedCredential; 305 RefPtr<EncodedFormData> m_attachedCredential;
303 bool m_allowStoredCredentials; 306 bool m_allowStoredCredentials;
304 bool m_reportUploadProgress; 307 bool m_reportUploadProgress;
305 bool m_hasUserGesture; 308 bool m_hasUserGesture;
306 bool m_downloadToFile; 309 bool m_downloadToFile;
307 WebURLRequest::SkipServiceWorker m_skipServiceWorker; 310 WebURLRequest::SkipServiceWorker m_skipServiceWorker;
308 bool m_useStreamOnResponse; 311 bool m_useStreamOnResponse;
309 bool m_shouldResetAppCache; 312 bool m_shouldResetAppCache;
310 ResourceLoadPriority m_priority; 313 ResourceLoadPriority m_priority;
(...skipping 12 matching lines...) Expand all
323 bool m_checkForBrowserSideNavigation; 326 bool m_checkForBrowserSideNavigation;
324 double m_uiStartTime; 327 double m_uiStartTime;
325 bool m_isExternalRequest; 328 bool m_isExternalRequest;
326 InputToLoadPerfMetricReportPolicy m_inputPerfMetricReportPolicy; 329 InputToLoadPerfMetricReportPolicy m_inputPerfMetricReportPolicy;
327 ResourceRequest::RedirectStatus m_redirectStatus; 330 ResourceRequest::RedirectStatus m_redirectStatus;
328 }; 331 };
329 332
330 } // namespace blink 333 } // namespace blink
331 334
332 #endif // ResourceRequest_h 335 #endif // ResourceRequest_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698