| 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 // called, and never merely discarded). | 111 // called, and never merely discarded). |
| 112 void SetCallbackTaskAndThread(MessageLoop* callback_thread, | 112 void SetCallbackTaskAndThread(MessageLoop* callback_thread, |
| 113 const base::Closure& callback); | 113 const base::Closure& callback); |
| 114 | 114 |
| 115 void ForceHistogramSynchronizationDoneCallback(int sequence_number); | 115 void ForceHistogramSynchronizationDoneCallback(int sequence_number); |
| 116 | 116 |
| 117 // Internal helper function, to post task, and record callback stats. | 117 // Internal helper function, to post task, and record callback stats. |
| 118 void InternalPostTask(MessageLoop* thread, const base::Closure& callback); | 118 void InternalPostTask(MessageLoop* thread, const base::Closure& callback); |
| 119 | 119 |
| 120 // Gets a new sequence number to be sent to processes from browser process. | 120 // Gets a new sequence number to be sent to processes from browser process. |
| 121 int GetNextAvailableSequenceNumber(ProcessHistogramRequester requster); | 121 int GetNextAvailableSequenceNumber(ProcessHistogramRequester requester); |
| 122 | 122 |
| 123 // This lock_ protects access to all members. | 123 // This lock_ protects access to all members. |
| 124 base::Lock lock_; | 124 base::Lock lock_; |
| 125 | 125 |
| 126 // When a request is made to asynchronously update the histograms, we store | 126 // When a request is made to asynchronously update the histograms, we store |
| 127 // the task and thread we use to post a completion notification in | 127 // the task and thread we use to post a completion notification in |
| 128 // callback_ and callback_thread_. | 128 // callback_ and callback_thread_. |
| 129 base::Closure callback_; | 129 base::Closure callback_; |
| 130 MessageLoop* callback_thread_; | 130 MessageLoop* callback_thread_; |
| 131 | 131 |
| (...skipping 10 matching lines...) Expand all 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 |