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

Unified Diff: components/metrics/leak_detector/leak_detector.mojom

Issue 2064463002: Mojo interface/service for Leak Detector on remote process (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update ProtobufToMojoConverterTest Created 4 years, 5 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: components/metrics/leak_detector/leak_detector.mojom
diff --git a/components/metrics/leak_detector/leak_detector.mojom b/components/metrics/leak_detector/leak_detector.mojom
new file mode 100644
index 0000000000000000000000000000000000000000..d985b79024cc42b0c44a147bbed6aedcf2801cfb
--- /dev/null
+++ b/components/metrics/leak_detector/leak_detector.mojom
@@ -0,0 +1,40 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+module metrics.mojom;
+
+struct LeakDetectorParams {
+ float sampling_rate;
+ uint32 max_stack_depth;
+ uint64 analysis_interval_bytes;
+ uint32 size_suspicion_threshold;
+ uint32 call_stack_suspicion_threshold;
+};
+
+struct AllocationBreakdown {
+ array<uint32> counts_by_size;
+ uint32 count_for_call_stack;
+};
+
+struct MemoryLeakReport {
+ uint32 size_bytes;
+ array<uint64> call_stack;
+
+ array<AllocationBreakdown> alloc_breakdown_history;
+};
+
+// Provides a remote interface for enabling LeakDetector on remote processes.
+interface LeakDetector {
+ // Returns a LeakDetectorParams struct. Used to indicate to the remote process
+ // what parameters to use when initializing LeakDetector. Can also return
+ // |params.sampling_rate| == 0 to indicate that LeakDetector should not be
+ // initialized on a particular process.
+ GetParams() => (LeakDetectorParams params);
+
+ // When a remote process running LeakDetector gets some leak reports, it
+ // should call this function to return the leak reports back to the main
+ // process that implements this function. The reports should be sent back as
+ // an array of serialized MemoryLeakReportProtos.
+ SendLeakReports(array<MemoryLeakReport> reports);
+};
« no previous file with comments | « components/metrics/leak_detector/OWNERS ('k') | components/metrics/leak_detector/protobuf_to_mojo_converter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698