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

Unified Diff: third_party/WebKit/Source/core/frame/DOMTimer.cpp

Issue 2700293002: DevTools: do not use RAII for sync native breakpoints, reuse AsyncTask where possible. (Closed)
Patch Set: Introduce progress monitor Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/frame/DOMTimer.cpp
diff --git a/third_party/WebKit/Source/core/frame/DOMTimer.cpp b/third_party/WebKit/Source/core/frame/DOMTimer.cpp
index d74c1e8b58ffcdf8dbb53ecb620185c34050bb31..0df21a23c9d175c98b7bb0406f91da7703771e65 100644
--- a/third_party/WebKit/Source/core/frame/DOMTimer.cpp
+++ b/third_party/WebKit/Source/core/frame/DOMTimer.cpp
@@ -64,8 +64,6 @@ int DOMTimer::install(ExecutionContext* context,
TRACE_EVENT_SCOPE_THREAD, "data",
InspectorTimerInstallEvent::data(context, timeoutID,
timeout, singleShot));
- InspectorInstrumentation::NativeBreakpoint nativeBreakpoint(context,
- "setTimer", true);
return timeoutID;
}
@@ -74,11 +72,12 @@ void DOMTimer::removeByID(ExecutionContext* context, int timeoutID) {
TRACE_EVENT_INSTANT1("devtools.timeline", "TimerRemove",
TRACE_EVENT_SCOPE_THREAD, "data",
InspectorTimerRemoveEvent::data(context, timeoutID));
- InspectorInstrumentation::NativeBreakpoint nativeBreakpoint(
- context, "clearTimer", true);
// Eagerly unregister as ExecutionContext observer.
- if (timer)
+ if (timer) {
+ InspectorInstrumentation::asyncTaskCanceledBreakable(context,
+ "clearTimeout", timer);
timer->clearContext();
+ }
}
DOMTimer::DOMTimer(ExecutionContext* context,
@@ -97,8 +96,8 @@ DOMTimer::DOMTimer(ExecutionContext* context,
m_userGestureToken = UserGestureIndicator::currentToken();
}
- InspectorInstrumentation::asyncTaskScheduled(
- context, singleShot ? "setTimeout" : "setInterval", this, !singleShot);
+ InspectorInstrumentation::asyncTaskScheduledBreakable(context, "setTimeout",
alph 2017/02/21 20:13:58 what happenned to setInterval?
+ this, !singleShot);
double intervalMilliseconds =
std::max(oneMillisecond, interval * oneMillisecond);
@@ -145,9 +144,7 @@ void DOMTimer::fired() {
InspectorTimerFireEvent::data(context, m_timeoutID));
PerformanceMonitor::HandlerCall handlerCall(
context, repeatInterval() ? "setInterval" : "setTimeout", true);
- InspectorInstrumentation::NativeBreakpoint nativeBreakpoint(
- context, "timerFired", false);
- InspectorInstrumentation::AsyncTask asyncTask(context, this);
+ InspectorInstrumentation::AsyncTask asyncTask(context, this, "timerFired");
// Simple case for non-one-shot timers.
if (isActive()) {

Powered by Google App Engine
This is Rietveld 408576698