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 // If decoding has already failed, there's no point in sending additiona
l data to the ImageResource. | 147 document()->cachedImage()->appendData(data, length); |
148 if (document()->cachedImage()->getStatus() != Resource::DecodeError) | |
149 document()->cachedImage()->appendData(data, length); | |
150 } | 148 } |
151 | 149 |
152 if (!isDetached()) | 150 if (!isDetached()) |
153 document()->imageUpdated(); | 151 document()->imageUpdated(); |
154 } | 152 } |
155 | 153 |
156 void ImageDocumentParser::finish() | 154 void ImageDocumentParser::finish() |
157 { | 155 { |
158 if (!isStopped() && document()->imageElement() && document()->cachedImage())
{ | 156 if (!isStopped() && document()->imageElement() && document()->cachedImage())
{ |
159 ImageResource* cachedImage = document()->cachedImage(); | 157 ImageResource* cachedImage = document()->cachedImage(); |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
442 } | 440 } |
443 | 441 |
444 bool ImageEventListener::operator==(const EventListener& listener) const | 442 bool ImageEventListener::operator==(const EventListener& listener) const |
445 { | 443 { |
446 if (const ImageEventListener* imageEventListener = ImageEventListener::cast(
&listener)) | 444 if (const ImageEventListener* imageEventListener = ImageEventListener::cast(
&listener)) |
447 return m_doc == imageEventListener->m_doc; | 445 return m_doc == imageEventListener->m_doc; |
448 return false; | 446 return false; |
449 } | 447 } |
450 | 448 |
451 } // namespace blink | 449 } // namespace blink |
OLD | NEW |