| OLD | NEW |
| 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/message_loop.h" | 14 #include "base/message_loop.h" |
| 15 #include "base/values.h" | 15 #include "base/values.h" |
| 16 | 16 |
| 17 namespace media { | 17 namespace media { |
| 18 | 18 |
| 19 // A count of all MediaLogs created on this render process. | 19 // A count of all MediaLogs created on this render process. |
| 20 // Used to generate unique ids. | 20 // Used to generate unique ids. |
| 21 static base::LazyInstance< | 21 static base::LazyInstance<base::AtomicSequenceNumber>::Leaky media_log_count = |
| 22 base::AtomicSequenceNumber, | |
| 23 base::LeakyLazyInstanceTraits<base::AtomicSequenceNumber> > media_log_count = | |
| 24 LAZY_INSTANCE_INITIALIZER; | 22 LAZY_INSTANCE_INITIALIZER; |
| 25 | 23 |
| 26 const char* MediaLog::EventTypeToString(MediaLogEvent::Type type) { | 24 const char* MediaLog::EventTypeToString(MediaLogEvent::Type type) { |
| 27 switch (type) { | 25 switch (type) { |
| 28 case MediaLogEvent::WEBMEDIAPLAYER_CREATED: | 26 case MediaLogEvent::WEBMEDIAPLAYER_CREATED: |
| 29 return "WEBMEDIAPLAYER_CREATED"; | 27 return "WEBMEDIAPLAYER_CREATED"; |
| 30 case MediaLogEvent::WEBMEDIAPLAYER_DESTROYED: | 28 case MediaLogEvent::WEBMEDIAPLAYER_DESTROYED: |
| 31 return "WEBMEDIAPLAYER_DESTROYED"; | 29 return "WEBMEDIAPLAYER_DESTROYED"; |
| 32 case MediaLogEvent::PIPELINE_CREATED: | 30 case MediaLogEvent::PIPELINE_CREATED: |
| 33 return "PIPELINE_CREATED"; | 31 return "PIPELINE_CREATED"; |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 last_statistics_.video_bytes_decoded); | 256 last_statistics_.video_bytes_decoded); |
| 259 event->params.SetInteger("video_frames_decoded", | 257 event->params.SetInteger("video_frames_decoded", |
| 260 last_statistics_.video_frames_decoded); | 258 last_statistics_.video_frames_decoded); |
| 261 event->params.SetInteger("video_frames_dropped", | 259 event->params.SetInteger("video_frames_dropped", |
| 262 last_statistics_.video_frames_dropped); | 260 last_statistics_.video_frames_dropped); |
| 263 AddEvent(event.Pass()); | 261 AddEvent(event.Pass()); |
| 264 stats_update_pending_ = false; | 262 stats_update_pending_ = false; |
| 265 } | 263 } |
| 266 | 264 |
| 267 } //namespace media | 265 } //namespace media |
| OLD | NEW |