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> | |
8 | 7 |
9 #include "base/atomic_sequence_num.h" | 8 #include "base/atomic_sequence_num.h" |
10 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
11 #include "base/logging.h" | |
12 #include "base/values.h" | 10 #include "base/values.h" |
13 | 11 |
14 namespace media { | 12 namespace media { |
15 | 13 |
16 // A count of all MediaLogs created in the current process. Used to generate | 14 // A count of all MediaLogs created in the current process. Used to generate |
17 // unique IDs. | 15 // unique IDs. |
18 static base::StaticAtomicSequenceNumber g_media_log_count; | 16 static base::StaticAtomicSequenceNumber g_media_log_count; |
19 | 17 |
20 std::string MediaLog::MediaLogLevelToString(MediaLogLevel level) { | 18 std::string MediaLog::MediaLogLevelToString(MediaLogLevel level) { |
21 switch (level) { | 19 switch (level) { |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 : level_(level), log_cb_(log_cb) { | 282 : level_(level), log_cb_(log_cb) { |
285 } | 283 } |
286 | 284 |
287 LogHelper::~LogHelper() { | 285 LogHelper::~LogHelper() { |
288 if (log_cb_.is_null()) | 286 if (log_cb_.is_null()) |
289 return; | 287 return; |
290 log_cb_.Run(level_, stream_.str()); | 288 log_cb_.Run(level_, stream_.str()); |
291 } | 289 } |
292 | 290 |
293 } //namespace media | 291 } //namespace media |
OLD | NEW |