OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "chrome/browser/metrics/histogram_synchronizer.h" | 5 #include "chrome/browser/metrics/histogram_synchronizer.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "base/threading/thread.h" | 9 #include "base/threading/thread.h" |
10 #include "chrome/common/chrome_constants.h" | 10 #include "chrome/common/chrome_constants.h" |
11 #include "chrome/common/render_messages.h" | 11 #include "chrome/common/render_messages.h" |
12 #include "content/browser/renderer_host/render_process_host.h" | |
13 #include "content/public/browser/browser_thread.h" | 12 #include "content/public/browser/browser_thread.h" |
| 13 #include "content/public/browser/render_process_host.h" |
14 | 14 |
15 using base::Time; | 15 using base::Time; |
16 using base::TimeDelta; | 16 using base::TimeDelta; |
17 using base::TimeTicks; | 17 using base::TimeTicks; |
18 using content::BrowserThread; | 18 using content::BrowserThread; |
19 | 19 |
20 // Negative numbers are never used as sequence numbers. We explicitly pick a | 20 // Negative numbers are never used as sequence numbers. We explicitly pick a |
21 // negative number that is "so negative" that even when we add one (as is done | 21 // negative number that is "so negative" that even when we add one (as is done |
22 // when we generated the next sequence number) that it will still be negative. | 22 // when we generated the next sequence number) that it will still be negative. |
23 // We have code that handles wrapping around on an overflow into negative | 23 // We have code that handles wrapping around on an overflow into negative |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 async_renderers_pending_ = renderer_count; | 250 async_renderers_pending_ = renderer_count; |
251 } else if (requester == SYNCHRONOUS_HISTOGRAMS) { | 251 } else if (requester == SYNCHRONOUS_HISTOGRAMS) { |
252 synchronous_sequence_number_ = last_used_sequence_number_; | 252 synchronous_sequence_number_ = last_used_sequence_number_; |
253 synchronous_renderers_pending_ = renderer_count; | 253 synchronous_renderers_pending_ = renderer_count; |
254 } | 254 } |
255 return last_used_sequence_number_; | 255 return last_used_sequence_number_; |
256 } | 256 } |
257 | 257 |
258 // static | 258 // static |
259 HistogramSynchronizer* HistogramSynchronizer::histogram_synchronizer_ = NULL; | 259 HistogramSynchronizer* HistogramSynchronizer::histogram_synchronizer_ = NULL; |
OLD | NEW |