OLD | NEW |
1 /* | 1 /* |
2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) | 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) |
3 * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved. | 3 * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved. |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 } | 55 } |
56 | 56 |
57 StyleFetchedImage* CSSImageValue::cachedImage(ResourceFetcher* fetcher, const Re
sourceLoaderOptions& options) | 57 StyleFetchedImage* CSSImageValue::cachedImage(ResourceFetcher* fetcher, const Re
sourceLoaderOptions& options) |
58 { | 58 { |
59 ASSERT(fetcher); | 59 ASSERT(fetcher); |
60 | 60 |
61 if (!m_accessedImage) { | 61 if (!m_accessedImage) { |
62 m_accessedImage = true; | 62 m_accessedImage = true; |
63 | 63 |
64 FetchRequest request(ResourceRequest(m_absoluteURL), m_initiatorName.isE
mpty() ? FetchInitiatorTypeNames::css : m_initiatorName, options); | 64 FetchRequest request(ResourceRequest(m_absoluteURL), m_initiatorName.isE
mpty() ? FetchInitiatorTypeNames::css : m_initiatorName, options); |
| 65 request.mutableResourceRequest().setHTTPReferrer(m_referrer); |
65 | 66 |
66 if (options.corsEnabled == IsCORSEnabled) | 67 if (options.corsEnabled == IsCORSEnabled) |
67 request.setCrossOriginAccessControl(fetcher->document()->securityOri
gin(), options.allowCredentials, options.credentialsRequested); | 68 request.setCrossOriginAccessControl(fetcher->document()->securityOri
gin(), options.allowCredentials, options.credentialsRequested); |
68 | 69 |
69 if (ResourcePtr<ImageResource> cachedImage = fetcher->fetchImage(request
)) | 70 if (ResourcePtr<ImageResource> cachedImage = fetcher->fetchImage(request
)) |
70 m_image = StyleFetchedImage::create(cachedImage.get()); | 71 m_image = StyleFetchedImage::create(cachedImage.get()); |
71 } | 72 } |
72 | 73 |
73 return (m_image && m_image->isImageResource()) ? toStyleFetchedImage(m_image
) : 0; | 74 return (m_image && m_image->isImageResource()) ? toStyleFetchedImage(m_image
) : 0; |
74 } | 75 } |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 { | 130 { |
130 KURL url = document.completeURL(m_relativeURL); | 131 KURL url = document.completeURL(m_relativeURL); |
131 if (url == m_absoluteURL) | 132 if (url == m_absoluteURL) |
132 return; | 133 return; |
133 m_absoluteURL = url.string(); | 134 m_absoluteURL = url.string(); |
134 m_accessedImage = false; | 135 m_accessedImage = false; |
135 m_image.clear(); | 136 m_image.clear(); |
136 } | 137 } |
137 | 138 |
138 } // namespace WebCore | 139 } // namespace WebCore |
OLD | NEW |