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

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

Issue 892783003: Check the condition for animation policy of bitmapImage on notifyFinished. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Move updating policy to ImageLoader Created 5 years, 10 months 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
« no previous file with comments | « Source/core/fetch/ImageResource.h ('k') | Source/core/loader/ImageLoader.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 455 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 return true; 466 return true;
467 } 467 }
468 468
469 void ImageResource::animationAdvanced(const blink::Image* image) 469 void ImageResource::animationAdvanced(const blink::Image* image)
470 { 470 {
471 if (!image || image != m_image) 471 if (!image || image != m_image)
472 return; 472 return;
473 notifyObservers(); 473 notifyObservers();
474 } 474 }
475 475
476 void ImageResource::imageAnimationPolicy(const blink::Image* image, ImageAnimati onPolicy& policy) 476 void ImageResource::updateImageAnimationPolicy()
477 { 477 {
478 if (!image || image != m_image) 478 if (!m_image)
479 return; 479 return;
480 480
481 ImageAnimationPolicy newPolicy = ImageAnimationPolicyAllowed;
481 ResourceClientWalker<ImageResourceClient> w(m_clients); 482 ResourceClientWalker<ImageResourceClient> w(m_clients);
482 while (ImageResourceClient* c = w.next()) { 483 while (ImageResourceClient* c = w.next()) {
483 if (c->getImageAnimationPolicy(this, policy)) 484 if (c->getImageAnimationPolicy(this, newPolicy))
484 return; 485 break;
486 }
487
488 if (m_image->animationPolicy() != newPolicy) {
489 m_image->resetAnimation();
490 m_image->setAnimationPolicy(newPolicy);
485 } 491 }
486 } 492 }
487 493
488 void ImageResource::changedInRect(const blink::Image* image, const IntRect& rect ) 494 void ImageResource::changedInRect(const blink::Image* image, const IntRect& rect )
489 { 495 {
490 if (!image || image != m_image) 496 if (!image || image != m_image)
491 return; 497 return;
492 notifyObservers(&rect); 498 notifyObservers(&rect);
493 } 499 }
494 500
(...skipping 12 matching lines...) Expand all
507 if (response().wasFetchedViaServiceWorker()) 513 if (response().wasFetchedViaServiceWorker())
508 return response().serviceWorkerResponseType() != WebServiceWorkerRespons eTypeOpaque; 514 return response().serviceWorkerResponseType() != WebServiceWorkerRespons eTypeOpaque;
509 if (!image()->currentFrameHasSingleSecurityOrigin()) 515 if (!image()->currentFrameHasSingleSecurityOrigin())
510 return false; 516 return false;
511 if (passesAccessControlCheck(context, securityOrigin)) 517 if (passesAccessControlCheck(context, securityOrigin))
512 return true; 518 return true;
513 return !securityOrigin->taintsCanvas(response().url()); 519 return !securityOrigin->taintsCanvas(response().url());
514 } 520 }
515 521
516 } // namespace blink 522 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/fetch/ImageResource.h ('k') | Source/core/loader/ImageLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698