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

Side by Side Diff: media/base/media_log.cc

Issue 9253006: Leak global atomicsequencenumber media_log_id to avoid atexit() handler being registered. (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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "media/base/media_log.h" 5 #include "media/base/media_log.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/atomic_sequence_num.h" 9 #include "base/atomic_sequence_num.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
11 #include "base/lazy_instance.h" 11 #include "base/lazy_instance.h"
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "base/values.h" 14 #include "base/values.h"
15 15
16 namespace media { 16 namespace media {
17 17
18 // A count of all MediaLogs created on this render process. 18 // A count of all MediaLogs created on this render process.
19 // Used to generate unique ids. 19 // Used to generate unique ids.
20 static base::LazyInstance<base::AtomicSequenceNumber> media_log_count = 20 static base::LazyInstance<
21 base::AtomicSequenceNumber,
22 base::LeakyLazyInstanceTraits<base::AtomicSequenceNumber> > media_log_count =
21 LAZY_INSTANCE_INITIALIZER; 23 LAZY_INSTANCE_INITIALIZER;
22 24
23 const char* MediaLog::EventTypeToString(MediaLogEvent::Type type) { 25 const char* MediaLog::EventTypeToString(MediaLogEvent::Type type) {
24 switch (type) { 26 switch (type) {
25 case MediaLogEvent::WEBMEDIAPLAYER_CREATED: 27 case MediaLogEvent::WEBMEDIAPLAYER_CREATED:
26 return "WEBMEDIAPLAYER_CREATED"; 28 return "WEBMEDIAPLAYER_CREATED";
27 case MediaLogEvent::WEBMEDIAPLAYER_DESTROYED: 29 case MediaLogEvent::WEBMEDIAPLAYER_DESTROYED:
28 return "WEBMEDIAPLAYER_DESTROYED"; 30 return "WEBMEDIAPLAYER_DESTROYED";
29 case MediaLogEvent::PIPELINE_CREATED: 31 case MediaLogEvent::PIPELINE_CREATED:
30 return "PIPELINE_CREATED"; 32 return "PIPELINE_CREATED";
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 last_statistics_.video_bytes_decoded); 257 last_statistics_.video_bytes_decoded);
256 event->params.SetInteger("video_frames_decoded", 258 event->params.SetInteger("video_frames_decoded",
257 last_statistics_.video_frames_decoded); 259 last_statistics_.video_frames_decoded);
258 event->params.SetInteger("video_frames_dropped", 260 event->params.SetInteger("video_frames_dropped",
259 last_statistics_.video_frames_dropped); 261 last_statistics_.video_frames_dropped);
260 AddEvent(event.Pass()); 262 AddEvent(event.Pass());
261 stats_update_pending_ = false; 263 stats_update_pending_ = false;
262 } 264 }
263 265
264 } //namespace media 266 } //namespace media
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698