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

Side by Side Diff: Source/core/loader/FrameFetchContext.cpp

Issue 357023002: Remove setting an empty origin header in FrameFetchContext (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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 | « no previous file | no next file » | 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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 request.setHTTPReferrer(Referrer(outgoingReferrer, document->referre rPolicy())); 76 request.setHTTPReferrer(Referrer(outgoingReferrer, document->referre rPolicy()));
77 77
78 request.addHTTPOriginIfNeeded(AtomicString(outgoingOrigin)); 78 request.addHTTPOriginIfNeeded(AtomicString(outgoingOrigin));
79 } 79 }
80 80
81 // The remaining modifications are only necessary for HTTP and HTTPS. 81 // The remaining modifications are only necessary for HTTP and HTTPS.
82 if (!request.url().isEmpty() && !request.url().protocolIsInHTTPFamily()) 82 if (!request.url().isEmpty() && !request.url().protocolIsInHTTPFamily())
83 return; 83 return;
84 84
85 m_frame->loader().applyUserAgent(request); 85 m_frame->loader().applyUserAgent(request);
86
87 // Default to sending an empty Origin header if one hasn't been set yet.
88 request.addHTTPOriginIfNeeded(nullAtom);
89 } 86 }
90 87
91 void FrameFetchContext::setFirstPartyForCookies(ResourceRequest& request) 88 void FrameFetchContext::setFirstPartyForCookies(ResourceRequest& request)
92 { 89 {
93 if (m_frame->tree().top()->isLocalFrame()) 90 if (m_frame->tree().top()->isLocalFrame())
94 request.setFirstPartyForCookies(toLocalFrame(m_frame->tree().top())->doc ument()->firstPartyForCookies()); 91 request.setFirstPartyForCookies(toLocalFrame(m_frame->tree().top())->doc ument()->firstPartyForCookies());
95 } 92 }
96 93
97 CachePolicy FrameFetchContext::cachePolicy(Document* document) const 94 CachePolicy FrameFetchContext::cachePolicy(Document* document) const
98 { 95 {
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 if (!response.isNull()) 194 if (!response.isNull())
198 dispatchDidReceiveResponse(ensureLoader(loader), identifier, response); 195 dispatchDidReceiveResponse(ensureLoader(loader), identifier, response);
199 196
200 if (dataLength > 0) 197 if (dataLength > 0)
201 dispatchDidReceiveData(ensureLoader(loader), identifier, 0, dataLength, 0); 198 dispatchDidReceiveData(ensureLoader(loader), identifier, 0, dataLength, 0);
202 199
203 dispatchDidFinishLoading(ensureLoader(loader), identifier, 0, 0); 200 dispatchDidFinishLoading(ensureLoader(loader), identifier, 0, 0);
204 } 201 }
205 202
206 } // namespace WebCore 203 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698