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

Unified Diff: chrome/browser/metrics/leak_detector/leak_detector_remote_controller.h

Issue 2062743002: Randomly enable leak detector based on probability parameter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use RenderThreadObserver interface to shutdown remote client on same thread Created 4 years, 4 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: chrome/browser/metrics/leak_detector/leak_detector_remote_controller.h
diff --git a/chrome/browser/metrics/leak_detector/leak_detector_remote_controller.h b/chrome/browser/metrics/leak_detector/leak_detector_remote_controller.h
index bc511a46b966cccf53440f5ca8738ae8649b97f2..f9e267cbabc71b238212476caa118fc9965349a3 100644
--- a/chrome/browser/metrics/leak_detector/leak_detector_remote_controller.h
+++ b/chrome/browser/metrics/leak_detector/leak_detector_remote_controller.h
@@ -27,8 +27,10 @@ class LeakDetectorRemoteController : public mojom::LeakDetector {
virtual ~LocalController() {}
// Returns a set of leak detection params to be used when initializing the
- // leak detector on a remote process.
- virtual MemoryLeakReportProto::Params GetParams() const = 0;
+ // leak detector on a remote process. The controller may vary the parameters
+ // between each call to this function, and to change its internal state.
+ // Hence this is function is not const.
+ virtual MemoryLeakReportProto::Params GetParamsAndRecordRequest() = 0;
// Pass a vector of memory leak reports provided by a remote process to the
// local controller class.
@@ -56,8 +58,16 @@ class LeakDetectorRemoteController : public mojom::LeakDetector {
private:
explicit LeakDetectorRemoteController(mojom::LeakDetectorRequest request);
+ // Gets called when the remote process terminates and the Mojo connection gets
+ // closed as a result.
+ void OnRemoteProcessShutdown();
+
mojo::StrongBinding<mojom::LeakDetector> binding_;
+ // Indicates whether remote process received MemoryLeakReportProto::Params
+ // with a non-zero sampling rate, i.e. enabled leak detector.
+ bool leak_detector_enabled_on_remote_process_;
+
DISALLOW_COPY_AND_ASSIGN(LeakDetectorRemoteController);
};

Powered by Google App Engine
This is Rietveld 408576698