Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Side by Side Diff: third_party/WebKit/Source/core/fetch/ImageResource.h

Issue 2487763003: [ImageLoader 2d] Set DecodeError by calling ResourceLoader::cancel()
Patch Set: Rebase Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 123
124 void addObserver(ImageResourceObserver*); 124 void addObserver(ImageResourceObserver*);
125 void removeObserver(ImageResourceObserver*); 125 void removeObserver(ImageResourceObserver*);
126 126
127 ResourcePriority priorityFromObservers() override; 127 ResourcePriority priorityFromObservers() override;
128 128
129 void allClientsAndObserversRemoved() override; 129 void allClientsAndObserversRemoved() override;
130 130
131 PassRefPtr<const SharedBuffer> resourceBuffer() const override; 131 PassRefPtr<const SharedBuffer> resourceBuffer() const override;
132 void appendData(const char*, size_t) override; 132 void appendData(const char*, size_t) override;
133 void error(const ResourceError&) override; 133 void error(const ResourceError&, Status errorStatus) override;
134 void responseReceived(const ResourceResponse&, 134 void responseReceived(const ResourceResponse&,
135 std::unique_ptr<WebDataConsumerHandle>) override; 135 std::unique_ptr<WebDataConsumerHandle>) override;
136 void finish(double finishTime = 0.0) override; 136 void finish(double finishTime = 0.0) override;
137 137
138 // For compatibility, images keep loading even if there are HTTP errors. 138 // For compatibility, images keep loading even if there are HTTP errors.
139 bool shouldIgnoreHTTPStatusCodeErrors() const override { return true; } 139 bool shouldIgnoreHTTPStatusCodeErrors() const override { return true; }
140 140
141 bool isImage() const override { return true; } 141 bool isImage() const override { return true; }
142 142
143 // ImageObserver 143 // ImageObserver
(...skipping 30 matching lines...) Expand all
174 174
175 ImageResource(const ResourceRequest&, 175 ImageResource(const ResourceRequest&,
176 const ResourceLoaderOptions&, 176 const ResourceLoaderOptions&,
177 bool isPlaceholder); 177 bool isPlaceholder);
178 178
179 bool hasClientsOrObservers() const override { 179 bool hasClientsOrObservers() const override {
180 return Resource::hasClientsOrObservers() || !m_observers.isEmpty(); 180 return Resource::hasClientsOrObservers() || !m_observers.isEmpty();
181 } 181 }
182 void clear(); 182 void clear();
183 183
184 void decodeError();
185
184 void createImage(); 186 void createImage();
185 void updateImage(bool allDataReceived); 187 void updateImage(bool allDataReceived);
186 void updateImageAndClearBuffer(); 188 void updateImageAndClearBuffer();
187 void clearImage(); 189 void clearImage();
188 // If not null, changeRect is the changed part of the image. 190 // If not null, changeRect is the changed part of the image.
189 void notifyObservers(bool isNotifyingFinish, 191 void notifyObservers(bool isNotifyingFinish,
190 const IntRect* changeRect = nullptr); 192 const IntRect* changeRect = nullptr);
191 193
192 void ensureImage(); 194 void ensureImage();
193 195
(...skipping 20 matching lines...) Expand all
214 // Indicates if this ImageResource is either attempting to load a placeholder 216 // Indicates if this ImageResource is either attempting to load a placeholder
215 // image, or is a (possibly broken) placeholder image. 217 // image, or is a (possibly broken) placeholder image.
216 bool m_isPlaceholder; 218 bool m_isPlaceholder;
217 }; 219 };
218 220
219 DEFINE_RESOURCE_TYPE_CASTS(Image); 221 DEFINE_RESOURCE_TYPE_CASTS(Image);
220 222
221 } // namespace blink 223 } // namespace blink
222 224
223 #endif 225 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/fetch/FetchContext.cpp ('k') | third_party/WebKit/Source/core/fetch/ImageResource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698