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

Unified Diff: Source/core/fetch/ImageResource.cpp

Issue 481753002: Use Shadow DOM to display fallback content for images (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/fetch/ImageResource.cpp
diff --git a/Source/core/fetch/ImageResource.cpp b/Source/core/fetch/ImageResource.cpp
index d9ff30ef476438acf333699122cd794db084e2b9..816bd9a5fb4cab69b18951125cf255d9d1ea4467 100644
--- a/Source/core/fetch/ImageResource.cpp
+++ b/Source/core/fetch/ImageResource.cpp
@@ -158,33 +158,11 @@ void ImageResource::allClientsRemoved()
Resource::allClientsRemoved();
}
-pair<blink::Image*, float> ImageResource::brokenImage(float deviceScaleFactor)
-{
- if (deviceScaleFactor >= 2) {
- DEFINE_STATIC_REF(blink::Image, brokenImageHiRes, (blink::Image::loadPlatformResource("missingImage@2x")));
- return std::make_pair(brokenImageHiRes, 2);
- }
-
- DEFINE_STATIC_REF(blink::Image, brokenImageLoRes, (blink::Image::loadPlatformResource("missingImage")));
- return std::make_pair(brokenImageLoRes, 1);
-}
-
-bool ImageResource::willPaintBrokenImage() const
-{
- return errorOccurred();
-}
blink::Image* ImageResource::image()
{
ASSERT(!isPurgeable());
- if (errorOccurred()) {
- // Returning the 1x broken image is non-ideal, but we cannot reliably access the appropriate
- // deviceScaleFactor from here. It is critical that callers use ImageResource::brokenImage()
- // when they need the real, deviceScaleFactor-appropriate broken image icon.
- return brokenImage(1).first;
- }
-
if (m_image)
return m_image.get();
@@ -195,13 +173,6 @@ blink::Image* ImageResource::imageForRenderer(const RenderObject* renderer)
{
ASSERT(!isPurgeable());
- if (errorOccurred()) {
- // Returning the 1x broken image is non-ideal, but we cannot reliably access the appropriate
- // deviceScaleFactor from here. It is critical that callers use ImageResource::brokenImage()
- // when they need the real, deviceScaleFactor-appropriate broken image icon.
- return brokenImage(1).first;
- }
-
if (!m_image)
return blink::Image::nullImage();

Powered by Google App Engine
This is Rietveld 408576698