Index: Source/WebCore/loader/cache/CachedImage.cpp |
diff --git a/Source/WebCore/loader/cache/CachedImage.cpp b/Source/WebCore/loader/cache/CachedImage.cpp |
index 4f99e86a10a14697fa21b0efad4ef1387bb87af4..f5822d88cc434ffcea9f66c662fa4829e974a2cb 100644 |
--- a/Source/WebCore/loader/cache/CachedImage.cpp |
+++ b/Source/WebCore/loader/cache/CachedImage.cpp |
@@ -47,6 +47,10 @@ |
#include "SVGImage.h" |
#endif |
+#if USE(WEBP) |
+#include "RuntimeEnabledFeatures.h" |
+#endif |
+ |
using std::max; |
namespace WebCore { |
@@ -56,6 +60,7 @@ CachedImage::CachedImage(const ResourceRequest& resourceRequest) |
, m_image(0) |
{ |
setStatus(Unknown); |
+ setCustomAcceptHeader(); |
} |
CachedImage::CachedImage(Image* image) |
@@ -64,6 +69,7 @@ CachedImage::CachedImage(Image* image) |
{ |
setStatus(Cached); |
setLoading(false); |
+ setCustomAcceptHeader(); |
} |
CachedImage::~CachedImage() |
@@ -293,6 +299,14 @@ void CachedImage::clear() |
setEncodedSize(0); |
} |
+void CachedImage::setCustomAcceptHeader() |
+{ |
+#if USE(WEBP) |
+ if (RuntimeEnabledFeatures::webPInAcceptHeaderEnabled()) |
+ setAccept("image/webp,*/*;q=0.8"); |
+#endif |
+} |
+ |
inline void CachedImage::createImage() |
{ |
// Create the image if it doesn't yet exist. |