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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/Image.h

Issue 2173873003: Cancel image loads if decoding failed (attempt #2) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix UAF Created 4 years, 5 months 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) 2006 Samuel Weinig (sam.weinig@gmail.com) 2 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
3 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 94
95 virtual bool usesContainerSize() const { return false; } 95 virtual bool usesContainerSize() const { return false; }
96 virtual bool hasRelativeSize() const { return false; } 96 virtual bool hasRelativeSize() const { return false; }
97 97
98 virtual IntSize size() const = 0; 98 virtual IntSize size() const = 0;
99 IntRect rect() const { return IntRect(IntPoint(), size()); } 99 IntRect rect() const { return IntRect(IntPoint(), size()); }
100 int width() const { return size().width(); } 100 int width() const { return size().width(); }
101 int height() const { return size().height(); } 101 int height() const { return size().height(); }
102 virtual bool getHotSpot(IntPoint&) const { return false; } 102 virtual bool getHotSpot(IntPoint&) const { return false; }
103 103
104 virtual bool setData(PassRefPtr<SharedBuffer> data, bool allDataReceived); 104 enum SizeAvailability {
105 virtual bool dataChanged(bool /*allDataReceived*/) { return false; } 105 SizeAvailable,
106 SizeUnavailable
107 };
108 virtual SizeAvailability setData(PassRefPtr<SharedBuffer> data, bool allData Received);
109 virtual SizeAvailability dataChanged(bool /*allDataReceived*/) { return Size Unavailable; }
106 110
107 virtual String filenameExtension() const { return String(); } // null string if unknown 111 virtual String filenameExtension() const { return String(); } // null string if unknown
108 112
109 virtual void destroyDecodedData() = 0; 113 virtual void destroyDecodedData() = 0;
110 114
111 virtual PassRefPtr<SharedBuffer> data() { return m_encodedImageData; } 115 virtual PassRefPtr<SharedBuffer> data() { return m_encodedImageData; }
112 116
113 // Animation begins whenever someone draws the image, so startAnimation() is not normally called. 117 // Animation begins whenever someone draws the image, so startAnimation() is not normally called.
114 // It will automatically pause once all observers no longer want to render t he image anywhere. 118 // It will automatically pause once all observers no longer want to render t he image anywhere.
115 enum CatchUpAnimation { DoNotCatchUp, CatchUp }; 119 enum CatchUpAnimation { DoNotCatchUp, CatchUp };
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 UntracedMember<ImageObserver> m_imageObserver; 185 UntracedMember<ImageObserver> m_imageObserver;
182 bool m_imageObserverDisabled; 186 bool m_imageObserverDisabled;
183 }; 187 };
184 188
185 #define DEFINE_IMAGE_TYPE_CASTS(typeName) \ 189 #define DEFINE_IMAGE_TYPE_CASTS(typeName) \
186 DEFINE_TYPE_CASTS(typeName, Image, image, image->is##typeName(), image.is##t ypeName()) 190 DEFINE_TYPE_CASTS(typeName, Image, image, image->is##typeName(), image.is##t ypeName())
187 191
188 } // namespace blink 192 } // namespace blink
189 193
190 #endif 194 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698