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

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: Update Code 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
« no previous file with comments | « Source/core/fetch/ImageResource.h ('k') | Source/core/fetch/ImageResourceClient.h » ('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 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
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;
470 notifyObservers(); 470 notifyObservers();
471 } 471 }
472 472
473 void ImageResource::imageAnimationPolicy(const blink::Image* image, ImageAnimati onPolicy& policy)
474 {
475 if (!image || image != m_image)
476 return;
477
478 ResourceClientWalker<ImageResourceClient> w(m_clients);
479 while (ImageResourceClient* c = w.next()) {
480 if (c->getImageAnimationPolicy(this, policy))
481 return;
482 }
483 }
484
473 void ImageResource::changedInRect(const blink::Image* image, const IntRect& rect ) 485 void ImageResource::changedInRect(const blink::Image* image, const IntRect& rect )
474 { 486 {
475 if (!image || image != m_image) 487 if (!image || image != m_image)
476 return; 488 return;
477 notifyObservers(&rect); 489 notifyObservers(&rect);
478 } 490 }
479 491
480 bool ImageResource::currentFrameKnownToBeOpaque(const RenderObject* renderer) 492 bool ImageResource::currentFrameKnownToBeOpaque(const RenderObject* renderer)
481 { 493 {
482 blink::Image* image = imageForRenderer(renderer); 494 blink::Image* image = imageForRenderer(renderer);
483 if (image->isBitmapImage()) { 495 if (image->isBitmapImage()) {
484 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "PaintImage ", "data", InspectorPaintImageEvent::data(renderer, *this)); 496 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "PaintImage ", "data", InspectorPaintImageEvent::data(renderer, *this));
485 image->nativeImageForCurrentFrame(); // force decode 497 image->nativeImageForCurrentFrame(); // force decode
486 } 498 }
487 return image->currentFrameKnownToBeOpaque(); 499 return image->currentFrameKnownToBeOpaque();
488 } 500 }
489 501
490 bool ImageResource::isAccessAllowed(SecurityOrigin* securityOrigin) 502 bool ImageResource::isAccessAllowed(SecurityOrigin* securityOrigin)
491 { 503 {
492 if (response().wasFetchedViaServiceWorker()) 504 if (response().wasFetchedViaServiceWorker())
493 return response().serviceWorkerResponseType() != WebServiceWorkerRespons eTypeOpaque; 505 return response().serviceWorkerResponseType() != WebServiceWorkerRespons eTypeOpaque;
494 if (!image()->currentFrameHasSingleSecurityOrigin()) 506 if (!image()->currentFrameHasSingleSecurityOrigin())
495 return false; 507 return false;
496 if (passesAccessControlCheck(securityOrigin)) 508 if (passesAccessControlCheck(securityOrigin))
497 return true; 509 return true;
498 return !securityOrigin->taintsCanvas(response().url()); 510 return !securityOrigin->taintsCanvas(response().url());
499 } 511 }
500 512
501 } // namespace blink 513 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/fetch/ImageResource.h ('k') | Source/core/fetch/ImageResourceClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698