Commit bdaadea6 authored by Hajime Hoshi's avatar Hajime Hoshi Committed by Commit Bot

inspector: Replace Timer usages with TaskRunnerTimer in ThreadDebugger

This is part of efforts to replace default timer task runners with
other appropriate task runners in the renderer.

Bug: 624694, 804694
Change-Id: Ia70a8e31394d9d3e6897271a0aa88027824467ef
Reviewed-on: https://chromium-review.googlesource.com/901062
Commit-Queue: Hajime Hoshi <hajimehoshi@chromium.org>
Reviewed-by: default avatarAlexei Filippov <alph@chromium.org>
Cr-Commit-Position: refs/heads/master@{#534666}
parent cb25260f
......@@ -27,6 +27,7 @@
#include "core/inspector/V8InspectorString.h"
#include "core/probe/CoreProbes.h"
#include "platform/bindings/ScriptForbiddenScope.h"
#include "platform/scheduler/child/web_scheduler.h"
#include "platform/wtf/PtrUtil.h"
#include "platform/wtf/Time.h"
......@@ -483,9 +484,11 @@ void ThreadDebugger::startRepeatingTimer(
timer_data_.push_back(data);
timer_callbacks_.push_back(callback);
std::unique_ptr<Timer<ThreadDebugger>> timer = WTF::WrapUnique(
new Timer<ThreadDebugger>(this, &ThreadDebugger::OnTimer));
Timer<ThreadDebugger>* timer_ptr = timer.get();
std::unique_ptr<TaskRunnerTimer<ThreadDebugger>> timer =
std::make_unique<TaskRunnerTimer<ThreadDebugger>>(
Platform::Current()->CurrentThread()->Scheduler()->V8TaskRunner(),
this, &ThreadDebugger::OnTimer);
TaskRunnerTimer<ThreadDebugger>* timer_ptr = timer.get();
timers_.push_back(std::move(timer));
timer_ptr->StartRepeating(TimeDelta::FromSecondsD(interval), FROM_HERE);
}
......
......@@ -111,7 +111,7 @@ class CORE_EXPORT ThreadDebugger : public v8_inspector::V8InspectorClient,
std::unique_ptr<v8_inspector::V8Inspector> v8_inspector_;
std::unique_ptr<v8::TracingCpuProfiler> v8_tracing_cpu_profiler_;
Vector<std::unique_ptr<Timer<ThreadDebugger>>> timers_;
Vector<std::unique_ptr<TaskRunnerTimer<ThreadDebugger>>> timers_;
Vector<v8_inspector::V8InspectorClient::TimerCallback> timer_callbacks_;
Vector<void*> timer_data_;
std::unique_ptr<UserGestureIndicator> user_gesture_indicator_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment