| 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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 if (!length) | 141 if (!length) |
| 142 return; | 142 return; |
| 143 | 143 |
| 144 LocalFrame* frame = document()->frame(); | 144 LocalFrame* frame = document()->frame(); |
| 145 Settings* settings = frame->settings(); | 145 Settings* settings = frame->settings(); |
| 146 if (!frame->loader().client()->allowImage( | 146 if (!frame->loader().client()->allowImage( |
| 147 !settings || settings->getImagesEnabled(), document()->url())) | 147 !settings || settings->getImagesEnabled(), document()->url())) |
| 148 return; | 148 return; |
| 149 | 149 |
| 150 if (document()->cachedImageResourceDeprecated()) { | 150 if (document()->cachedImageResourceDeprecated()) { |
| 151 RELEASE_ASSERT(length <= std::numeric_limits<unsigned>::max()); | 151 CHECK_LE(length, std::numeric_limits<unsigned>::max()); |
| 152 // If decoding has already failed, there's no point in sending additional | 152 // If decoding has already failed, there's no point in sending additional |
| 153 // data to the ImageResource. | 153 // data to the ImageResource. |
| 154 if (document()->cachedImageResourceDeprecated()->getStatus() != | 154 if (document()->cachedImageResourceDeprecated()->getStatus() != |
| 155 ResourceStatus::DecodeError) | 155 ResourceStatus::DecodeError) |
| 156 document()->cachedImageResourceDeprecated()->appendData(data, length); | 156 document()->cachedImageResourceDeprecated()->appendData(data, length); |
| 157 } | 157 } |
| 158 | 158 |
| 159 if (!isDetached()) | 159 if (!isDetached()) |
| 160 document()->imageUpdated(); | 160 document()->imageUpdated(); |
| 161 } | 161 } |
| (...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 623 } | 623 } |
| 624 | 624 |
| 625 bool ImageEventListener::operator==(const EventListener& listener) const { | 625 bool ImageEventListener::operator==(const EventListener& listener) const { |
| 626 if (const ImageEventListener* imageEventListener = | 626 if (const ImageEventListener* imageEventListener = |
| 627 ImageEventListener::cast(&listener)) | 627 ImageEventListener::cast(&listener)) |
| 628 return m_doc == imageEventListener->m_doc; | 628 return m_doc == imageEventListener->m_doc; |
| 629 return false; | 629 return false; |
| 630 } | 630 } |
| 631 | 631 |
| 632 } // namespace blink | 632 } // namespace blink |
| OLD | NEW |