| 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 base::TimeDelta wait_time); | 90 base::TimeDelta wait_time); |
| 91 | 91 |
| 92 // ------------------------------------------------------- | 92 // ------------------------------------------------------- |
| 93 // HistogramSubscriber methods for browser child processes | 93 // HistogramSubscriber methods for browser child processes |
| 94 // ------------------------------------------------------- | 94 // ------------------------------------------------------- |
| 95 | 95 |
| 96 // Update the number of pending processes for the given |sequence_number|. | 96 // Update the number of pending processes for the given |sequence_number|. |
| 97 // This is called on UI thread. | 97 // This is called on UI thread. |
| 98 virtual void OnPendingProcesses(int sequence_number, | 98 virtual void OnPendingProcesses(int sequence_number, |
| 99 int pending_processes, | 99 int pending_processes, |
| 100 bool end) OVERRIDE; | 100 bool end) override; |
| 101 | 101 |
| 102 // Send histogram_data back to caller and also record that we are waiting | 102 // Send histogram_data back to caller and also record that we are waiting |
| 103 // for one less histogram data from child process for the given sequence | 103 // for one less histogram data from child process for the given sequence |
| 104 // number. This method is accessible on UI thread. | 104 // number. This method is accessible on UI thread. |
| 105 virtual void OnHistogramDataCollected( | 105 virtual void OnHistogramDataCollected( |
| 106 int sequence_number, | 106 int sequence_number, |
| 107 const std::vector<std::string>& pickled_histograms) OVERRIDE; | 107 const std::vector<std::string>& pickled_histograms) override; |
| 108 | 108 |
| 109 // Set the callback_thread_ and callback_ members. If these members already | 109 // Set the callback_thread_ and callback_ members. If these members already |
| 110 // had values, then as a side effect, post the old callback_ to the old | 110 // had values, then as a side effect, post the old callback_ to the old |
| 111 // callaback_thread_. This side effect should not generally happen, but is in | 111 // callaback_thread_. This side effect should not generally happen, but is in |
| 112 // place to assure correctness (that any tasks that were set, are eventually | 112 // place to assure correctness (that any tasks that were set, are eventually |
| 113 // called, and never merely discarded). | 113 // called, and never merely discarded). |
| 114 void SetCallbackTaskAndThread(base::MessageLoop* callback_thread, | 114 void SetCallbackTaskAndThread(base::MessageLoop* callback_thread, |
| 115 const base::Closure& callback); | 115 const base::Closure& callback); |
| 116 | 116 |
| 117 void ForceHistogramSynchronizationDoneCallback(int sequence_number); | 117 void ForceHistogramSynchronizationDoneCallback(int sequence_number); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 145 // The sequence number used by the most recent asynchronous update request to | 145 // The sequence number used by the most recent asynchronous update request to |
| 146 // contact all processes. | 146 // contact all processes. |
| 147 int async_sequence_number_; | 147 int async_sequence_number_; |
| 148 | 148 |
| 149 DISALLOW_COPY_AND_ASSIGN(HistogramSynchronizer); | 149 DISALLOW_COPY_AND_ASSIGN(HistogramSynchronizer); |
| 150 }; | 150 }; |
| 151 | 151 |
| 152 } // namespace content | 152 } // namespace content |
| 153 | 153 |
| 154 #endif // CONTENT_BROWSER_HISTOGRAM_SYNCHRONIZER_H_ | 154 #endif // CONTENT_BROWSER_HISTOGRAM_SYNCHRONIZER_H_ |
| OLD | NEW |