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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 Settings* settings = frame->settings(); | 147 Settings* settings = frame->settings(); |
148 if (!frame->loader().client()->allowImage( | 148 if (!frame->loader().client()->allowImage( |
149 !settings || settings->getImagesEnabled(), document()->url())) | 149 !settings || settings->getImagesEnabled(), document()->url())) |
150 return; | 150 return; |
151 | 151 |
152 if (document()->cachedImageResourceDeprecated()) { | 152 if (document()->cachedImageResourceDeprecated()) { |
153 RELEASE_ASSERT(length <= std::numeric_limits<unsigned>::max()); | 153 RELEASE_ASSERT(length <= std::numeric_limits<unsigned>::max()); |
154 // If decoding has already failed, there's no point in sending additional | 154 // If decoding has already failed, there's no point in sending additional |
155 // data to the ImageResource. | 155 // data to the ImageResource. |
156 if (document()->cachedImageResourceDeprecated()->getStatus() != | 156 if (document()->cachedImageResourceDeprecated()->getStatus() != |
157 Resource::DecodeError) | 157 ResourceStatus::DecodeError) |
158 document()->cachedImageResourceDeprecated()->appendData(data, length); | 158 document()->cachedImageResourceDeprecated()->appendData(data, length); |
159 } | 159 } |
160 | 160 |
161 if (!isDetached()) | 161 if (!isDetached()) |
162 document()->imageUpdated(); | 162 document()->imageUpdated(); |
163 } | 163 } |
164 | 164 |
165 void ImageDocumentParser::finish() { | 165 void ImageDocumentParser::finish() { |
166 if (!isStopped() && document()->imageElement() && | 166 if (!isStopped() && document()->imageElement() && |
167 document()->cachedImageResourceDeprecated()) { | 167 document()->cachedImageResourceDeprecated()) { |
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
625 } | 625 } |
626 | 626 |
627 bool ImageEventListener::operator==(const EventListener& listener) const { | 627 bool ImageEventListener::operator==(const EventListener& listener) const { |
628 if (const ImageEventListener* imageEventListener = | 628 if (const ImageEventListener* imageEventListener = |
629 ImageEventListener::cast(&listener)) | 629 ImageEventListener::cast(&listener)) |
630 return m_doc == imageEventListener->m_doc; | 630 return m_doc == imageEventListener->m_doc; |
631 return false; | 631 return false; |
632 } | 632 } |
633 | 633 |
634 } // namespace blink | 634 } // namespace blink |
OLD | NEW |