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 "content/common/content_export.h" | 8 #include "content/common/content_export.h" |
9 #include "content/public/common/process_type.h" | |
10 | 9 |
11 namespace tracked_objects { | 10 namespace tracked_objects { |
12 struct ProcessDataSnapshot; | 11 struct ProcessDataSnapshot; |
13 } | 12 } |
14 | 13 |
15 namespace content { | 14 namespace content { |
16 | 15 |
17 // Objects interested in receiving profiler data derive from ProfilerSubscriber. | 16 // Objects interested in receiving profiler data derive from ProfilerSubscriber. |
18 class CONTENT_EXPORT ProfilerSubscriber { | 17 class CONTENT_EXPORT ProfilerSubscriber { |
19 public: | 18 public: |
20 // Send number of pending processes to subscriber. |end| is set to true if it | 19 // Send number of pending processes to subscriber. |end| is set to true if it |
21 // is the last time. This is called on the UI thread. | 20 // is the last time. This is called on the UI thread. |
22 virtual void OnPendingProcesses(int sequence_number, | 21 virtual void OnPendingProcesses(int sequence_number, |
23 int pending_processes, | 22 int pending_processes, |
24 bool end) = 0; | 23 bool end) = 0; |
25 | 24 |
26 // Send |profiler_data| back to subscriber. | 25 // Send |profiler_data| back to subscriber. |
27 // This is called on the UI thread. | 26 // This is called on the UI thread. |
28 virtual void OnProfilerDataCollected( | 27 virtual void OnProfilerDataCollected( |
29 int sequence_number, | 28 int sequence_number, |
30 const tracked_objects::ProcessDataSnapshot& profiler_data, | 29 const tracked_objects::ProcessDataSnapshot& profiler_data, |
31 ProcessType process_type) = 0; | 30 int process_type) = 0; |
32 | 31 |
33 protected: | 32 protected: |
34 virtual ~ProfilerSubscriber() {} | 33 virtual ~ProfilerSubscriber() {} |
35 }; | 34 }; |
36 | 35 |
37 } // namespace content | 36 } // namespace content |
38 | 37 |
39 #endif // CONTENT_PUBLIC_BROWSER_PROFILER_SUBSCRIBER_H_ | 38 #endif // CONTENT_PUBLIC_BROWSER_PROFILER_SUBSCRIBER_H_ |
OLD | NEW |