OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_METRICS_LEAK_DETECTOR_LEAK_DETECTOR_REMOTE_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_METRICS_LEAK_DETECTOR_LEAK_DETECTOR_REMOTE_CONTROLLER_H_ |
6 #define CHROME_BROWSER_METRICS_LEAK_DETECTOR_LEAK_DETECTOR_REMOTE_CONTROLLER_H_ | 6 #define CHROME_BROWSER_METRICS_LEAK_DETECTOR_LEAK_DETECTOR_REMOTE_CONTROLLER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 30 matching lines...) Expand all Loading... |
41 // (i.e. been given params with sampling_rate = 0). | 41 // (i.e. been given params with sampling_rate = 0). |
42 virtual void OnRemoteProcessShutdown() = 0; | 42 virtual void OnRemoteProcessShutdown() = 0; |
43 }; | 43 }; |
44 | 44 |
45 ~LeakDetectorRemoteController() override; | 45 ~LeakDetectorRemoteController() override; |
46 | 46 |
47 static void Create(const service_manager::BindSourceInfo& source_info, | 47 static void Create(const service_manager::BindSourceInfo& source_info, |
48 mojom::LeakDetectorRequest request); | 48 mojom::LeakDetectorRequest request); |
49 | 49 |
50 // mojom::LeakDetector: | 50 // mojom::LeakDetector: |
51 void GetParams( | 51 void GetParams(mojom::LeakDetector::GetParamsCallback callback) override; |
52 const mojom::LeakDetector::GetParamsCallback& callback) override; | |
53 void SendLeakReports(std::vector<mojom::MemoryLeakReportPtr>) override; | 52 void SendLeakReports(std::vector<mojom::MemoryLeakReportPtr>) override; |
54 | 53 |
55 // Sets a global pointer to a LocalController implementation. The global | 54 // Sets a global pointer to a LocalController implementation. The global |
56 // pointer is defined in the .cc file. | 55 // pointer is defined in the .cc file. |
57 static void SetLocalControllerInstance(LocalController* controller); | 56 static void SetLocalControllerInstance(LocalController* controller); |
58 | 57 |
59 private: | 58 private: |
60 LeakDetectorRemoteController(); | 59 LeakDetectorRemoteController(); |
61 | 60 |
62 // Gets called when the remote process terminates and the Mojo connection gets | 61 // Gets called when the remote process terminates and the Mojo connection gets |
63 // closed as a result. | 62 // closed as a result. |
64 void OnRemoteProcessShutdown(); | 63 void OnRemoteProcessShutdown(); |
65 | 64 |
66 // Indicates whether remote process received MemoryLeakReportProto::Params | 65 // Indicates whether remote process received MemoryLeakReportProto::Params |
67 // with a non-zero sampling rate, i.e. enabled leak detector. | 66 // with a non-zero sampling rate, i.e. enabled leak detector. |
68 bool leak_detector_enabled_on_remote_process_; | 67 bool leak_detector_enabled_on_remote_process_; |
69 | 68 |
70 DISALLOW_COPY_AND_ASSIGN(LeakDetectorRemoteController); | 69 DISALLOW_COPY_AND_ASSIGN(LeakDetectorRemoteController); |
71 }; | 70 }; |
72 | 71 |
73 } // namespace metrics | 72 } // namespace metrics |
74 | 73 |
75 #endif // CHROME_BROWSER_METRICS_LEAK_DETECTOR_LEAK_DETECTOR_REMOTE_CONTROLLER_
H_ | 74 #endif // CHROME_BROWSER_METRICS_LEAK_DETECTOR_LEAK_DETECTOR_REMOTE_CONTROLLER_
H_ |
OLD | NEW |