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

Side by Side Diff: Source/core/css/CSSImageValue.cpp

Issue 304603006: Revert of Set proper referrer for css resource fetching (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 6 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 | « Source/core/css/CSSImageValue.h ('k') | Source/core/css/parser/CSSPropertyParser.h » ('j') | 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 * (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
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 if (!m_referrer.isEmpty())
66 request.mutableResourceRequest().setHTTPReferrer(Referrer(m_referrer , ReferrerPolicyDefault));
67 65
68 if (options.corsEnabled == IsCORSEnabled) 66 if (options.corsEnabled == IsCORSEnabled)
69 request.setCrossOriginAccessControl(fetcher->document()->securityOri gin(), options.allowCredentials, options.credentialsRequested); 67 request.setCrossOriginAccessControl(fetcher->document()->securityOri gin(), options.allowCredentials, options.credentialsRequested);
70 68
71 if (ResourcePtr<ImageResource> cachedImage = fetcher->fetchImage(request )) 69 if (ResourcePtr<ImageResource> cachedImage = fetcher->fetchImage(request ))
72 m_image = StyleFetchedImage::create(cachedImage.get()); 70 m_image = StyleFetchedImage::create(cachedImage.get());
73 } 71 }
74 72
75 return (m_image && m_image->isImageResource()) ? toStyleFetchedImage(m_image ) : 0; 73 return (m_image && m_image->isImageResource()) ? toStyleFetchedImage(m_image ) : 0;
76 } 74 }
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 { 114 {
117 KURL url = document.completeURL(m_relativeURL); 115 KURL url = document.completeURL(m_relativeURL);
118 if (url == m_absoluteURL) 116 if (url == m_absoluteURL)
119 return; 117 return;
120 m_absoluteURL = url.string(); 118 m_absoluteURL = url.string();
121 m_accessedImage = false; 119 m_accessedImage = false;
122 m_image.clear(); 120 m_image.clear();
123 } 121 }
124 122
125 } // namespace WebCore 123 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/css/CSSImageValue.h ('k') | Source/core/css/parser/CSSPropertyParser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698