chromium/third_party/blink/public/mojom/leak_detector/leak_detector.mojom

// Copyright 2018 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

module blink.mojom;

// Result of leak detection - the number of different live Blink objects.
// LINT.IfChange(LeakDetectionResult)
struct LeakDetectionResult {
  uint32 number_of_live_audio_nodes;
  uint32 number_of_live_documents;
  uint32 number_of_live_nodes;
  uint32 number_of_live_layout_objects;
  uint32 number_of_live_resources;
  uint32 number_of_live_context_lifecycle_state_observers;
  uint32 number_of_live_frames;
  uint32 number_of_live_v8_per_context_data;
  uint32 number_of_worker_global_scopes;
  uint32 number_of_live_ua_css_resources;
  uint32 number_of_live_resource_fetchers;
};
// LINT.ThenChange(//content/browser/devtools/protocol/memory_handler.cc:GetDOMCounters)

// Leak detector clears out various global resources and then
// performs a garbage collection in Blink's managed heaps
// before reporting various Blink's objects counters.
interface LeakDetector {
  // The result may be empty because e.g. workers were still running and
  // leak detection was not able to terminate them.
  PerformLeakDetection() => (LeakDetectionResult? result);
};