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

Unified Diff: media/base/media_log.cc

Issue 9225001: Remove two static initializers (media/base/{buffers,media_log}.cc) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 11 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 | « media/base/clock.cc ('k') | media/base/pts_stream.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/media_log.cc
diff --git a/media/base/media_log.cc b/media/base/media_log.cc
index d9ac5297c939abeb92776dc700bd2174f5c08866..0ab29b56ba2b19cd890ae77d99afc93fb324b447 100644
--- a/media/base/media_log.cc
+++ b/media/base/media_log.cc
@@ -8,6 +8,7 @@
#include "base/atomic_sequence_num.h"
#include "base/bind.h"
+#include "base/lazy_instance.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "base/values.h"
@@ -16,7 +17,8 @@ namespace media {
// A count of all MediaLogs created on this render process.
// Used to generate unique ids.
-static base::AtomicSequenceNumber media_log_count(base::LINKER_INITIALIZED);
+static base::LazyInstance<base::AtomicSequenceNumber> media_log_count =
Nico 2012/01/18 03:48:31 This needs LeakyLakyInstanceTraits as 2nd template
Ami GONE FROM CHROMIUM 2012/01/18 04:52:31 As you wish: https://chromiumcodereview.appspot.co
+ LAZY_INSTANCE_INITIALIZER;
const char* MediaLog::EventTypeToString(MediaLogEvent::Type type) {
switch (type) {
@@ -144,7 +146,7 @@ const char* MediaLog::PipelineStatusToString(PipelineStatus status) {
}
MediaLog::MediaLog() {
- id_ = media_log_count.GetNext();
+ id_ = media_log_count.Get().GetNext();
stats_update_pending_ = false;
}
« no previous file with comments | « media/base/clock.cc ('k') | media/base/pts_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698