OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2012 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 void SVGImageChromeClient::SetTimer(std::unique_ptr<TimerBase> timer) { | 107 void SVGImageChromeClient::SetTimer(std::unique_ptr<TimerBase> timer) { |
108 animation_timer_ = std::move(timer); | 108 animation_timer_ = std::move(timer); |
109 } | 109 } |
110 | 110 |
111 void SVGImageChromeClient::AnimationTimerFired(TimerBase*) { | 111 void SVGImageChromeClient::AnimationTimerFired(TimerBase*) { |
112 if (!image_) | 112 if (!image_) |
113 return; | 113 return; |
114 | 114 |
115 // The SVGImageChromeClient object's lifetime is dependent on | 115 // The SVGImageChromeClient object's lifetime is dependent on |
116 // the ImageObserver (an ImageResourceContent) of its image. Should it | 116 // the ImageObserver (an ImageResourceContent) of its image. Should it |
117 // be dead and about to be lazily swept out, do not proceed. | 117 // be dead and about to be lazily swept out, then GetImageObserver() |
| 118 // becomes null and we do not proceed. |
118 // | 119 // |
119 // TODO(Oilpan): move (SVG)Image to the Oilpan heap, and avoid | 120 // TODO(Oilpan): move (SVG)Image to the Oilpan heap, and avoid |
120 // this explicit lifetime check. | 121 // this explicit lifetime check. |
121 if (ThreadHeap::WillObjectBeLazilySwept(image_->GetImageObserver())) | 122 if (!image_->GetImageObserver()) |
122 return; | 123 return; |
123 | 124 |
124 image_->ServiceAnimations(MonotonicallyIncreasingTime()); | 125 image_->ServiceAnimations(MonotonicallyIncreasingTime()); |
125 } | 126 } |
126 | 127 |
127 } // namespace blink | 128 } // namespace blink |
OLD | NEW |