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 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
444 if (!image || image != m_image) | 444 if (!image || image != m_image) |
445 return; | 445 return; |
446 notifyObservers(&rect); | 446 notifyObservers(&rect); |
447 } | 447 } |
448 | 448 |
449 bool ImageResource::currentFrameKnownToBeOpaque(const LayoutObject* layoutObject
) | 449 bool ImageResource::currentFrameKnownToBeOpaque(const LayoutObject* layoutObject
) |
450 { | 450 { |
451 blink::Image* image = this->image(); | 451 blink::Image* image = this->image(); |
452 if (image->isBitmapImage()) { | 452 if (image->isBitmapImage()) { |
453 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "PaintImage
", "data", InspectorPaintImageEvent::data(layoutObject, *this)); | 453 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "PaintImage
", "data", InspectorPaintImageEvent::data(layoutObject, *this)); |
454 // BitmapImage::currentFrameKnownToBeOpaque() conservatively returns tru
e for uncached | 454 // BitmapImage::currentFrameKnownToBeOpaque() conservatively returns fal
se for uncached |
455 // frames. To get an accurate answer, we pre-cache the current frame met
adata. | 455 // frames. To increase the change of an accurate answer, we pre-cache th
e current frame |
| 456 // metadata. |
456 image->imageForCurrentFrame(); | 457 image->imageForCurrentFrame(); |
457 } | 458 } |
458 return image->currentFrameKnownToBeOpaque(); | 459 return image->currentFrameKnownToBeOpaque(); |
459 } | 460 } |
460 | 461 |
461 bool ImageResource::isAccessAllowed(SecurityOrigin* securityOrigin) | 462 bool ImageResource::isAccessAllowed(SecurityOrigin* securityOrigin) |
462 { | 463 { |
463 if (response().wasFetchedViaServiceWorker()) | 464 if (response().wasFetchedViaServiceWorker()) |
464 return response().serviceWorkerResponseType() != WebServiceWorkerRespons
eTypeOpaque; | 465 return response().serviceWorkerResponseType() != WebServiceWorkerRespons
eTypeOpaque; |
465 if (!image()->currentFrameHasSingleSecurityOrigin()) | 466 if (!image()->currentFrameHasSingleSecurityOrigin()) |
466 return false; | 467 return false; |
467 if (passesAccessControlCheck(securityOrigin)) | 468 if (passesAccessControlCheck(securityOrigin)) |
468 return true; | 469 return true; |
469 return !securityOrigin->taintsCanvas(response().url()); | 470 return !securityOrigin->taintsCanvas(response().url()); |
470 } | 471 } |
471 | 472 |
472 bool ImageResource::loadingMultipartContent() const | 473 bool ImageResource::loadingMultipartContent() const |
473 { | 474 { |
474 return m_loader && m_loader->loadingMultipartContent(); | 475 return m_loader && m_loader->loadingMultipartContent(); |
475 } | 476 } |
476 | 477 |
477 } // namespace blink | 478 } // namespace blink |
OLD | NEW |