Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(156)

Side by Side Diff: Source/core/fetch/ImageResource.cpp

Issue 754813002: Expose setting API to set ImageAnimationPolicy(Allowed, Once, None) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Support three options for animations Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 { 442 {
443 if (!image || image != m_image) 443 if (!image || image != m_image)
444 return; 444 return;
445 // decodedSize() == 0 indicates that the image is decoded into DiscardableMe mory, 445 // decodedSize() == 0 indicates that the image is decoded into DiscardableMe mory,
446 // not in MemoryCache. So we don't need to call Resource::didAccessDecodedDa ta() 446 // not in MemoryCache. So we don't need to call Resource::didAccessDecodedDa ta()
447 // to update MemoryCache. 447 // to update MemoryCache.
448 if (decodedSize() != 0) 448 if (decodedSize() != 0)
449 Resource::didAccessDecodedData(); 449 Resource::didAccessDecodedData();
450 } 450 }
451 451
452 bool ImageResource::shouldPauseAnimation(const blink::Image* image) 452 bool ImageResource::shouldPauseAnimation(const blink::Image* image, bool repeate d)
453 { 453 {
454 if (!image || image != m_image) 454 if (!image || image != m_image)
455 return false; 455 return false;
456 456
457 ResourceClientWalker<ImageResourceClient> w(m_clients); 457 ResourceClientWalker<ImageResourceClient> w(m_clients);
458 while (ImageResourceClient* c = w.next()) { 458 while (ImageResourceClient* c = w.next()) {
459 if (c->willRenderImage(this)) 459 if (c->willRenderImage(this, repeated))
460 return false; 460 return false;
461 } 461 }
462 462
463 return true; 463 return true;
464 } 464 }
465 465
466 void ImageResource::animationAdvanced(const blink::Image* image) 466 void ImageResource::animationAdvanced(const blink::Image* image)
467 { 467 {
468 if (!image || image != m_image) 468 if (!image || image != m_image)
469 return; 469 return;
(...skipping 20 matching lines...) Expand all
490 if (response().wasFetchedViaServiceWorker()) 490 if (response().wasFetchedViaServiceWorker())
491 return response().serviceWorkerResponseType() != WebServiceWorkerRespons eTypeOpaque; 491 return response().serviceWorkerResponseType() != WebServiceWorkerRespons eTypeOpaque;
492 if (!image()->currentFrameHasSingleSecurityOrigin()) 492 if (!image()->currentFrameHasSingleSecurityOrigin())
493 return false; 493 return false;
494 if (passesAccessControlCheck(securityOrigin)) 494 if (passesAccessControlCheck(securityOrigin))
495 return true; 495 return true;
496 return !securityOrigin->taintsCanvas(response().url()); 496 return !securityOrigin->taintsCanvas(response().url());
497 } 497 }
498 498
499 } // namespace blink 499 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698