Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(46)

Side by Side Diff: chrome/browser/metrics/histogram_synchronizer.cc

Issue 8437002: Move BrowserThread to content namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: A few updates. Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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" 12 #include "content/browser/renderer_host/render_process_host.h"
13 #include "content/public/browser/browser_thread.h" 13 #include "content/public/browser/browser_thread.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 19
19 // 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
20 // 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
21 // 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.
22 // 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
23 // territory. 24 // territory.
24 static const int kNeverUsableSequenceNumber = -2; 25 static const int kNeverUsableSequenceNumber = -2;
25 26
26 HistogramSynchronizer::HistogramSynchronizer() 27 HistogramSynchronizer::HistogramSynchronizer()
27 : lock_(), 28 : lock_(),
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 async_renderers_pending_ = renderer_count; 250 async_renderers_pending_ = renderer_count;
250 } else if (requester == SYNCHRONOUS_HISTOGRAMS) { 251 } else if (requester == SYNCHRONOUS_HISTOGRAMS) {
251 synchronous_sequence_number_ = last_used_sequence_number_; 252 synchronous_sequence_number_ = last_used_sequence_number_;
252 synchronous_renderers_pending_ = renderer_count; 253 synchronous_renderers_pending_ = renderer_count;
253 } 254 }
254 return last_used_sequence_number_; 255 return last_used_sequence_number_;
255 } 256 }
256 257
257 // static 258 // static
258 HistogramSynchronizer* HistogramSynchronizer::histogram_synchronizer_ = NULL; 259 HistogramSynchronizer* HistogramSynchronizer::histogram_synchronizer_ = NULL;
OLDNEW
« no previous file with comments | « chrome/browser/metrics/field_trial_synchronizer.cc ('k') | chrome/browser/metrics/metrics_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698