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

Unified Diff: chrome/browser/chromeos/cros/cros_library_loader.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 | « chrome/browser/chromeos/boot_times_loader.cc ('k') | chrome/browser/chromeos/external_metrics.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/cros/cros_library_loader.cc
===================================================================
--- chrome/browser/chromeos/cros/cros_library_loader.cc (revision 80382)
+++ chrome/browser/chromeos/cros/cros_library_loader.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.
@@ -22,16 +22,14 @@
static const base::TimeDelta max_time = base::TimeDelta::FromSeconds(1);
const size_t bucket_count(10);
DCHECK(name);
- scoped_refptr<base::Histogram> counter = base::Histogram::FactoryTimeGet(
+ base::Histogram* counter = base::Histogram::FactoryTimeGet(
std::string(name),
min_time,
max_time,
bucket_count,
base::Histogram::kNoFlags);
- if (counter.get()) {
- counter->AddTime(delta);
- VLOG(1) << "Cros Time: " << name << ": " << delta.InMilliseconds() << "ms.";
- }
+ counter->AddTime(delta);
+ VLOG(1) << "Cros Time: " << name << ": " << delta.InMilliseconds() << "ms.";
}
} // namespace
« no previous file with comments | « chrome/browser/chromeos/boot_times_loader.cc ('k') | chrome/browser/chromeos/external_metrics.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698