OLD | NEW |
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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 request.clearHTTPReferrer(); | 74 request.clearHTTPReferrer(); |
75 else if (!request.httpReferrer()) | 75 else if (!request.httpReferrer()) |
76 request.setHTTPReferrer(Referrer(outgoingReferrer, document->referre
rPolicy())); | 76 request.setHTTPReferrer(Referrer(outgoingReferrer, document->referre
rPolicy())); |
77 | 77 |
78 FrameLoader::addHTTPOriginIfNeeded(request, AtomicString(outgoingOrigin)
); | 78 FrameLoader::addHTTPOriginIfNeeded(request, AtomicString(outgoingOrigin)
); |
79 } | 79 } |
80 | 80 |
81 if (isMainResource && m_frame->isMainFrame()) | 81 if (isMainResource && m_frame->isMainFrame()) |
82 request.setFirstPartyForCookies(request.url()); | 82 request.setFirstPartyForCookies(request.url()); |
83 else if (m_frame->tree().top()->isLocalFrame()) | 83 else if (m_frame->tree().top()->isLocalFrame()) |
84 request.setFirstPartyForCookies(m_frame->tree().top()->document()->first
PartyForCookies()); | 84 request.setFirstPartyForCookies(toLocalFrame(m_frame->tree().top())->doc
ument()->firstPartyForCookies()); |
85 | 85 |
86 // The remaining modifications are only necessary for HTTP and HTTPS. | 86 // The remaining modifications are only necessary for HTTP and HTTPS. |
87 if (!request.url().isEmpty() && !request.url().protocolIsInHTTPFamily()) | 87 if (!request.url().isEmpty() && !request.url().protocolIsInHTTPFamily()) |
88 return; | 88 return; |
89 | 89 |
90 m_frame->loader().applyUserAgent(request); | 90 m_frame->loader().applyUserAgent(request); |
91 | 91 |
92 // Default to sending an empty Origin header if one hasn't been set yet. | 92 // Default to sending an empty Origin header if one hasn't been set yet. |
93 FrameLoader::addHTTPOriginIfNeeded(request, nullAtom); | 93 FrameLoader::addHTTPOriginIfNeeded(request, nullAtom); |
94 } | 94 } |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 if (!response.isNull()) | 196 if (!response.isNull()) |
197 dispatchDidReceiveResponse(ensureLoader(loader), identifier, response); | 197 dispatchDidReceiveResponse(ensureLoader(loader), identifier, response); |
198 | 198 |
199 if (dataLength > 0) | 199 if (dataLength > 0) |
200 dispatchDidReceiveData(ensureLoader(loader), identifier, 0, dataLength,
0); | 200 dispatchDidReceiveData(ensureLoader(loader), identifier, 0, dataLength,
0); |
201 | 201 |
202 dispatchDidFinishLoading(ensureLoader(loader), identifier, 0, 0); | 202 dispatchDidFinishLoading(ensureLoader(loader), identifier, 0, 0); |
203 } | 203 } |
204 | 204 |
205 } // namespace WebCore | 205 } // namespace WebCore |
OLD | NEW |