| 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 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 void ImageResource::destroyDecodedDataForFailedRevalidation() | 202 void ImageResource::destroyDecodedDataForFailedRevalidation() |
| 203 { | 203 { |
| 204 clearImage(); | 204 clearImage(); |
| 205 setDecodedSize(0); | 205 setDecodedSize(0); |
| 206 } | 206 } |
| 207 | 207 |
| 208 void ImageResource::destroyDecodedDataIfPossible() | 208 void ImageResource::destroyDecodedDataIfPossible() |
| 209 { | 209 { |
| 210 if (!m_image) | 210 if (!m_image) |
| 211 return; | 211 return; |
| 212 if ((!hasClientsOrObservers() && !isLoading() && m_image->hasOneRef() && m_i
mage->isBitmapImage()) || !errorOccurred()) | 212 CHECK(!errorOccurred()); |
| 213 m_image->destroyDecodedData(); | 213 m_image->destroyDecodedData(); |
| 214 } | 214 } |
| 215 | 215 |
| 216 void ImageResource::doResetAnimation() | 216 void ImageResource::doResetAnimation() |
| 217 { | 217 { |
| 218 if (m_image) | 218 if (m_image) |
| 219 m_image->resetAnimation(); | 219 m_image->resetAnimation(); |
| 220 } | 220 } |
| 221 | 221 |
| 222 void ImageResource::allClientsAndObserversRemoved() | 222 void ImageResource::allClientsAndObserversRemoved() |
| 223 { | 223 { |
| 224 if (m_image && !errorOccurred()) { | 224 if (m_image) { |
| 225 CHECK(!errorOccurred()); |
| 225 // If possible, delay the resetting until back at the event loop. | 226 // If possible, delay the resetting until back at the event loop. |
| 226 // Doing so after a conservative GC prevents resetAnimation() from | 227 // Doing so after a conservative GC prevents resetAnimation() from |
| 227 // upsetting ongoing animation updates (crbug.com/613709) | 228 // upsetting ongoing animation updates (crbug.com/613709) |
| 228 if (!ThreadHeap::willObjectBeLazilySwept(this)) | 229 if (!ThreadHeap::willObjectBeLazilySwept(this)) |
| 229 Platform::current()->currentThread()->getWebTaskRunner()->postTask(B
LINK_FROM_HERE, WTF::bind(&ImageResource::doResetAnimation, wrapWeakPersistent(t
his))); | 230 Platform::current()->currentThread()->getWebTaskRunner()->postTask(B
LINK_FROM_HERE, WTF::bind(&ImageResource::doResetAnimation, wrapWeakPersistent(t
his))); |
| 230 else | 231 else |
| 231 m_image->resetAnimation(); | 232 m_image->resetAnimation(); |
| 232 } | 233 } |
| 233 if (m_multipartParser) | 234 if (m_multipartParser) |
| 234 m_multipartParser->cancel(); | 235 m_multipartParser->cancel(); |
| (...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 593 if (response().wasFetchedViaServiceWorker()) | 594 if (response().wasFetchedViaServiceWorker()) |
| 594 return response().serviceWorkerResponseType() != WebServiceWorkerRespons
eTypeOpaque; | 595 return response().serviceWorkerResponseType() != WebServiceWorkerRespons
eTypeOpaque; |
| 595 if (!getImage()->currentFrameHasSingleSecurityOrigin()) | 596 if (!getImage()->currentFrameHasSingleSecurityOrigin()) |
| 596 return false; | 597 return false; |
| 597 if (passesAccessControlCheck(securityOrigin)) | 598 if (passesAccessControlCheck(securityOrigin)) |
| 598 return true; | 599 return true; |
| 599 return !securityOrigin->taintsCanvas(response().url()); | 600 return !securityOrigin->taintsCanvas(response().url()); |
| 600 } | 601 } |
| 601 | 602 |
| 602 } // namespace blink | 603 } // namespace blink |
| OLD | NEW |