diff options
Diffstat (limited to 'deps/v8/src/inspector/v8-heap-profiler-agent-impl.cc')
-rw-r--r-- | deps/v8/src/inspector/v8-heap-profiler-agent-impl.cc | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/deps/v8/src/inspector/v8-heap-profiler-agent-impl.cc b/deps/v8/src/inspector/v8-heap-profiler-agent-impl.cc index 6472c5ca94..b441be565c 100644 --- a/deps/v8/src/inspector/v8-heap-profiler-agent-impl.cc +++ b/deps/v8/src/inspector/v8-heap-profiler-agent-impl.cc @@ -232,10 +232,12 @@ Response V8HeapProfilerAgentImpl::startTrackingHeapObjects( } Response V8HeapProfilerAgentImpl::stopTrackingHeapObjects( - Maybe<bool> reportProgress, Maybe<bool> treatGlobalObjectsAsRoots) { + Maybe<bool> reportProgress, Maybe<bool> treatGlobalObjectsAsRoots, + Maybe<bool> captureNumericValue) { requestHeapStatsUpdate(); takeHeapSnapshot(std::move(reportProgress), - std::move(treatGlobalObjectsAsRoots)); + std::move(treatGlobalObjectsAsRoots), + std::move(captureNumericValue)); stopTrackingHeapObjectsInternal(); return Response::Success(); } @@ -258,7 +260,8 @@ Response V8HeapProfilerAgentImpl::disable() { } Response V8HeapProfilerAgentImpl::takeHeapSnapshot( - Maybe<bool> reportProgress, Maybe<bool> treatGlobalObjectsAsRoots) { + Maybe<bool> reportProgress, Maybe<bool> treatGlobalObjectsAsRoots, + Maybe<bool> captureNumericValue) { v8::HeapProfiler* profiler = m_isolate->GetHeapProfiler(); if (!profiler) return Response::ServerError("Cannot access v8 heap profiler"); std::unique_ptr<HeapSnapshotProgress> progress; @@ -267,7 +270,8 @@ Response V8HeapProfilerAgentImpl::takeHeapSnapshot( GlobalObjectNameResolver resolver(m_session); const v8::HeapSnapshot* snapshot = profiler->TakeHeapSnapshot( - progress.get(), &resolver, treatGlobalObjectsAsRoots.fromMaybe(true)); + progress.get(), &resolver, treatGlobalObjectsAsRoots.fromMaybe(true), + captureNumericValue.fromMaybe(false)); if (!snapshot) return Response::ServerError("Failed to take heap snapshot"); HeapSnapshotOutputStream stream(&m_frontend); snapshot->Serialize(&stream); @@ -375,6 +379,9 @@ Response V8HeapProfilerAgentImpl::startSampling( const unsigned defaultSamplingInterval = 1 << 15; double samplingIntervalValue = samplingInterval.fromMaybe(defaultSamplingInterval); + if (samplingIntervalValue <= 0.0) { + return Response::ServerError("Invalid sampling interval"); + } m_state->setDouble(HeapProfilerAgentState::samplingHeapProfilerInterval, samplingIntervalValue); m_state->setBoolean(HeapProfilerAgentState::samplingHeapProfilerEnabled, |