diff options
Diffstat (limited to 'src/inspector_profiler.cc')
-rw-r--r-- | src/inspector_profiler.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/inspector_profiler.cc b/src/inspector_profiler.cc index 3444a9b9895..092b263ada2 100644 --- a/src/inspector_profiler.cc +++ b/src/inspector_profiler.cc @@ -295,6 +295,10 @@ void V8CoverageConnection::TakeCoverage() { DispatchMessage("Profiler.takePreciseCoverage", nullptr, true); } +void V8CoverageConnection::StopCoverage() { + DispatchMessage("Profiler.stopPreciseCoverage"); +} + void V8CoverageConnection::End() { Debug(env_, DebugCategory::INSPECTOR_PROFILER, @@ -489,6 +493,21 @@ static void TakeCoverage(const FunctionCallbackInfo<Value>& args) { } } +static void StopCoverage(const FunctionCallbackInfo<Value>& args) { + Environment* env = Environment::GetCurrent(args); + V8CoverageConnection* connection = env->coverage_connection(); + + Debug(env, + DebugCategory::INSPECTOR_PROFILER, + "StopCoverage, connection %s nullptr\n", + connection == nullptr ? "==" : "!="); + + if (connection != nullptr) { + Debug(env, DebugCategory::INSPECTOR_PROFILER, "Stopping coverage\n"); + connection->StopCoverage(); + } +} + static void Initialize(Local<Object> target, Local<Value> unused, Local<Context> context, @@ -497,6 +516,7 @@ static void Initialize(Local<Object> target, env->SetMethod(target, "setCoverageDirectory", SetCoverageDirectory); env->SetMethod(target, "setSourceMapCacheGetter", SetSourceMapCacheGetter); env->SetMethod(target, "takeCoverage", TakeCoverage); + env->SetMethod(target, "stopCoverage", StopCoverage); } } // namespace profiler |