| OLD | NEW |
| 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" |
| 11 #include "platform/Histogram.h" | 11 #include "platform/Histogram.h" |
| 12 #include "platform/TraceEvent.h" | 12 #include "platform/tracing/TraceEvent.h" |
| 13 #include "public/platform/Platform.h" | 13 #include "public/platform/Platform.h" |
| 14 #include "public/platform/WebScheduler.h" | 14 #include "public/platform/WebScheduler.h" |
| 15 #include "public/platform/WebTraceLocation.h" | 15 #include "public/platform/WebTraceLocation.h" |
| 16 #include "wtf/CurrentTime.h" | 16 #include "wtf/CurrentTime.h" |
| 17 #include "wtf/Functional.h" | 17 #include "wtf/Functional.h" |
| 18 #include "wtf/RefCounted.h" | 18 #include "wtf/RefCounted.h" |
| 19 | 19 |
| 20 namespace blink { | 20 namespace blink { |
| 21 | 21 |
| 22 namespace internal { | 22 namespace internal { |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 runCallback(id, monotonicallyIncreasingTime(), IdleDeadline::CallbackTyp
e::CalledByTimeout); | 183 runCallback(id, monotonicallyIncreasingTime(), IdleDeadline::CallbackTyp
e::CalledByTimeout); |
| 184 | 184 |
| 185 // Repost idle tasks for any remaining callbacks. | 185 // Repost idle tasks for any remaining callbacks. |
| 186 for (auto& callback : m_callbacks) { | 186 for (auto& callback : m_callbacks) { |
| 187 RefPtr<internal::IdleRequestCallbackWrapper> callbackWrapper = internal:
:IdleRequestCallbackWrapper::create(callback.key, this); | 187 RefPtr<internal::IdleRequestCallbackWrapper> callbackWrapper = internal:
:IdleRequestCallbackWrapper::create(callback.key, this); |
| 188 m_scheduler->postIdleTask(BLINK_FROM_HERE, WTF::bind(&internal::IdleRequ
estCallbackWrapper::idleTaskFired, callbackWrapper)); | 188 m_scheduler->postIdleTask(BLINK_FROM_HERE, WTF::bind(&internal::IdleRequ
estCallbackWrapper::idleTaskFired, callbackWrapper)); |
| 189 } | 189 } |
| 190 } | 190 } |
| 191 | 191 |
| 192 } // namespace blink | 192 } // namespace blink |
| OLD | NEW |