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

Side by Side Diff: third_party/WebKit/Source/core/dom/ScriptedIdleTaskController.cpp

Issue 2574773002: Migrate WTF::Vector::append() to ::push_back() [part 4 of N] (Closed)
Patch Set: rebase Created 4 years 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 // 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 "core/dom/ScriptedIdleTaskController.h" 5 #include "core/dom/ScriptedIdleTaskController.h"
6 6
7 #include "core/dom/ExecutionContext.h" 7 #include "core/dom/ExecutionContext.h"
8 #include "core/dom/IdleRequestCallback.h" 8 #include "core/dom/IdleRequestCallback.h"
9 #include "core/dom/IdleRequestOptions.h" 9 #include "core/dom/IdleRequestOptions.h"
10 #include "core/frame/PerformanceMonitor.h" 10 #include "core/frame/PerformanceMonitor.h"
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 void ScriptedIdleTaskController::callbackFired( 136 void ScriptedIdleTaskController::callbackFired(
137 CallbackId id, 137 CallbackId id,
138 double deadlineSeconds, 138 double deadlineSeconds,
139 IdleDeadline::CallbackType callbackType) { 139 IdleDeadline::CallbackType callbackType) {
140 if (!m_callbacks.contains(id)) 140 if (!m_callbacks.contains(id))
141 return; 141 return;
142 142
143 if (m_suspended) { 143 if (m_suspended) {
144 if (callbackType == IdleDeadline::CallbackType::CalledByTimeout) { 144 if (callbackType == IdleDeadline::CallbackType::CalledByTimeout) {
145 // Queue for execution when we are resumed. 145 // Queue for execution when we are resumed.
146 m_pendingTimeouts.append(id); 146 m_pendingTimeouts.push_back(id);
147 } 147 }
148 // Just drop callbacks called while suspended, these will be reposted on the 148 // Just drop callbacks called while suspended, these will be reposted on the
149 // idle task queue when we are resumed. 149 // idle task queue when we are resumed.
150 return; 150 return;
151 } 151 }
152 152
153 runCallback(id, deadlineSeconds, callbackType); 153 runCallback(id, deadlineSeconds, callbackType);
154 } 154 }
155 155
156 void ScriptedIdleTaskController::runCallback( 156 void ScriptedIdleTaskController::runCallback(
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 RefPtr<internal::IdleRequestCallbackWrapper> callbackWrapper = 212 RefPtr<internal::IdleRequestCallbackWrapper> callbackWrapper =
213 internal::IdleRequestCallbackWrapper::create(callback.key, this); 213 internal::IdleRequestCallbackWrapper::create(callback.key, this);
214 m_scheduler->postIdleTask( 214 m_scheduler->postIdleTask(
215 BLINK_FROM_HERE, 215 BLINK_FROM_HERE,
216 WTF::bind(&internal::IdleRequestCallbackWrapper::idleTaskFired, 216 WTF::bind(&internal::IdleRequestCallbackWrapper::idleTaskFired,
217 callbackWrapper)); 217 callbackWrapper));
218 } 218 }
219 } 219 }
220 220
221 } // namespace blink 221 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698