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

Side by Side Diff: third_party/WebKit/Source/core/css/resolver/ElementStyleResources.cpp

Issue 1865603004: Fix crash when setting invalid URL on content (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pants Created 4 years, 8 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 | « third_party/WebKit/Source/core/css/CSSImageValue.cpp ('k') | 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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
4 * Copyright (C) 2013 Google Inc. All rights reserved. 4 * Copyright (C) 2013 Google Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 continue; 127 continue;
128 128
129 // Stash the DocumentResource on the reference filter. 129 // Stash the DocumentResource on the reference filter.
130 ReferenceFilterBuilder::setDocumentResourceReference(referenceFilter , adoptPtr(new DocumentResourceReference(resource))); 130 ReferenceFilterBuilder::setDocumentResourceReference(referenceFilter , adoptPtr(new DocumentResourceReference(resource)));
131 } 131 }
132 } 132 }
133 } 133 }
134 134
135 RawPtr<StyleImage> ElementStyleResources::loadPendingImage(StylePendingImage* pe ndingImage, CrossOriginAttributeValue crossOrigin) 135 RawPtr<StyleImage> ElementStyleResources::loadPendingImage(StylePendingImage* pe ndingImage, CrossOriginAttributeValue crossOrigin)
136 { 136 {
137 if (CSSImageValue* imageValue = pendingImage->cssImageValue()) { 137 if (CSSImageValue* imageValue = pendingImage->cssImageValue())
138 if (RawPtr<StyleImage> cachedImage = imageValue->cacheImage(m_document, crossOrigin)) 138 return imageValue->cacheImage(m_document, crossOrigin);
139 return cachedImage.release();
140 return StyleInvalidImage::create(imageValue->url());
141 }
142 139
143 if (CSSImageGeneratorValue* imageGeneratorValue = pendingImage->cssImageGene ratorValue()) { 140 if (CSSImageGeneratorValue* imageGeneratorValue = pendingImage->cssImageGene ratorValue()) {
144 imageGeneratorValue->loadSubimages(m_document); 141 imageGeneratorValue->loadSubimages(m_document);
145 return StyleGeneratedImage::create(*imageGeneratorValue); 142 return StyleGeneratedImage::create(*imageGeneratorValue);
146 } 143 }
147 144
148 if (CSSCursorImageValue* cursorImageValue = pendingImage->cssCursorImageValu e()) 145 if (CSSCursorImageValue* cursorImageValue = pendingImage->cssCursorImageValu e())
149 return cursorImageValue->cacheImage(m_document, m_deviceScaleFactor); 146 return cursorImageValue->cacheImage(m_document, m_deviceScaleFactor);
150 147
151 if (CSSImageSetValue* imageSetValue = pendingImage->cssImageSetValue()) 148 if (CSSImageSetValue* imageSetValue = pendingImage->cssImageSetValue())
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 } 245 }
249 } 246 }
250 247
251 void ElementStyleResources::loadPendingResources(ComputedStyle* computedStyle) 248 void ElementStyleResources::loadPendingResources(ComputedStyle* computedStyle)
252 { 249 {
253 loadPendingImages(computedStyle); 250 loadPendingImages(computedStyle);
254 loadPendingSVGDocuments(computedStyle); 251 loadPendingSVGDocuments(computedStyle);
255 } 252 }
256 253
257 } // namespace blink 254 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSImageValue.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698