| 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_BROWSER_HISTOGRAM_SYNCHRONIZER_H_ | 5 #ifndef CONTENT_BROWSER_HISTOGRAM_SYNCHRONIZER_H_ |
| 6 #define CONTENT_BROWSER_HISTOGRAM_SYNCHRONIZER_H_ | 6 #define CONTENT_BROWSER_HISTOGRAM_SYNCHRONIZER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 // There is one final mode of use, where a renderer spontaneously decides to | 42 // There is one final mode of use, where a renderer spontaneously decides to |
| 43 // transmit a collection of histogram data. This is designed for use when the | 43 // transmit a collection of histogram data. This is designed for use when the |
| 44 // renderer is terminating. Unfortunately, renders may be terminated without | 44 // renderer is terminating. Unfortunately, renders may be terminated without |
| 45 // warning, and the best we can do is periodically acquire data from a tab, such | 45 // warning, and the best we can do is periodically acquire data from a tab, such |
| 46 // as when a page load has completed. In this mode, the renderer uses a | 46 // as when a page load has completed. In this mode, the renderer uses a |
| 47 // reserved sequence number, different from any sequence number that might be | 47 // reserved sequence number, different from any sequence number that might be |
| 48 // specified by a browser request. Since this sequence number can't match an | 48 // specified by a browser request. Since this sequence number can't match an |
| 49 // outstanding sequence number, the pickled data is accepted into the browser, | 49 // outstanding sequence number, the pickled data is accepted into the browser, |
| 50 // but there is no impact on the counters. | 50 // but there is no impact on the counters. |
| 51 | 51 |
| 52 class HistogramSynchronizer : public content::HistogramSubscriber { | 52 class HistogramSynchronizer : public HistogramSubscriber { |
| 53 public: | 53 public: |
| 54 enum ProcessHistogramRequester { | 54 enum ProcessHistogramRequester { |
| 55 UNKNOWN, | 55 UNKNOWN, |
| 56 ASYNC_HISTOGRAMS, | 56 ASYNC_HISTOGRAMS, |
| 57 }; | 57 }; |
| 58 | 58 |
| 59 // Return pointer to the singleton instance for the current process, or NULL | 59 // Return pointer to the singleton instance for the current process, or NULL |
| 60 // if none. | 60 // if none. |
| 61 static HistogramSynchronizer* GetInstance(); | 61 static HistogramSynchronizer* GetInstance(); |
| 62 | 62 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 // The sequence number used by the most recent asynchronous update request to | 142 // The sequence number used by the most recent asynchronous update request to |
| 143 // contact all processes. | 143 // contact all processes. |
| 144 int async_sequence_number_; | 144 int async_sequence_number_; |
| 145 | 145 |
| 146 DISALLOW_COPY_AND_ASSIGN(HistogramSynchronizer); | 146 DISALLOW_COPY_AND_ASSIGN(HistogramSynchronizer); |
| 147 }; | 147 }; |
| 148 | 148 |
| 149 } // namespace content | 149 } // namespace content |
| 150 | 150 |
| 151 #endif // CONTENT_BROWSER_HISTOGRAM_SYNCHRONIZER_H_ | 151 #endif // CONTENT_BROWSER_HISTOGRAM_SYNCHRONIZER_H_ |
| OLD | NEW |