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

Side by Side Diff: Source/core/animation/DocumentTimeline.cpp

Issue 48523004: Have Player take the DocumentTimeline object by reference (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 1 month 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 | « no previous file | Source/core/animation/Player.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) 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 if (!timing) 56 if (!timing)
57 m_timing = adoptPtr(new DocumentTimelineTiming(this)); 57 m_timing = adoptPtr(new DocumentTimelineTiming(this));
58 else 58 else
59 m_timing = timing; 59 m_timing = timing;
60 60
61 ASSERT(document); 61 ASSERT(document);
62 } 62 }
63 63
64 PassRefPtr<Player> DocumentTimeline::play(TimedItem* child) 64 PassRefPtr<Player> DocumentTimeline::play(TimedItem* child)
65 { 65 {
66 RefPtr<Player> player = Player::create(this, child); 66 RefPtr<Player> player = Player::create(*this, child);
67 m_players.append(player); 67 m_players.append(player);
68 68
69 if (m_document->view()) 69 if (m_document->view())
70 m_timing->serviceOnNextFrame(); 70 m_timing->serviceOnNextFrame();
71 71
72 return player.release(); 72 return player.release();
73 } 73 }
74 74
75 void DocumentTimeline::wake() 75 void DocumentTimeline::wake()
76 { 76 {
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 } 150 }
151 151
152 size_t DocumentTimeline::numberOfActiveAnimationsForTesting() const 152 size_t DocumentTimeline::numberOfActiveAnimationsForTesting() const
153 { 153 {
154 // Includes all players whose directly associated timed items 154 // Includes all players whose directly associated timed items
155 // are current or in effect. 155 // are current or in effect.
156 return isNull(m_zeroTime) ? 0 : m_players.size(); 156 return isNull(m_zeroTime) ? 0 : m_players.size();
157 } 157 }
158 158
159 } // namespace 159 } // namespace
OLDNEW
« no previous file with comments | « no previous file | Source/core/animation/Player.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698