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

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

Issue 1120003002: [Oilpan] Migrate most classes under core/animations to Oilpan heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Intentional nullptr access Created 5 years, 7 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) 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 return Animation::hasLowerPriority(left.get(), right.get()); 52 return Animation::hasLowerPriority(left.get(), right.get());
53 } 53 }
54 54
55 } 55 }
56 56
57 // This value represents 1 frame at 30Hz plus a little bit of wiggle room. 57 // This value represents 1 frame at 30Hz plus a little bit of wiggle room.
58 // TODO: Plumb a nominal framerate through and derive this value from that. 58 // TODO: Plumb a nominal framerate through and derive this value from that.
59 const double AnimationTimeline::s_minimumDelay = 0.04; 59 const double AnimationTimeline::s_minimumDelay = 0.04;
60 60
61 61
62 PassRefPtrWillBeRawPtr<AnimationTimeline> AnimationTimeline::create(Document* do cument, PassOwnPtrWillBeRawPtr<PlatformTiming> timing) 62 AnimationTimeline* AnimationTimeline::create(Document* document, PlatformTiming* timing)
63 { 63 {
64 return adoptRefWillBeNoop(new AnimationTimeline(document, timing)); 64 return new AnimationTimeline(document, timing);
65 } 65 }
66 66
67 AnimationTimeline::AnimationTimeline(Document* document, PassOwnPtrWillBeRawPtr< PlatformTiming> timing) 67 AnimationTimeline::AnimationTimeline(Document* document, PlatformTiming* timing)
68 : m_document(document) 68 : m_document(document)
69 , m_zeroTime(0) // 0 is used by unit tests which cannot initialize from the loader 69 , m_zeroTime(0) // 0 is used by unit tests which cannot initialize from the loader
70 , m_zeroTimeInitialized(false) 70 , m_zeroTimeInitialized(false)
71 , m_playbackRate(1) 71 , m_playbackRate(1)
72 , m_lastCurrentTimeInternal(0) 72 , m_lastCurrentTimeInternal(0)
73 { 73 {
74 if (!timing) 74 if (!timing)
75 m_timing = adoptPtrWillBeNoop(new AnimationTimelineTiming(this)); 75 m_timing = new AnimationTimelineTiming(this);
76 else 76 else
77 m_timing = timing; 77 m_timing = timing;
78 78
79 if (RuntimeEnabledFeatures::compositorAnimationTimelinesEnabled() && Platfor m::current()->compositorSupport()) 79 if (RuntimeEnabledFeatures::compositorAnimationTimelinesEnabled() && Platfor m::current()->compositorSupport())
80 m_compositorTimeline = adoptPtr(Platform::current()->compositorSupport() ->createAnimationTimeline()); 80 m_compositorTimeline = adoptPtr(Platform::current()->compositorSupport() ->createAnimationTimeline());
81 81
82 ASSERT(document); 82 ASSERT(document);
83 } 83 }
84 84
85 AnimationTimeline::~AnimationTimeline() 85 AnimationTimeline::~AnimationTimeline()
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 #if !ENABLE(OILPAN) 310 #if !ENABLE(OILPAN)
311 void AnimationTimeline::detachFromDocument() 311 void AnimationTimeline::detachFromDocument()
312 { 312 {
313 // FIXME: AnimationTimeline should keep Document alive. 313 // FIXME: AnimationTimeline should keep Document alive.
314 m_document = nullptr; 314 m_document = nullptr;
315 } 315 }
316 #endif 316 #endif
317 317
318 DEFINE_TRACE(AnimationTimeline) 318 DEFINE_TRACE(AnimationTimeline)
319 { 319 {
320 visitor->trace(m_timing);
320 #if ENABLE(OILPAN) 321 #if ENABLE(OILPAN)
321 visitor->trace(m_document); 322 visitor->trace(m_document);
322 visitor->trace(m_timing);
323 visitor->trace(m_animationsNeedingUpdate); 323 visitor->trace(m_animationsNeedingUpdate);
324 visitor->trace(m_animations); 324 visitor->trace(m_animations);
325 #endif 325 #endif
326 } 326 }
327 327
328 } // namespace 328 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698