| 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 void FrameFetchContext::addAdditionalRequestHeaders(ResourceRequest& request, Fe
tchResourceType type) | 98 void FrameFetchContext::addAdditionalRequestHeaders(ResourceRequest& request, Fe
tchResourceType type) |
| 99 { | 99 { |
| 100 bool isMainResource = type == FetchMainResource; | 100 bool isMainResource = type == FetchMainResource; |
| 101 if (!isMainResource) { | 101 if (!isMainResource) { |
| 102 RefPtr<SecurityOrigin> outgoingOrigin; | 102 RefPtr<SecurityOrigin> outgoingOrigin; |
| 103 if (!request.didSetHTTPReferrer()) { | 103 if (!request.didSetHTTPReferrer()) { |
| 104 ASSERT(m_document); | 104 ASSERT(m_document); |
| 105 outgoingOrigin = m_document->securityOrigin(); | 105 outgoingOrigin = m_document->securityOrigin(); |
| 106 request.setHTTPReferrer(SecurityPolicy::generateReferrer(m_document-
>getReferrerPolicy(), request.url(), m_document->outgoingReferrer())); | 106 request.setHTTPReferrer(SecurityPolicy::generateReferrer(m_document-
>getReferrerPolicy(), request.url(), m_document->outgoingReferrer())); |
| 107 } else { | 107 } else { |
| 108 RELEASE_ASSERT(SecurityPolicy::generateReferrer(request.referrerPoli
cy(), request.url(), request.httpReferrer()).referrer == request.httpReferrer())
; | 108 RELEASE_ASSERT(SecurityPolicy::generateReferrer(request.getReferrerP
olicy(), request.url(), request.httpReferrer()).referrer == request.httpReferrer
()); |
| 109 outgoingOrigin = SecurityOrigin::createFromString(request.httpReferr
er()); | 109 outgoingOrigin = SecurityOrigin::createFromString(request.httpReferr
er()); |
| 110 } | 110 } |
| 111 | 111 |
| 112 request.addHTTPOriginIfNeeded(outgoingOrigin); | 112 request.addHTTPOriginIfNeeded(outgoingOrigin); |
| 113 } | 113 } |
| 114 | 114 |
| 115 if (m_document) | 115 if (m_document) |
| 116 request.setOriginatesFromReservedIPRange(m_document->isHostedInReservedI
PRange()); | 116 request.setOriginatesFromReservedIPRange(m_document->isHostedInReservedI
PRange()); |
| 117 | 117 |
| 118 // The remaining modifications are only necessary for HTTP and HTTPS. | 118 // The remaining modifications are only necessary for HTTP and HTTPS. |
| (...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 802 } | 802 } |
| 803 | 803 |
| 804 DEFINE_TRACE(FrameFetchContext) | 804 DEFINE_TRACE(FrameFetchContext) |
| 805 { | 805 { |
| 806 visitor->trace(m_document); | 806 visitor->trace(m_document); |
| 807 visitor->trace(m_documentLoader); | 807 visitor->trace(m_documentLoader); |
| 808 FetchContext::trace(visitor); | 808 FetchContext::trace(visitor); |
| 809 } | 809 } |
| 810 | 810 |
| 811 } // namespace blink | 811 } // namespace blink |
| OLD | NEW |