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

Side by Side Diff: third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp

Issue 2908333002: Make Image::image_observer_ WeakPersistent (Closed)
Patch Set: Created 3 years, 6 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006 Eric Seidel <eric@webkit.org> 2 * Copyright (C) 2006 Eric Seidel <eric@webkit.org>
3 * Copyright (C) 2008, 2009 Apple Inc. All rights reserved. 3 * Copyright (C) 2008, 2009 Apple Inc. All rights reserved.
4 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 4 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after
570 if (!root_element) 570 if (!root_element)
571 return false; 571 return false;
572 return root_element->TimeContainer()->HasAnimations() || 572 return root_element->TimeContainer()->HasAnimations() ||
573 ToLocalFrame(page_->MainFrame()) 573 ToLocalFrame(page_->MainFrame())
574 ->GetDocument() 574 ->GetDocument()
575 ->Timeline() 575 ->Timeline()
576 .HasPendingUpdates(); 576 .HasPendingUpdates();
577 } 577 }
578 578
579 void SVGImage::ServiceAnimations(double monotonic_animation_start_time) { 579 void SVGImage::ServiceAnimations(double monotonic_animation_start_time) {
580 if (!GetImageObserver())
581 return;
582
580 // If none of our observers (sic!) are visible, or for some other reason 583 // If none of our observers (sic!) are visible, or for some other reason
581 // does not want us to keep running animations, stop them until further 584 // does not want us to keep running animations, stop them until further
582 // notice (next paint.) 585 // notice (next paint.)
583 if (GetImageObserver()->ShouldPauseAnimation(this)) { 586 if (GetImageObserver()->ShouldPauseAnimation(this)) {
584 StopAnimation(); 587 StopAnimation();
585 return; 588 return;
586 } 589 }
587 590
588 // serviceScriptedAnimations runs requestAnimationFrame callbacks, but SVG 591 // serviceScriptedAnimations runs requestAnimationFrame callbacks, but SVG
589 // images can't have any so we assert there's no script. 592 // images can't have any so we assert there's no script.
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
781 784
782 NOTREACHED(); 785 NOTREACHED();
783 return kSizeAvailable; 786 return kSizeAvailable;
784 } 787 }
785 788
786 String SVGImage::FilenameExtension() const { 789 String SVGImage::FilenameExtension() const {
787 return "svg"; 790 return "svg";
788 } 791 }
789 792
790 } // namespace blink 793 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698