OLD | NEW |
1 /* | 1 /* |
2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) | 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) |
3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) | 3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) |
4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) | 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) |
5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) | 5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) |
6 Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. | 6 Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. |
7 | 7 |
8 This library is free software; you can redistribute it and/or | 8 This library is free software; you can redistribute it and/or |
9 modify it under the terms of the GNU Library General Public | 9 modify it under the terms of the GNU Library General Public |
10 License as published by the Free Software Foundation; either | 10 License as published by the Free Software Foundation; either |
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 if (m_image) | 362 if (m_image) |
363 sizeAvailable = m_image->setData(m_data, allDataReceived); | 363 sizeAvailable = m_image->setData(m_data, allDataReceived); |
364 | 364 |
365 // Go ahead and tell our observers to try to draw if we have either | 365 // Go ahead and tell our observers to try to draw if we have either |
366 // received all the data or the size is known. Each chunk from the | 366 // received all the data or the size is known. Each chunk from the |
367 // network causes observers to repaint, which will force that chunk | 367 // network causes observers to repaint, which will force that chunk |
368 // to decode. | 368 // to decode. |
369 if (sizeAvailable || allDataReceived) { | 369 if (sizeAvailable || allDataReceived) { |
370 if (!m_image || m_image->isNull()) { | 370 if (!m_image || m_image->isNull()) { |
371 error(errorOccurred() ? status() : DecodeError); | 371 error(errorOccurred() ? status() : DecodeError); |
372 if (inCache()) | 372 if (memoryCache()->contains(this)) |
373 memoryCache()->remove(this); | 373 memoryCache()->remove(this); |
374 return; | 374 return; |
375 } | 375 } |
376 | 376 |
377 // It would be nice to only redraw the decoded band of the image, but wi
th the current design | 377 // It would be nice to only redraw the decoded band of the image, but wi
th the current design |
378 // (decoding delayed until painting) that seems hard. | 378 // (decoding delayed until painting) that seems hard. |
379 notifyObservers(); | 379 notifyObservers(); |
380 } | 380 } |
381 } | 381 } |
382 | 382 |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
472 bool ImageResource::isAccessAllowed(SecurityOrigin* securityOrigin) | 472 bool ImageResource::isAccessAllowed(SecurityOrigin* securityOrigin) |
473 { | 473 { |
474 if (!image()->currentFrameHasSingleSecurityOrigin()) | 474 if (!image()->currentFrameHasSingleSecurityOrigin()) |
475 return false; | 475 return false; |
476 if (passesAccessControlCheck(securityOrigin)) | 476 if (passesAccessControlCheck(securityOrigin)) |
477 return true; | 477 return true; |
478 return !securityOrigin->taintsCanvas(response().url()); | 478 return !securityOrigin->taintsCanvas(response().url()); |
479 } | 479 } |
480 | 480 |
481 } // namespace WebCore | 481 } // namespace WebCore |
OLD | NEW |