OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 if (!length) | 137 if (!length) |
138 return; | 138 return; |
139 | 139 |
140 LocalFrame* frame = document()->frame(); | 140 LocalFrame* frame = document()->frame(); |
141 Settings* settings = frame->settings(); | 141 Settings* settings = frame->settings(); |
142 if (!frame->loader().client()->allowImage(!settings || settings->imagesEnabl
ed(), document()->url())) | 142 if (!frame->loader().client()->allowImage(!settings || settings->imagesEnabl
ed(), document()->url())) |
143 return; | 143 return; |
144 | 144 |
145 if (document()->cachedImage()) { | 145 if (document()->cachedImage()) { |
146 RELEASE_ASSERT(length <= std::numeric_limits<unsigned>::max()); | 146 RELEASE_ASSERT(length <= std::numeric_limits<unsigned>::max()); |
147 document()->cachedImage()->appendData(data, length); | 147 // If decoding has already failed, there's no point in sending additiona
l data to the ImageResource. |
| 148 if (document()->cachedImage()->getStatus() != Resource::DecodeError) |
| 149 document()->cachedImage()->appendData(data, length); |
148 } | 150 } |
149 | 151 |
150 if (!isDetached()) | 152 if (!isDetached()) |
151 document()->imageUpdated(); | 153 document()->imageUpdated(); |
152 } | 154 } |
153 | 155 |
154 void ImageDocumentParser::finish() | 156 void ImageDocumentParser::finish() |
155 { | 157 { |
156 if (!isStopped() && document()->imageElement() && document()->cachedImage())
{ | 158 if (!isStopped() && document()->imageElement() && document()->cachedImage())
{ |
157 ImageResource* cachedImage = document()->cachedImage(); | 159 ImageResource* cachedImage = document()->cachedImage(); |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 } | 442 } |
441 | 443 |
442 bool ImageEventListener::operator==(const EventListener& listener) const | 444 bool ImageEventListener::operator==(const EventListener& listener) const |
443 { | 445 { |
444 if (const ImageEventListener* imageEventListener = ImageEventListener::cast(
&listener)) | 446 if (const ImageEventListener* imageEventListener = ImageEventListener::cast(
&listener)) |
445 return m_doc == imageEventListener->m_doc; | 447 return m_doc == imageEventListener->m_doc; |
446 return false; | 448 return false; |
447 } | 449 } |
448 | 450 |
449 } // namespace blink | 451 } // namespace blink |
OLD | NEW |