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

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

Issue 2713613003: Revert of DevTools: do not use RAII for sync native breakpoints, reuse AsyncTask where possible. (Closed)
Patch Set: 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 e3be451a71491ec3c0b57390b99f4d40d4e453d6..d74c1e8b58ffcdf8dbb53ecb620185c34050bb31 100644
--- a/third_party/WebKit/Source/core/frame/DOMTimer.cpp
+++ b/third_party/WebKit/Source/core/frame/DOMTimer.cpp
@@ -64,6 +64,8 @@
TRACE_EVENT_SCOPE_THREAD, "data",
InspectorTimerInstallEvent::data(context, timeoutID,
timeout, singleShot));
+ InspectorInstrumentation::NativeBreakpoint nativeBreakpoint(context,
+ "setTimer", true);
return timeoutID;
}
@@ -72,6 +74,8 @@
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)
timer->clearContext();
@@ -93,6 +97,9 @@
m_userGestureToken = UserGestureIndicator::currentToken();
}
+ InspectorInstrumentation::asyncTaskScheduled(
+ context, singleShot ? "setTimeout" : "setInterval", this, !singleShot);
+
double intervalMilliseconds =
std::max(oneMillisecond, interval * oneMillisecond);
if (intervalMilliseconds < minimumInterval &&
@@ -102,10 +109,6 @@
startOneShot(intervalMilliseconds, BLINK_FROM_HERE);
else
startRepeating(intervalMilliseconds, BLINK_FROM_HERE);
-
- suspendIfNeeded();
- InspectorInstrumentation::asyncTaskScheduledBreakable(
- context, singleShot ? "setTimeout" : "setInterval", this, !singleShot);
}
DOMTimer::~DOMTimer() {
@@ -114,10 +117,7 @@
}
void DOMTimer::stop() {
- InspectorInstrumentation::asyncTaskCanceledBreakable(
- getExecutionContext(),
- repeatInterval() ? "clearInterval" : "clearTimeout", this);
-
+ InspectorInstrumentation::asyncTaskCanceled(getExecutionContext(), this);
m_userGestureToken = nullptr;
// Need to release JS objects potentially protected by ScheduledAction
// because they can form circular references back to the ExecutionContext
@@ -145,7 +145,9 @@
InspectorTimerFireEvent::data(context, m_timeoutID));
PerformanceMonitor::HandlerCall handlerCall(
context, repeatInterval() ? "setInterval" : "setTimeout", true);
- InspectorInstrumentation::AsyncTask asyncTask(context, this, "timerFired");
+ InspectorInstrumentation::NativeBreakpoint nativeBreakpoint(
+ context, "timerFired", false);
+ InspectorInstrumentation::AsyncTask asyncTask(context, this);
// Simple case for non-one-shot timers.
if (isActive()) {

Powered by Google App Engine
This is Rietveld 408576698