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

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

Issue 2514643002: DevTools: support all handlers that end up with function call in perfmonitor. (Closed)
Patch Set: review comments addressed. Created 4 years, 1 month 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/FrameRequestCallbackCollection.h" 5 #include "core/dom/FrameRequestCallbackCollection.h"
6 6
7 #include "core/dom/FrameRequestCallback.h" 7 #include "core/dom/FrameRequestCallback.h"
8 #include "core/frame/PerformanceMonitor.h"
8 #include "core/inspector/InspectorInstrumentation.h" 9 #include "core/inspector/InspectorInstrumentation.h"
9 #include "core/inspector/InspectorTraceEvents.h" 10 #include "core/inspector/InspectorTraceEvents.h"
10 11
11 namespace blink { 12 namespace blink {
12 13
13 FrameRequestCallbackCollection::FrameRequestCallbackCollection( 14 FrameRequestCallbackCollection::FrameRequestCallbackCollection(
14 ExecutionContext* context) 15 ExecutionContext* context)
15 : m_context(context) {} 16 : m_context(context) {}
16 17
17 FrameRequestCallbackCollection::CallbackId 18 FrameRequestCallbackCollection::CallbackId
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 72
72 for (size_t i = 0; i < m_callbacksToInvoke.size(); ++i) { 73 for (size_t i = 0; i < m_callbacksToInvoke.size(); ++i) {
73 FrameRequestCallback* callback = m_callbacksToInvoke[i].get(); 74 FrameRequestCallback* callback = m_callbacksToInvoke[i].get();
74 if (!callback->m_cancelled) { 75 if (!callback->m_cancelled) {
75 TRACE_EVENT1( 76 TRACE_EVENT1(
76 "devtools.timeline", "FireAnimationFrame", "data", 77 "devtools.timeline", "FireAnimationFrame", "data",
77 InspectorAnimationFrameEvent::data(m_context, callback->m_id)); 78 InspectorAnimationFrameEvent::data(m_context, callback->m_id));
78 InspectorInstrumentation::NativeBreakpoint nativeBreakpoint( 79 InspectorInstrumentation::NativeBreakpoint nativeBreakpoint(
79 m_context, "animationFrameFired", false); 80 m_context, "animationFrameFired", false);
80 InspectorInstrumentation::AsyncTask asyncTask(m_context, callback); 81 InspectorInstrumentation::AsyncTask asyncTask(m_context, callback);
82 PerformanceMonitor::HandlerCall handlerCall(
83 m_context, "requestAnimationFrame", true);
81 if (callback->m_useLegacyTimeBase) 84 if (callback->m_useLegacyTimeBase)
82 callback->handleEvent(highResNowMsLegacy); 85 callback->handleEvent(highResNowMsLegacy);
83 else 86 else
84 callback->handleEvent(highResNowMs); 87 callback->handleEvent(highResNowMs);
85 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), 88 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"),
86 "UpdateCounters", TRACE_EVENT_SCOPE_THREAD, "data", 89 "UpdateCounters", TRACE_EVENT_SCOPE_THREAD, "data",
87 InspectorUpdateCountersEvent::data()); 90 InspectorUpdateCountersEvent::data());
88 } 91 }
89 } 92 }
90 93
91 m_callbacksToInvoke.clear(); 94 m_callbacksToInvoke.clear();
92 } 95 }
93 96
94 DEFINE_TRACE(FrameRequestCallbackCollection) { 97 DEFINE_TRACE(FrameRequestCallbackCollection) {
95 visitor->trace(m_callbacks); 98 visitor->trace(m_callbacks);
96 visitor->trace(m_callbacksToInvoke); 99 visitor->trace(m_callbacksToInvoke);
97 visitor->trace(m_context); 100 visitor->trace(m_context);
98 } 101 }
99 102
100 } // namespace blink 103 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698