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 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
525 } | 525 } |
526 | 526 |
527 void ImageResource::decodedSizeChangedTo(const blink::Image* image, | 527 void ImageResource::decodedSizeChangedTo(const blink::Image* image, |
528 size_t newSize) { | 528 size_t newSize) { |
529 if (!image || image != m_image) | 529 if (!image || image != m_image) |
530 return; | 530 return; |
531 | 531 |
532 setDecodedSize(newSize); | 532 setDecodedSize(newSize); |
533 } | 533 } |
534 | 534 |
535 void ImageResource::didDraw(const blink::Image* image) { | 535 void ImageResource::didDraw(const blink::Image* image) {} |
536 if (!image || image != m_image) | |
537 return; | |
538 // decodedSize() == 0 indicates that the image is decoded into | |
539 // DiscardableMemory, not in MemoryCache. So we don't need to call | |
540 // Resource::didAccessDecodedData() to update MemoryCache. | |
541 if (decodedSize() != 0) | |
542 Resource::didAccessDecodedData(); | |
543 } | |
544 | 536 |
545 bool ImageResource::shouldPauseAnimation(const blink::Image* image) { | 537 bool ImageResource::shouldPauseAnimation(const blink::Image* image) { |
546 if (!image || image != m_image) | 538 if (!image || image != m_image) |
547 return false; | 539 return false; |
548 | 540 |
549 for (auto* observer : m_finishedObservers.asVector()) { | 541 for (auto* observer : m_finishedObservers.asVector()) { |
550 if (m_finishedObservers.contains(observer) && observer->willRenderImage()) | 542 if (m_finishedObservers.contains(observer) && observer->willRenderImage()) |
551 return false; | 543 return false; |
552 } | 544 } |
553 | 545 |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
680 WebServiceWorkerResponseTypeOpaque; | 672 WebServiceWorkerResponseTypeOpaque; |
681 } | 673 } |
682 if (!getImage()->currentFrameHasSingleSecurityOrigin()) | 674 if (!getImage()->currentFrameHasSingleSecurityOrigin()) |
683 return false; | 675 return false; |
684 if (passesAccessControlCheck(securityOrigin)) | 676 if (passesAccessControlCheck(securityOrigin)) |
685 return true; | 677 return true; |
686 return !securityOrigin->taintsCanvas(response().url()); | 678 return !securityOrigin->taintsCanvas(response().url()); |
687 } | 679 } |
688 | 680 |
689 } // namespace blink | 681 } // namespace blink |
OLD | NEW |