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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 public: | 49 public: |
50 using ClientType = ResourceClient; | 50 using ClientType = ResourceClient; |
51 | 51 |
52 static ImageResource* fetch(FetchRequest&, ResourceFetcher*); | 52 static ImageResource* fetch(FetchRequest&, ResourceFetcher*); |
53 | 53 |
54 static ImageResource* create(blink::Image* image) | 54 static ImageResource* create(blink::Image* image) |
55 { | 55 { |
56 return new ImageResource(image, ResourceLoaderOptions()); | 56 return new ImageResource(image, ResourceLoaderOptions()); |
57 } | 57 } |
58 | 58 |
59 // Exposed for testing | |
60 static ImageResource* create(const ResourceRequest& request) | 59 static ImageResource* create(const ResourceRequest& request) |
61 { | 60 { |
62 return new ImageResource(request, ResourceLoaderOptions()); | 61 return new ImageResource(request, ResourceLoaderOptions()); |
63 } | 62 } |
64 | 63 |
65 ~ImageResource() override; | 64 ~ImageResource() override; |
66 | 65 |
67 blink::Image* getImage(); // Returns the nullImage() if the image is not ava
ilable yet. | 66 blink::Image* getImage(); // Returns the nullImage() if the image is not ava
ilable yet. |
68 bool hasImage() const { return m_image.get(); } | 67 bool hasImage() const { return m_image.get(); } |
69 | 68 |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 bool m_hasDevicePixelRatioHeaderValue; | 167 bool m_hasDevicePixelRatioHeaderValue; |
169 HashCountedSet<ImageResourceObserver*> m_observers; | 168 HashCountedSet<ImageResourceObserver*> m_observers; |
170 HashCountedSet<ImageResourceObserver*> m_finishedObservers; | 169 HashCountedSet<ImageResourceObserver*> m_finishedObservers; |
171 }; | 170 }; |
172 | 171 |
173 DEFINE_RESOURCE_TYPE_CASTS(Image); | 172 DEFINE_RESOURCE_TYPE_CASTS(Image); |
174 | 173 |
175 } // namespace blink | 174 } // namespace blink |
176 | 175 |
177 #endif | 176 #endif |
OLD | NEW |