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

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

Issue 2732643003: DevTools: remove PerformanceMonitor::HandlerCall, migrate to the new scoped probes. (Closed)
Patch Set: Introduce progress monitor Created 3 years, 9 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/frame/PerformanceMonitor.h" 10 #include "core/inspector/InspectorInstrumentation.h"
11 #include "core/inspector/InspectorTraceEvents.h" 11 #include "core/inspector/InspectorTraceEvents.h"
12 #include "platform/Histogram.h" 12 #include "platform/Histogram.h"
13 #include "platform/instrumentation/tracing/TraceEvent.h" 13 #include "platform/instrumentation/tracing/TraceEvent.h"
14 #include "public/platform/Platform.h" 14 #include "public/platform/Platform.h"
15 #include "public/platform/WebScheduler.h" 15 #include "public/platform/WebScheduler.h"
16 #include "public/platform/WebTraceLocation.h" 16 #include "public/platform/WebTraceLocation.h"
17 #include "wtf/CurrentTime.h" 17 #include "wtf/CurrentTime.h"
18 #include "wtf/Functional.h" 18 #include "wtf/Functional.h"
19 #include "wtf/RefCounted.h" 19 #include "wtf/RefCounted.h"
20 20
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 return; 163 return;
164 164
165 double allottedTimeMillis = 165 double allottedTimeMillis =
166 std::max((deadlineSeconds - monotonicallyIncreasingTime()) * 1000, 0.0); 166 std::max((deadlineSeconds - monotonicallyIncreasingTime()) * 1000, 0.0);
167 167
168 DEFINE_STATIC_LOCAL( 168 DEFINE_STATIC_LOCAL(
169 CustomCountHistogram, idleCallbackDeadlineHistogram, 169 CustomCountHistogram, idleCallbackDeadlineHistogram,
170 ("WebCore.ScriptedIdleTaskController.IdleCallbackDeadline", 0, 50, 50)); 170 ("WebCore.ScriptedIdleTaskController.IdleCallbackDeadline", 0, 50, 50));
171 idleCallbackDeadlineHistogram.count(allottedTimeMillis); 171 idleCallbackDeadlineHistogram.count(allottedTimeMillis);
172 172
173 PerformanceMonitor::HandlerCall handlerCall(getExecutionContext(), 173 probe::UserCallback probe(getExecutionContext(), "requestIdleCallback",
174 "requestIdleCallback", true); 174 AtomicString(), true);
175 TRACE_EVENT1( 175 TRACE_EVENT1(
176 "devtools.timeline", "FireIdleCallback", "data", 176 "devtools.timeline", "FireIdleCallback", "data",
177 InspectorIdleCallbackFireEvent::data( 177 InspectorIdleCallbackFireEvent::data(
178 getExecutionContext(), id, allottedTimeMillis, 178 getExecutionContext(), id, allottedTimeMillis,
179 callbackType == IdleDeadline::CallbackType::CalledByTimeout)); 179 callbackType == IdleDeadline::CallbackType::CalledByTimeout));
180 callback->handleEvent(IdleDeadline::create(deadlineSeconds, callbackType)); 180 callback->handleEvent(IdleDeadline::create(deadlineSeconds, callbackType));
181 181
182 double overrunMillis = 182 double overrunMillis =
183 std::max((monotonicallyIncreasingTime() - deadlineSeconds) * 1000, 0.0); 183 std::max((monotonicallyIncreasingTime() - deadlineSeconds) * 1000, 0.0);
184 184
(...skipping 27 matching lines...) Expand all
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