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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 void updateImageAnimationPolicy(); | 92 void updateImageAnimationPolicy(); |
93 | 93 |
94 // If this ImageResource has the Lo-Fi response headers, reload it with | 94 // If this ImageResource has the Lo-Fi response headers, reload it with |
95 // the Lo-Fi state set to off and bypassing the cache. | 95 // the Lo-Fi state set to off and bypassing the cache. |
96 void reloadIfLoFi(ResourceFetcher*); | 96 void reloadIfLoFi(ResourceFetcher*); |
97 | 97 |
98 void didAddClient(ResourceClient*) override; | 98 void didAddClient(ResourceClient*) override; |
99 | 99 |
100 void addObserver(ImageResourceObserver*); | 100 void addObserver(ImageResourceObserver*); |
101 void removeObserver(ImageResourceObserver*); | 101 void removeObserver(ImageResourceObserver*); |
102 bool hasClientsOrObservers() const override { return Resource::hasClientsOrO
bservers() || !m_observers.isEmpty() || !m_finishedObservers.isEmpty(); } | |
103 | 102 |
104 ResourcePriority priorityFromObservers() override; | 103 ResourcePriority priorityFromObservers() override; |
105 | 104 |
106 void allClientsAndObserversRemoved() override; | 105 void allClientsAndObserversRemoved() override; |
107 | 106 |
108 PassRefPtr<SharedBuffer> resourceBuffer() const override; | 107 PassRefPtr<SharedBuffer> resourceBuffer() const override; |
109 void appendData(const char*, size_t) override; | 108 void appendData(const char*, size_t) override; |
110 void error(const ResourceError&) override; | 109 void error(const ResourceError&) override; |
111 void responseReceived(const ResourceResponse&, std::unique_ptr<WebDataConsum
erHandle>) override; | 110 void responseReceived(const ResourceResponse&, std::unique_ptr<WebDataConsum
erHandle>) override; |
112 void finish(double finishTime = 0.0) override; | 111 void finish(double finishTime = 0.0) override; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 ImageResourceFactory() | 143 ImageResourceFactory() |
145 : ResourceFactory(Resource::Image) { } | 144 : ResourceFactory(Resource::Image) { } |
146 | 145 |
147 Resource* create(const ResourceRequest& request, const ResourceLoaderOpt
ions& options, const String&) const override | 146 Resource* create(const ResourceRequest& request, const ResourceLoaderOpt
ions& options, const String&) const override |
148 { | 147 { |
149 return new ImageResource(request, options); | 148 return new ImageResource(request, options); |
150 } | 149 } |
151 }; | 150 }; |
152 ImageResource(const ResourceRequest&, const ResourceLoaderOptions&); | 151 ImageResource(const ResourceRequest&, const ResourceLoaderOptions&); |
153 | 152 |
| 153 bool hasClientsOrObservers() const override { return Resource::hasClientsOrO
bservers() || !m_observers.isEmpty() || !m_finishedObservers.isEmpty(); } |
154 void clear(); | 154 void clear(); |
155 | 155 |
156 void createImage(); | 156 void createImage(); |
157 void updateImage(bool allDataReceived); | 157 void updateImage(bool allDataReceived); |
158 void updateImageAndClearBuffer(); | 158 void updateImageAndClearBuffer(); |
159 void clearImage(); | 159 void clearImage(); |
160 // If not null, changeRect is the changed part of the image. | 160 // If not null, changeRect is the changed part of the image. |
161 void notifyObservers(const IntRect* changeRect = nullptr); | 161 void notifyObservers(const IntRect* changeRect = nullptr); |
162 | 162 |
163 void ensureImage(); | 163 void ensureImage(); |
(...skipping 15 matching lines...) Expand all Loading... |
179 bool m_hasDevicePixelRatioHeaderValue; | 179 bool m_hasDevicePixelRatioHeaderValue; |
180 HashCountedSet<ImageResourceObserver*> m_observers; | 180 HashCountedSet<ImageResourceObserver*> m_observers; |
181 HashCountedSet<ImageResourceObserver*> m_finishedObservers; | 181 HashCountedSet<ImageResourceObserver*> m_finishedObservers; |
182 }; | 182 }; |
183 | 183 |
184 DEFINE_RESOURCE_TYPE_CASTS(Image); | 184 DEFINE_RESOURCE_TYPE_CASTS(Image); |
185 | 185 |
186 } // namespace blink | 186 } // namespace blink |
187 | 187 |
188 #endif | 188 #endif |
OLD | NEW |