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 CHROME_BROWSER_METRICS_TRACKING_SYNCHRONIZER_OBSERVER_H_ | 5 #ifndef CHROME_BROWSER_METRICS_TRACKING_SYNCHRONIZER_OBSERVER_H_ |
6 #define CHROME_BROWSER_METRICS_TRACKING_SYNCHRONIZER_OBSERVER_H_ | 6 #define CHROME_BROWSER_METRICS_TRACKING_SYNCHRONIZER_OBSERVER_H_ |
7 | 7 |
8 #include "content/public/common/process_type.h" | |
9 | |
10 namespace tracked_objects { | 8 namespace tracked_objects { |
11 struct ProcessDataSnapshot; | 9 struct ProcessDataSnapshot; |
12 } | 10 } |
13 | 11 |
14 namespace chrome_browser_metrics { | 12 namespace chrome_browser_metrics { |
15 | 13 |
16 // Observer for notifications from the TrackingSynchronizer class. | 14 // Observer for notifications from the TrackingSynchronizer class. |
17 class TrackingSynchronizerObserver { | 15 class TrackingSynchronizerObserver { |
18 public: | 16 public: |
19 // Received |profiler_data| from a single process of |process_type|. | 17 // Received |profiler_data| from a single process of |process_type|. |
20 // The observer should assume there might be more data coming until | 18 // The observer should assume there might be more data coming until |
21 // |FinishedReceivingData()| is called. | 19 // |FinishedReceivingData()| is called. |
22 virtual void ReceivedProfilerData( | 20 virtual void ReceivedProfilerData( |
23 const tracked_objects::ProcessDataSnapshot& profiler_data, | 21 const tracked_objects::ProcessDataSnapshot& profiler_data, |
24 content::ProcessType process_type) = 0; | 22 int process_type) = 0; |
25 | 23 |
26 // The observer should not expect any more calls to |ReceivedProfilerData()| | 24 // The observer should not expect any more calls to |ReceivedProfilerData()| |
27 // (without re-registering). This is sent either when data from all processes | 25 // (without re-registering). This is sent either when data from all processes |
28 // has been gathered, or when the request times out. | 26 // has been gathered, or when the request times out. |
29 virtual void FinishedReceivingProfilerData() {} | 27 virtual void FinishedReceivingProfilerData() {} |
30 | 28 |
31 protected: | 29 protected: |
32 TrackingSynchronizerObserver() {} | 30 TrackingSynchronizerObserver() {} |
33 virtual ~TrackingSynchronizerObserver() {} | 31 virtual ~TrackingSynchronizerObserver() {} |
34 | 32 |
35 private: | 33 private: |
36 DISALLOW_COPY_AND_ASSIGN(TrackingSynchronizerObserver); | 34 DISALLOW_COPY_AND_ASSIGN(TrackingSynchronizerObserver); |
37 }; | 35 }; |
38 | 36 |
39 } // namespace chrome_browser_metrics | 37 } // namespace chrome_browser_metrics |
40 | 38 |
41 #endif // CHROME_BROWSER_METRICS_TRACKING_SYNCHRONIZER_OBSERVER_H_ | 39 #endif // CHROME_BROWSER_METRICS_TRACKING_SYNCHRONIZER_OBSERVER_H_ |
OLD | NEW |