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

Side by Side Diff: Source/core/loader/ImageLoader.cpp

Issue 14741011: Error event was fired synchronously blowing away the input element from underneath. Remove the FIXM… (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « LayoutTests/fast/forms/image/image-error-event-crash-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010 Apple Inc. All rights reserv ed. 4 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010 Apple Inc. All rights reserv ed.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 // Security Policy, or the page is being dismissed. Trigger an 204 // Security Policy, or the page is being dismissed. Trigger an
205 // error event if the page is not being dismissed. 205 // error event if the page is not being dismissed.
206 if (!newImage && !pageIsBeingDismissed(document)) { 206 if (!newImage && !pageIsBeingDismissed(document)) {
207 m_failedLoadURL = attr; 207 m_failedLoadURL = attr;
208 m_hasPendingErrorEvent = true; 208 m_hasPendingErrorEvent = true;
209 errorEventSender().dispatchEventSoon(this); 209 errorEventSender().dispatchEventSoon(this);
210 } else 210 } else
211 clearFailedLoadURL(); 211 clearFailedLoadURL();
212 } else if (!attr.isNull()) { 212 } else if (!attr.isNull()) {
213 // Fire an error event if the url is empty. 213 // Fire an error event if the url is empty.
214 // FIXME: Should we fire this event asynchronoulsy via errorEventSender( )? 214 m_hasPendingErrorEvent = true;
215 m_element->dispatchEvent(Event::create(eventNames().errorEvent, false, f alse)); 215 errorEventSender().dispatchEventSoon(this);
216 } 216 }
217 217
218 CachedImage* oldImage = m_image.get(); 218 CachedImage* oldImage = m_image.get();
219 if (newImage != oldImage) { 219 if (newImage != oldImage) {
220 if (m_hasPendingBeforeLoadEvent) { 220 if (m_hasPendingBeforeLoadEvent) {
221 beforeLoadEventSender().cancelEvent(this); 221 beforeLoadEventSender().cancelEvent(this);
222 m_hasPendingBeforeLoadEvent = false; 222 m_hasPendingBeforeLoadEvent = false;
223 } 223 }
224 if (m_hasPendingLoadEvent) { 224 if (m_hasPendingLoadEvent) {
225 loadEventSender().cancelEvent(this); 225 loadEventSender().cancelEvent(this);
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 void ImageLoader::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const 478 void ImageLoader::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
479 { 479 {
480 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::Image); 480 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::Image);
481 info.addMember(m_element, "element"); 481 info.addMember(m_element, "element");
482 info.addMember(m_image.get(), "image", WTF::RetainingPointer); 482 info.addMember(m_image.get(), "image", WTF::RetainingPointer);
483 info.addMember(m_derefElementTimer, "derefElementTimer"); 483 info.addMember(m_derefElementTimer, "derefElementTimer");
484 info.addMember(m_failedLoadURL, "failedLoadURL"); 484 info.addMember(m_failedLoadURL, "failedLoadURL");
485 } 485 }
486 486
487 } 487 }
OLDNEW
« no previous file with comments | « LayoutTests/fast/forms/image/image-error-event-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698