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

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

Issue 1609343002: Move hasPendingActivity from ActiveDOMObject to ScriptWrappable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 // 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/inspector/InspectorTraceEvents.h" 10 #include "core/inspector/InspectorTraceEvents.h"
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 for (auto& id : pendingTimeouts) 152 for (auto& id : pendingTimeouts)
153 runCallback(id, monotonicallyIncreasingTime(), IdleDeadline::CallbackTyp e::CalledByTimeout); 153 runCallback(id, monotonicallyIncreasingTime(), IdleDeadline::CallbackTyp e::CalledByTimeout);
154 154
155 // Repost idle tasks for any remaining callbacks. 155 // Repost idle tasks for any remaining callbacks.
156 for (auto& callback : m_callbacks) { 156 for (auto& callback : m_callbacks) {
157 RefPtr<internal::IdleRequestCallbackWrapper> callbackWrapper = internal: :IdleRequestCallbackWrapper::create(callback.key, this); 157 RefPtr<internal::IdleRequestCallbackWrapper> callbackWrapper = internal: :IdleRequestCallbackWrapper::create(callback.key, this);
158 m_scheduler->postIdleTask(BLINK_FROM_HERE, WTF::bind<double>(&internal:: IdleRequestCallbackWrapper::idleTaskFired, callbackWrapper)); 158 m_scheduler->postIdleTask(BLINK_FROM_HERE, WTF::bind<double>(&internal:: IdleRequestCallbackWrapper::idleTaskFired, callbackWrapper));
159 } 159 }
160 } 160 }
161 161
162 bool ScriptedIdleTaskController::hasPendingActivity() const
163 {
164 return !m_callbacks.isEmpty();
165 }
166
167 } // namespace blink 162 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698