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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 | 59 // Exposed for testing |
60 static ImageResource* create(const ResourceRequest& request, blink::Image* i mage) | 60 static ImageResource* create(const ResourceRequest& request) |
61 { | 61 { |
62 return new ImageResource(request, image, ResourceLoaderOptions()); | 62 return new ImageResource(request, ResourceLoaderOptions()); |
63 } | 63 } |
64 | 64 |
65 ~ImageResource() override; | 65 ~ImageResource() override; |
66 | 66 |
67 blink::Image* getImage(); // Returns the nullImage() if the image is not ava ilable yet. | 67 blink::Image* getImage(); // Returns the nullImage() if the image is not ava ilable yet. |
68 bool hasImage() const { return m_image.get(); } | 68 bool hasImage() const { return m_image.get(); } |
69 | 69 |
70 static std::pair<blink::Image*, float> brokenImage(float deviceScaleFactor); // Returns an image and the image's resolution scale factor. | 70 static std::pair<blink::Image*, float> brokenImage(float deviceScaleFactor); // Returns an image and the image's resolution scale factor. |
71 bool willPaintBrokenImage() const; | 71 bool willPaintBrokenImage() const; |
72 | 72 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
123 | 123 |
124 DECLARE_VIRTUAL_TRACE(); | 124 DECLARE_VIRTUAL_TRACE(); |
125 | 125 |
126 protected: | 126 protected: |
127 bool isSafeToUnlock() const override; | 127 bool isSafeToUnlock() const override; |
128 void destroyDecodedDataIfPossible() override; | 128 void destroyDecodedDataIfPossible() override; |
129 void destroyDecodedDataForFailedRevalidation() override; | 129 void destroyDecodedDataForFailedRevalidation() override; |
130 | 130 |
131 private: | 131 private: |
132 explicit ImageResource(blink::Image*, const ResourceLoaderOptions&); | 132 explicit ImageResource(blink::Image*, const ResourceLoaderOptions&); |
133 ImageResource(const ResourceRequest&, blink::Image*, const ResourceLoaderOpt ions&); | 133 ImageResource(const ResourceRequest&, blink::Image*, const ResourceLoaderOpt ions&); |
hiroshige
2016/04/08 01:02:04
We can remove this decralation.
Nate Chapin
2016/04/11 18:47:32
Done.
| |
134 | 134 |
135 enum class MultipartParsingState : uint8_t { | 135 enum class MultipartParsingState : uint8_t { |
136 WaitingForFirstPart, | 136 WaitingForFirstPart, |
137 ParsingFirstPart, | 137 ParsingFirstPart, |
138 FinishedParsingFirstPart, | 138 FinishedParsingFirstPart, |
139 }; | 139 }; |
140 | 140 |
141 class ImageResourceFactory : public ResourceFactory { | 141 class ImageResourceFactory : public ResourceFactory { |
142 public: | 142 public: |
143 ImageResourceFactory() | 143 ImageResourceFactory() |
(...skipping 23 matching lines...) Expand all Loading... | |
167 bool m_hasDevicePixelRatioHeaderValue; | 167 bool m_hasDevicePixelRatioHeaderValue; |
168 HashCountedSet<ImageResourceObserver*> m_observers; | 168 HashCountedSet<ImageResourceObserver*> m_observers; |
169 HashCountedSet<ImageResourceObserver*> m_finishedObservers; | 169 HashCountedSet<ImageResourceObserver*> m_finishedObservers; |
170 }; | 170 }; |
171 | 171 |
172 DEFINE_RESOURCE_TYPE_CASTS(Image); | 172 DEFINE_RESOURCE_TYPE_CASTS(Image); |
173 | 173 |
174 } // namespace blink | 174 } // namespace blink |
175 | 175 |
176 #endif | 176 #endif |
OLD | NEW |