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

Unified Diff: base/message_loop.cc

Issue 6780035: Use lock-free lazy initialization for static histogram references (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 9 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/message_loop.h ('k') | base/metrics/histogram.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/message_loop.cc
===================================================================
--- base/message_loop.cc (revision 80382)
+++ base/message_loop.cc (working copy)
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -122,6 +122,7 @@
: type_(type),
nestable_tasks_allowed_(true),
exception_restoration_(false),
+ message_histogram_(NULL),
state_(NULL),
#ifdef OS_WIN
os_modal_loop_(false),
@@ -531,7 +532,7 @@
// on each thread.
void MessageLoop::StartHistogrammer() {
- if (enable_histogrammer_ && !message_histogram_.get()
+ if (enable_histogrammer_ && !message_histogram_
&& base::StatisticsRecorder::IsActive()) {
DCHECK(!thread_name_.empty());
message_histogram_ = base::LinearHistogram::FactoryGet(
@@ -544,7 +545,7 @@
}
void MessageLoop::HistogramEvent(int event) {
- if (message_histogram_.get())
+ if (message_histogram_)
message_histogram_->Add(event);
}
« no previous file with comments | « base/message_loop.h ('k') | base/metrics/histogram.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698