| 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 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 // queried for info (like size or specific image frames). | 382 // queried for info (like size or specific image frames). |
| 383 if (m_data) { | 383 if (m_data) { |
| 384 DCHECK(m_image); | 384 DCHECK(m_image); |
| 385 sizeAvailable = m_image->setData(m_data, allDataReceived); | 385 sizeAvailable = m_image->setData(m_data, allDataReceived); |
| 386 } | 386 } |
| 387 | 387 |
| 388 // Go ahead and tell our observers to try to draw if we have either | 388 // Go ahead and tell our observers to try to draw if we have either |
| 389 // received all the data or the size is known. Each chunk from the | 389 // received all the data or the size is known. Each chunk from the |
| 390 // network causes observers to repaint, which will force that chunk | 390 // network causes observers to repaint, which will force that chunk |
| 391 // to decode. | 391 // to decode. |
| 392 if (sizeAvailable || allDataReceived) { | 392 if (!sizeAvailable && !allDataReceived) |
| 393 if (!m_image || m_image->isNull()) { | 393 return; |
| 394 if (!errorOccurred()) | 394 if (errorOccurred()) |
| 395 setStatus(DecodeError); | 395 return; |
| 396 clear(); | 396 if (!m_image || m_image->isNull()) { |
| 397 if (memoryCache()->contains(this)) | 397 setStatus(DecodeError); |
| 398 memoryCache()->remove(this); | 398 if (!allDataReceived && m_loader) |
| 399 } | 399 m_loader->didFinishLoading(nullptr, monotonicallyIncreasingTime(), e
ncodedSize()); |
| 400 clear(); |
| 401 memoryCache()->remove(this); |
| 402 } |
| 400 | 403 |
| 401 // It would be nice to only redraw the decoded band of the image, but wi
th the current design | 404 // It would be nice to only redraw the decoded band of the image, but with t
he current design |
| 402 // (decoding delayed until painting) that seems hard. | 405 // (decoding delayed until painting) that seems hard. |
| 403 notifyObservers(); | 406 notifyObservers(); |
| 404 } | |
| 405 } | 407 } |
| 406 | 408 |
| 407 void ImageResource::updateImageAndClearBuffer() | 409 void ImageResource::updateImageAndClearBuffer() |
| 408 { | 410 { |
| 409 clearImage(); | 411 clearImage(); |
| 410 updateImage(true); | 412 updateImage(true); |
| 411 m_data.clear(); | 413 m_data.clear(); |
| 412 } | 414 } |
| 413 | 415 |
| 414 void ImageResource::finish(double loadFinishTime) | 416 void ImageResource::finish(double loadFinishTime) |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 585 if (response().wasFetchedViaServiceWorker()) | 587 if (response().wasFetchedViaServiceWorker()) |
| 586 return response().serviceWorkerResponseType() != WebServiceWorkerRespons
eTypeOpaque; | 588 return response().serviceWorkerResponseType() != WebServiceWorkerRespons
eTypeOpaque; |
| 587 if (!getImage()->currentFrameHasSingleSecurityOrigin()) | 589 if (!getImage()->currentFrameHasSingleSecurityOrigin()) |
| 588 return false; | 590 return false; |
| 589 if (passesAccessControlCheck(securityOrigin)) | 591 if (passesAccessControlCheck(securityOrigin)) |
| 590 return true; | 592 return true; |
| 591 return !securityOrigin->taintsCanvas(response().url()); | 593 return !securityOrigin->taintsCanvas(response().url()); |
| 592 } | 594 } |
| 593 | 595 |
| 594 } // namespace blink | 596 } // namespace blink |
| OLD | NEW |