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

Side by Side Diff: Source/core/frame/DOMTimerCoordinator.cpp

Issue 1334243004: Post DOMTimers on the corresponding LocalFrame's timer queue (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed layout test failures. Created 5 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/frame/DOMTimerCoordinator.h ('k') | Source/core/frame/FrameHost.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 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "core/frame/DOMTimerCoordinator.h" 6 #include "core/frame/DOMTimerCoordinator.h"
7 7
8 #include "core/dom/ExecutionContext.h" 8 #include "core/dom/ExecutionContext.h"
9 #include "core/frame/DOMTimer.h" 9 #include "core/frame/DOMTimer.h"
10 10
11 namespace blink { 11 namespace blink {
12 12
13 DOMTimerCoordinator::DOMTimerCoordinator() 13 DOMTimerCoordinator::DOMTimerCoordinator(WebTaskRunner* timerTaskRunner)
14 : m_circularSequentialID(0) 14 : m_circularSequentialID(0)
15 , m_timerNestingLevel(0) 15 , m_timerNestingLevel(0)
16 , m_timerTaskRunner(timerTaskRunner)
16 { 17 {
17 } 18 }
18 19
19 int DOMTimerCoordinator::installNewTimeout(ExecutionContext* context, PassOwnPtr WillBeRawPtr<ScheduledAction> action, int timeout, bool singleShot) 20 int DOMTimerCoordinator::installNewTimeout(ExecutionContext* context, PassOwnPtr WillBeRawPtr<ScheduledAction> action, int timeout, bool singleShot)
20 { 21 {
21 // FIXME: DOMTimers depends heavily on ExecutionContext. Decouple them. 22 // FIXME: DOMTimers depends heavily on ExecutionContext. Decouple them.
22 ASSERT(context->timers() == this); 23 ASSERT(context->timers() == this);
23 int timeoutID = nextID(); 24 int timeoutID = nextID();
24 TimeoutMap::AddResult result = m_timers.add(timeoutID, DOMTimer::create(cont ext, action, timeout, singleShot, timeoutID)); 25 TimeoutMap::AddResult result = m_timers.add(timeoutID, DOMTimer::create(cont ext, action, timeout, singleShot, timeoutID));
25 ASSERT(result.isNewEntry); 26 ASSERT(result.isNewEntry);
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 70
70 if (m_circularSequentialID <= 0) 71 if (m_circularSequentialID <= 0)
71 m_circularSequentialID = 1; 72 m_circularSequentialID = 1;
72 73
73 if (!m_timers.contains(m_circularSequentialID)) 74 if (!m_timers.contains(m_circularSequentialID))
74 return m_circularSequentialID; 75 return m_circularSequentialID;
75 } 76 }
76 } 77 }
77 78
78 } // namespace blink 79 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/frame/DOMTimerCoordinator.h ('k') | Source/core/frame/FrameHost.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698