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

Unified Diff: net/base/connection_type_histograms.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 | « content/browser/renderer_host/buffered_resource_handler.cc ('k') | net/base/cookie_monster.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/connection_type_histograms.cc
===================================================================
--- net/base/connection_type_histograms.cc (revision 80382)
+++ net/base/connection_type_histograms.cc (working copy)
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 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.
@@ -21,13 +21,9 @@
// Each histogram has an unused bucket at the end to allow seamless future
// expansion.
void UpdateConnectionTypeHistograms(ConnectionType type) {
- // TODO(wtc): Bug 74467 Move these stats up to a higher level, where the
- // explicit static (shown below) and the implicit statics (inside the
- // HISTOGRAM macros) will be thread safe.
-#if 0 // Don't do anything for now.
+ // TODO(wtc): Bug 74467 Move these stats up to a higher level.
+ static bool had_connection_type[NUM_OF_CONNECTION_TYPES]; // Default false.
- static bool had_connection_type[NUM_OF_CONNECTION_TYPES];
-
if (type >= 0 && type < NUM_OF_CONNECTION_TYPES) {
if (!had_connection_type[type]) {
had_connection_type[type] = true;
@@ -40,7 +36,6 @@
} else {
NOTREACHED(); // Someone's logging an invalid type!
}
-#endif // 0
}
} // namespace net
« no previous file with comments | « content/browser/renderer_host/buffered_resource_handler.cc ('k') | net/base/cookie_monster.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698