Chromium Code Reviews| 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 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 473 } | 473 } |
| 474 | 474 |
| 475 void ImageResource::decodedSizeChangedTo(const blink::Image* image, | 475 void ImageResource::decodedSizeChangedTo(const blink::Image* image, |
| 476 size_t newSize) { | 476 size_t newSize) { |
| 477 if (!image || image != m_image) | 477 if (!image || image != m_image) |
| 478 return; | 478 return; |
| 479 | 479 |
| 480 setDecodedSize(newSize); | 480 setDecodedSize(newSize); |
| 481 } | 481 } |
| 482 | 482 |
| 483 void ImageResource::didDraw(const blink::Image* image) { | 483 void ImageResource::didDraw(const blink::Image* image) { |
|
Nate Chapin
2016/10/21 18:48:20
Looks like this callback is ignored by all ImageOb
hiroshige
2016/10/24 10:35:28
Created a separate patch: https://codereview.chrom
| |
| 484 if (!image || image != m_image) | |
| 485 return; | |
| 486 // decodedSize() == 0 indicates that the image is decoded into | |
| 487 // DiscardableMemory, not in MemoryCache. So we don't need to call | |
| 488 // Resource::didAccessDecodedData() to update MemoryCache. | |
| 489 if (decodedSize() != 0) | |
| 490 Resource::didAccessDecodedData(); | |
| 491 } | 484 } |
| 492 | 485 |
| 493 bool ImageResource::shouldPauseAnimation(const blink::Image* image) { | 486 bool ImageResource::shouldPauseAnimation(const blink::Image* image) { |
| 494 if (!image || image != m_image) | 487 if (!image || image != m_image) |
| 495 return false; | 488 return false; |
| 496 | 489 |
| 497 for (auto* observer : m_finishedObservers.asVector()) { | 490 for (auto* observer : m_finishedObservers.asVector()) { |
| 498 if (m_finishedObservers.contains(observer) && observer->willRenderImage()) | 491 if (m_finishedObservers.contains(observer) && observer->willRenderImage()) |
| 499 return false; | 492 return false; |
| 500 } | 493 } |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 613 WebServiceWorkerResponseTypeOpaque; | 606 WebServiceWorkerResponseTypeOpaque; |
| 614 } | 607 } |
| 615 if (!getImage()->currentFrameHasSingleSecurityOrigin()) | 608 if (!getImage()->currentFrameHasSingleSecurityOrigin()) |
| 616 return false; | 609 return false; |
| 617 if (passesAccessControlCheck(securityOrigin)) | 610 if (passesAccessControlCheck(securityOrigin)) |
| 618 return true; | 611 return true; |
| 619 return !securityOrigin->taintsCanvas(response().url()); | 612 return !securityOrigin->taintsCanvas(response().url()); |
| 620 } | 613 } |
| 621 | 614 |
| 622 } // namespace blink | 615 } // namespace blink |
| OLD | NEW |