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) 2006 Samuel Weinig (sam.weinig@gmail.com) | 4 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) |
5 Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. | 5 Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. |
6 | 6 |
7 This library is free software; you can redistribute it and/or | 7 This library is free software; you can redistribute it and/or |
8 modify it under the terms of the GNU Library General Public | 8 modify it under the terms of the GNU Library General Public |
9 License as published by the Free Software Foundation; either | 9 License as published by the Free Software Foundation; either |
10 version 2 of the License, or (at your option) any later version. | 10 version 2 of the License, or (at your option) any later version. |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 class SecurityOrigin; | 42 class SecurityOrigin; |
43 | 43 |
44 class ImageResource FINAL : public Resource, public ImageObserver { | 44 class ImageResource FINAL : public Resource, public ImageObserver { |
45 friend class MemoryCache; | 45 friend class MemoryCache; |
46 | 46 |
47 public: | 47 public: |
48 typedef ImageResourceClient ClientType; | 48 typedef ImageResourceClient ClientType; |
49 | 49 |
50 ImageResource(const ResourceRequest&); | 50 ImageResource(const ResourceRequest&); |
51 ImageResource(WebCore::Image*); | 51 ImageResource(WebCore::Image*); |
| 52 // Exposed for testing |
| 53 ImageResource(const ResourceRequest&, WebCore::Image*); |
52 virtual ~ImageResource(); | 54 virtual ~ImageResource(); |
53 | 55 |
54 virtual void load(ResourceFetcher*, const ResourceLoaderOptions&) OVERRIDE; | 56 virtual void load(ResourceFetcher*, const ResourceLoaderOptions&) OVERRIDE; |
55 | 57 |
56 WebCore::Image* image(); // Returns the nullImage() if the image is not avai
lable yet. | 58 WebCore::Image* image(); // Returns the nullImage() if the image is not avai
lable yet. |
57 WebCore::Image* imageForRenderer(const RenderObject*); // Returns the nullIm
age() if the image is not available yet. | 59 WebCore::Image* imageForRenderer(const RenderObject*); // Returns the nullIm
age() if the image is not available yet. |
58 bool hasImage() const { return m_image.get(); } | 60 bool hasImage() const { return m_image.get(); } |
59 bool currentFrameKnownToBeOpaque(const RenderObject*); // Side effect: ensur
es decoded image is in cache, therefore should only be called when about to draw
the image. | 61 bool currentFrameKnownToBeOpaque(const RenderObject*); // Side effect: ensur
es decoded image is in cache, therefore should only be called when about to draw
the image. |
60 | 62 |
61 static std::pair<WebCore::Image*, float> brokenImage(float deviceScaleFactor
); // Returns an image and the image's resolution scale factor. | 63 static std::pair<WebCore::Image*, float> brokenImage(float deviceScaleFactor
); // Returns an image and the image's resolution scale factor. |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 OwnPtr<SVGImageCache> m_svgImageCache; | 132 OwnPtr<SVGImageCache> m_svgImageCache; |
131 bool m_loadingMultipartContent; | 133 bool m_loadingMultipartContent; |
132 bool m_hasDevicePixelRatioHeaderValue; | 134 bool m_hasDevicePixelRatioHeaderValue; |
133 }; | 135 }; |
134 | 136 |
135 DEFINE_RESOURCE_TYPE_CASTS(Image); | 137 DEFINE_RESOURCE_TYPE_CASTS(Image); |
136 | 138 |
137 } | 139 } |
138 | 140 |
139 #endif | 141 #endif |
OLD | NEW |