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

Side by Side Diff: sky/engine/core/frame/DOMTimer.cpp

Issue 922893002: Merge the Sky Engine changes from the SkyDart branch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « sky/engine/core/frame/DOMTimer.h ('k') | sky/engine/core/frame/DOMWindowBase64.cpp » ('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) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 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 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 if (isActive()) { 107 if (isActive()) {
108 if (repeatInterval() && repeatInterval() < minimumInterval) { 108 if (repeatInterval() && repeatInterval() < minimumInterval) {
109 m_nestingLevel++; 109 m_nestingLevel++;
110 if (m_nestingLevel >= maxTimerNestingLevel) 110 if (m_nestingLevel >= maxTimerNestingLevel)
111 augmentRepeatInterval(minimumInterval - repeatInterval()); 111 augmentRepeatInterval(minimumInterval - repeatInterval());
112 } 112 }
113 113
114 WTF_LOG(Timers, "DOMTimer::fired: m_timeoutID = %d, repeatInterval = %f, m_action = %p", m_timeoutID, repeatInterval(), m_action.get()); 114 WTF_LOG(Timers, "DOMTimer::fired: m_timeoutID = %d, repeatInterval = %f, m_action = %p", m_timeoutID, repeatInterval(), m_action.get());
115 115
116 // No access to member variables after this point, it can delete the tim er. 116 // No access to member variables after this point, it can delete the tim er.
117 m_action->execute(context); 117 m_action->Execute(context);
118 return; 118 return;
119 } 119 }
120 120
121 WTF_LOG(Timers, "DOMTimer::fired: m_timeoutID = %d, one-shot, m_action = %p" , m_timeoutID, m_action.get()); 121 WTF_LOG(Timers, "DOMTimer::fired: m_timeoutID = %d, one-shot, m_action = %p" , m_timeoutID, m_action.get());
122 122
123 // Delete timer before executing the action for one-shot timers. 123 // Delete timer before executing the action for one-shot timers.
124 OwnPtr<ScheduledAction> action = m_action.release(); 124 OwnPtr<ScheduledAction> action = m_action.release();
125 125
126 // This timer is being deleted; no access to member variables allowed after this point. 126 // This timer is being deleted; no access to member variables allowed after this point.
127 context->removeTimeoutByID(m_timeoutID); 127 context->removeTimeoutByID(m_timeoutID);
128 128
129 action->execute(context); 129 action->Execute(context);
130 130
131 timerNestingLevel = 0; 131 timerNestingLevel = 0;
132 } 132 }
133 133
134 void DOMTimer::contextDestroyed() 134 void DOMTimer::contextDestroyed()
135 { 135 {
136 SuspendableTimer::contextDestroyed(); 136 SuspendableTimer::contextDestroyed();
137 } 137 }
138 138
139 void DOMTimer::stop() 139 void DOMTimer::stop()
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 if (fireTime - alignedTimeRoundedDown < minimumInterval) 175 if (fireTime - alignedTimeRoundedDown < minimumInterval)
176 return alignedTimeRoundedDown; 176 return alignedTimeRoundedDown;
177 177
178 return alignedTimeRoundedUp; 178 return alignedTimeRoundedUp;
179 } 179 }
180 180
181 return fireTime; 181 return fireTime;
182 } 182 }
183 183
184 } // namespace blink 184 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/frame/DOMTimer.h ('k') | sky/engine/core/frame/DOMWindowBase64.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698