| OLD | NEW |
| 1 /* | 1 /* |
| 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) | 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) |
| 3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) | 3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) |
| 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) | 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) |
| 5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) | 5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) |
| 6 Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. | 6 Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. |
| 7 | 7 |
| 8 This library is free software; you can redistribute it and/or | 8 This library is free software; you can redistribute it and/or |
| 9 modify it under the terms of the GNU Library General Public | 9 modify it under the terms of the GNU Library General Public |
| 10 License as published by the Free Software Foundation; either | 10 License as published by the Free Software Foundation; either |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 #include "wtf/StdLibExtras.h" | 39 #include "wtf/StdLibExtras.h" |
| 40 #include "wtf/Vector.h" | 40 #include "wtf/Vector.h" |
| 41 | 41 |
| 42 using namespace std; | 42 using namespace std; |
| 43 | 43 |
| 44 namespace WebCore { | 44 namespace WebCore { |
| 45 | 45 |
| 46 ImageResource::ImageResource(const ResourceRequest& resourceRequest) | 46 ImageResource::ImageResource(const ResourceRequest& resourceRequest) |
| 47 : Resource(resourceRequest, Image) | 47 : Resource(resourceRequest, Image) |
| 48 , m_devicePixelRatioHeaderValue(1.0) | 48 , m_devicePixelRatioHeaderValue(1.0) |
| 49 , m_deviceScaleFactor(1.0) |
| 49 , m_image(0) | 50 , m_image(0) |
| 50 , m_loadingMultipartContent(false) | 51 , m_loadingMultipartContent(false) |
| 51 , m_hasDevicePixelRatioHeaderValue(false) | 52 , m_hasDevicePixelRatioHeaderValue(false) |
| 52 { | 53 { |
| 53 setStatus(Unknown); | 54 setStatus(Unknown); |
| 54 setCustomAcceptHeader(); | 55 setCustomAcceptHeader(); |
| 55 } | 56 } |
| 56 | 57 |
| 57 ImageResource::ImageResource(WebCore::Image* image) | 58 ImageResource::ImageResource(WebCore::Image* image) |
| 58 : Resource(ResourceRequest(""), Image) | 59 : Resource(ResourceRequest(""), Image) |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 setAccept(acceptWebP); | 285 setAccept(acceptWebP); |
| 285 } | 286 } |
| 286 | 287 |
| 287 inline void ImageResource::createImage() | 288 inline void ImageResource::createImage() |
| 288 { | 289 { |
| 289 // Create the image if it doesn't yet exist. | 290 // Create the image if it doesn't yet exist. |
| 290 if (m_image) | 291 if (m_image) |
| 291 return; | 292 return; |
| 292 | 293 |
| 293 if (m_response.mimeType() == "image/svg+xml") { | 294 if (m_response.mimeType() == "image/svg+xml") { |
| 294 RefPtr<SVGImage> svgImage = SVGImage::create(this); | 295 RefPtr<SVGImage> svgImage = SVGImage::create(this, m_deviceScaleFactor); |
| 295 m_svgImageCache = SVGImageCache::create(svgImage.get()); | 296 m_svgImageCache = SVGImageCache::create(svgImage.get()); |
| 296 m_image = svgImage.release(); | 297 m_image = svgImage.release(); |
| 297 } else { | 298 } else { |
| 298 m_image = BitmapImage::create(this); | 299 m_image = BitmapImage::create(this); |
| 299 } | 300 } |
| 300 | 301 |
| 301 if (m_image) { | 302 if (m_image) { |
| 302 // Send queued container size requests. | 303 // Send queued container size requests. |
| 303 if (m_image->usesContainerSize()) { | 304 if (m_image->usesContainerSize()) { |
| 304 for (ContainerSizeRequests::iterator it = m_pendingContainerSizeRequ
ests.begin(); it != m_pendingContainerSizeRequests.end(); ++it) | 305 for (ContainerSizeRequests::iterator it = m_pendingContainerSizeRequ
ests.begin(); it != m_pendingContainerSizeRequests.end(); ++it) |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 463 bool ImageResource::isAccessAllowed(SecurityOrigin* securityOrigin) | 464 bool ImageResource::isAccessAllowed(SecurityOrigin* securityOrigin) |
| 464 { | 465 { |
| 465 if (!image()->currentFrameHasSingleSecurityOrigin()) | 466 if (!image()->currentFrameHasSingleSecurityOrigin()) |
| 466 return false; | 467 return false; |
| 467 if (passesAccessControlCheck(securityOrigin)) | 468 if (passesAccessControlCheck(securityOrigin)) |
| 468 return true; | 469 return true; |
| 469 return !securityOrigin->taintsCanvas(response().url()); | 470 return !securityOrigin->taintsCanvas(response().url()); |
| 470 } | 471 } |
| 471 | 472 |
| 472 } // namespace WebCore | 473 } // namespace WebCore |
| OLD | NEW |