Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 63 } | 63 } |
| 64 | 64 |
| 65 DocumentTimeline::~DocumentTimeline() | 65 DocumentTimeline::~DocumentTimeline() |
| 66 { | 66 { |
| 67 for (HashSet<AnimationPlayer*>::iterator it = m_players.begin(); it != m_pla yers.end(); ++it) | 67 for (HashSet<AnimationPlayer*>::iterator it = m_players.begin(); it != m_pla yers.end(); ++it) |
| 68 (*it)->timelineDestroyed(); | 68 (*it)->timelineDestroyed(); |
| 69 } | 69 } |
| 70 | 70 |
| 71 AnimationPlayer* DocumentTimeline::createAnimationPlayer(TimedItem* child) | 71 AnimationPlayer* DocumentTimeline::createAnimationPlayer(TimedItem* child) |
| 72 { | 72 { |
| 73 RefPtr<AnimationPlayer> player = AnimationPlayer::create(*this, child); | 73 RefPtr<AnimationPlayer> player = AnimationPlayer::create(m_document ? m_docu ment->contextDocument().get() : 0, *this, child); |
|
alancutter (OOO until 2018)
2014/03/31 06:28:13
Ideally a JS handle to DocumentTimeline would keep
Eric Willigers
2014/03/31 08:48:47
Done.
| |
| 74 AnimationPlayer* result = player.get(); | 74 AnimationPlayer* result = player.get(); |
| 75 m_players.add(result); | 75 m_players.add(result); |
| 76 setOutdatedAnimationPlayer(result); | 76 setOutdatedAnimationPlayer(result); |
| 77 return result; | 77 return result; |
| 78 } | 78 } |
| 79 | 79 |
| 80 AnimationPlayer* DocumentTimeline::play(TimedItem* child) | 80 AnimationPlayer* DocumentTimeline::play(TimedItem* child) |
| 81 { | 81 { |
| 82 AnimationPlayer* player = createAnimationPlayer(child); | 82 AnimationPlayer* player = createAnimationPlayer(child); |
| 83 player->setStartTime(effectiveTime()); | 83 player->setStartTime(effectiveTime()); |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 187 count += (timedItem && (timedItem->isCurrent() || timedItem->isInEff ect())); | 187 count += (timedItem && (timedItem->isCurrent() || timedItem->isInEff ect())); |
| 188 } | 188 } |
| 189 return count; | 189 return count; |
| 190 } | 190 } |
| 191 | 191 |
| 192 void DocumentTimeline::detachFromDocument() { | 192 void DocumentTimeline::detachFromDocument() { |
| 193 m_document = 0; | 193 m_document = 0; |
| 194 } | 194 } |
| 195 | 195 |
| 196 } // namespace | 196 } // namespace |
| OLD | NEW |