Chromium Code Reviews| Index: components/metrics/leak_detector/leak_detector_remote.mojom |
| diff --git a/components/metrics/leak_detector/leak_detector_remote.mojom b/components/metrics/leak_detector/leak_detector_remote.mojom |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..519a80793893320480a1d86f798b870459068c3a |
| --- /dev/null |
| +++ b/components/metrics/leak_detector/leak_detector_remote.mojom |
| @@ -0,0 +1,47 @@ |
| +// 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; |
| + |
| +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; |
| + |
| + enum ProcessType { |
| + UNKNOWN_PROCESS = 0, |
| + BROWSER_PROCESS = 1, |
| + RENDERER_PROCESS = 2, |
| + }; |
| + ProcessType process_type; |
| + |
| + array<AllocationBreakdown> alloc_breakdown_history; |
| +}; |
| + |
| +// Provides a remote interface for enabling LeakDetector on remote processes. |
| +interface LeakDetectorRemote { |
|
Ben Goodger (Google)
2016/06/17 22:22:03
Can we not use the *Remote suffix for something th
Simon Que
2016/06/18 04:17:53
I can't use "LeakDetector" because that name alrea
dcheng
2016/06/18 06:17:08
The general convention is to define mojo interface
|
| + // 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); |
| +}; |