| 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 | 94 |
| 95 // If this ImageResource has the Lo-Fi response headers, reload it with | 95 // If this ImageResource has the Lo-Fi response headers, reload it with |
| 96 // the Lo-Fi state set to off and bypassing the cache. | 96 // the Lo-Fi state set to off and bypassing the cache. |
| 97 void reloadIfLoFi(ResourceFetcher*); | 97 void reloadIfLoFi(ResourceFetcher*); |
| 98 | 98 |
| 99 void didAddClient(ResourceClient*) override; | 99 void didAddClient(ResourceClient*) override; |
| 100 void didRemoveClient(ResourceClient*) override; | 100 void didRemoveClient(ResourceClient*) override; |
| 101 | 101 |
| 102 void allClientsRemoved() override; | 102 void allClientsRemoved() override; |
| 103 | 103 |
| 104 void appendData(const char*, size_t) override; | |
| 105 void error(Resource::Status) override; | 104 void error(Resource::Status) override; |
| 106 void responseReceived(const ResourceResponse&, PassOwnPtr<WebDataConsumerHan
dle>) override; | 105 void responseReceived(const ResourceResponse&, PassOwnPtr<WebDataConsumerHan
dle>) override; |
| 107 void finishOnePart() override; | 106 void finishOnePart() override; |
| 108 | 107 |
| 109 // For compatibility, images keep loading even if there are HTTP errors. | 108 // For compatibility, images keep loading even if there are HTTP errors. |
| 110 bool shouldIgnoreHTTPStatusCodeErrors() const override { return true; } | 109 bool shouldIgnoreHTTPStatusCodeErrors() const override { return true; } |
| 111 | 110 |
| 112 bool isImage() const override { return true; } | 111 bool isImage() const override { return true; } |
| 113 bool stillNeedsLoad() const override { return !errorOccurred() && status() =
= Unknown && !isLoading(); } | 112 bool stillNeedsLoad() const override { return !errorOccurred() && status() =
= Unknown && !isLoading(); } |
| 114 | 113 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 136 ImageResourceFactory() | 135 ImageResourceFactory() |
| 137 : ResourceFactory(Resource::Image) { } | 136 : ResourceFactory(Resource::Image) { } |
| 138 | 137 |
| 139 PassRefPtrWillBeRawPtr<Resource> create(const ResourceRequest& request,
const String&) const override | 138 PassRefPtrWillBeRawPtr<Resource> create(const ResourceRequest& request,
const String&) const override |
| 140 { | 139 { |
| 141 return adoptRefWillBeNoop(new ImageResource(request)); | 140 return adoptRefWillBeNoop(new ImageResource(request)); |
| 142 } | 141 } |
| 143 }; | 142 }; |
| 144 ImageResource(const ResourceRequest&); | 143 ImageResource(const ResourceRequest&); |
| 145 | 144 |
| 145 void appendDataInternal(const char*, size_t) override; |
| 146 void clear(); | 146 void clear(); |
| 147 | 147 |
| 148 void setCustomAcceptHeader(); | 148 void setCustomAcceptHeader(); |
| 149 void createImage(); | 149 void createImage(); |
| 150 void updateImage(bool allDataReceived); | 150 void updateImage(bool allDataReceived); |
| 151 void clearImage(); | 151 void clearImage(); |
| 152 // If not null, changeRect is the changed part of the image. | 152 // If not null, changeRect is the changed part of the image. |
| 153 void notifyObservers(const IntRect* changeRect = nullptr); | 153 void notifyObservers(const IntRect* changeRect = nullptr); |
| 154 bool loadingMultipartContent() const; | 154 bool loadingMultipartContent() const; |
| 155 | 155 |
| 156 float m_devicePixelRatioHeaderValue; | 156 float m_devicePixelRatioHeaderValue; |
| 157 | 157 |
| 158 RefPtr<blink::Image> m_image; | 158 RefPtr<blink::Image> m_image; |
| 159 bool m_hasDevicePixelRatioHeaderValue; | 159 bool m_hasDevicePixelRatioHeaderValue; |
| 160 }; | 160 }; |
| 161 | 161 |
| 162 DEFINE_RESOURCE_TYPE_CASTS(Image); | 162 DEFINE_RESOURCE_TYPE_CASTS(Image); |
| 163 | 163 |
| 164 } // namespace blink | 164 } // namespace blink |
| 165 | 165 |
| 166 #endif | 166 #endif |
| OLD | NEW |