OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_PUBLIC_BROWSER_PROFILER_SUBSCRIBER_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_PROFILER_SUBSCRIBER_H_ |
6 #define CONTENT_PUBLIC_BROWSER_PROFILER_SUBSCRIBER_H_ | 6 #define CONTENT_PUBLIC_BROWSER_PROFILER_SUBSCRIBER_H_ |
7 | 7 |
| 8 #include "base/process.h" |
8 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
9 #include "content/public/common/process_type.h" | 10 #include "content/public/common/process_type.h" |
10 | 11 |
11 namespace tracked_objects { | 12 namespace tracked_objects { |
12 struct ProcessDataSnapshot; | 13 struct ProcessDataSnapshot; |
13 } | 14 } |
14 | 15 |
15 namespace content { | 16 namespace content { |
16 | 17 |
17 // Objects interested in receiving profiler data derive from ProfilerSubscriber. | 18 // Objects interested in receiving profiler data derive from ProfilerSubscriber. |
18 class CONTENT_EXPORT ProfilerSubscriber { | 19 class CONTENT_EXPORT ProfilerSubscriber { |
19 public: | 20 public: |
20 virtual ~ProfilerSubscriber() {} | 21 virtual ~ProfilerSubscriber() {} |
21 | 22 |
22 // Send number of pending processes to subscriber. |end| is set to true if it | 23 // Send number of pending processes to subscriber. |end| is set to true if it |
23 // is the last time. This is called on the UI thread. | 24 // is the last time. This is called on the UI thread. |
24 virtual void OnPendingProcesses(int sequence_number, | 25 virtual void OnPendingProcesses(int sequence_number, |
25 int pending_processes, | 26 int pending_processes, |
26 bool end) = 0; | 27 bool end) = 0; |
27 | 28 |
28 // Send |profiler_data| back to subscriber. | 29 // Send |profiler_data| back to subscriber. |
29 // This is called on the UI thread. | 30 // This is called on the UI thread. |
30 virtual void OnProfilerDataCollected( | 31 virtual void OnProfilerDataCollected( |
31 int sequence_number, | 32 int sequence_number, |
32 const tracked_objects::ProcessDataSnapshot& profiler_data, | 33 const tracked_objects::ProcessDataSnapshot& profiler_data, |
33 ProcessType process_type) = 0; | 34 ProcessType process_type) = 0; |
| 35 |
| 36 #if defined(USE_TCMALLOC) |
| 37 virtual void OnTcmallocStatsCollected(base::ProcessId pid, |
| 38 ProcessType process_type, |
| 39 const std::string& output) = 0; |
| 40 #endif |
| 41 |
34 }; | 42 }; |
35 | 43 |
36 } // namespace content | 44 } // namespace content |
37 | 45 |
38 #endif // CONTENT_PUBLIC_BROWSER_PROFILER_SUBSCRIBER_H_ | 46 #endif // CONTENT_PUBLIC_BROWSER_PROFILER_SUBSCRIBER_H_ |
OLD | NEW |