| 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 #ifndef MEDIA_BASE_MEDIA_LOG_H_ | 5 #ifndef MEDIA_BASE_MEDIA_LOG_H_ |
| 6 #define MEDIA_BASE_MEDIA_LOG_H_ | 6 #define MEDIA_BASE_MEDIA_LOG_H_ |
| 7 | 7 |
| 8 #include <sstream> | 8 #include <sstream> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 base::TimeDelta value); | 53 base::TimeDelta value); |
| 54 scoped_ptr<MediaLogEvent> CreateLoadEvent(const std::string& url); | 54 scoped_ptr<MediaLogEvent> CreateLoadEvent(const std::string& url); |
| 55 scoped_ptr<MediaLogEvent> CreateSeekEvent(float seconds); | 55 scoped_ptr<MediaLogEvent> CreateSeekEvent(float seconds); |
| 56 scoped_ptr<MediaLogEvent> CreatePipelineStateChangedEvent( | 56 scoped_ptr<MediaLogEvent> CreatePipelineStateChangedEvent( |
| 57 Pipeline::State state); | 57 Pipeline::State state); |
| 58 scoped_ptr<MediaLogEvent> CreatePipelineErrorEvent(PipelineStatus error); | 58 scoped_ptr<MediaLogEvent> CreatePipelineErrorEvent(PipelineStatus error); |
| 59 scoped_ptr<MediaLogEvent> CreateVideoSizeSetEvent( | 59 scoped_ptr<MediaLogEvent> CreateVideoSizeSetEvent( |
| 60 size_t width, size_t height); | 60 size_t width, size_t height); |
| 61 scoped_ptr<MediaLogEvent> CreateBufferedExtentsChangedEvent( | 61 scoped_ptr<MediaLogEvent> CreateBufferedExtentsChangedEvent( |
| 62 int64 start, int64 current, int64 end); | 62 int64 start, int64 current, int64 end); |
| 63 | 63 scoped_ptr<MediaLogEvent> CreateLogEvent(MediaLogLevel level, |
| 64 // Report a log message at the specified log level. | 64 const std::string& message); |
| 65 void AddLogEvent(MediaLogLevel level, const std::string& message); | |
| 66 | 65 |
| 67 // Report a property change without an accompanying event. | 66 // Report a property change without an accompanying event. |
| 68 void SetStringProperty(const std::string& key, const std::string& value); | 67 void SetStringProperty(const std::string& key, const std::string& value); |
| 69 void SetIntegerProperty(const std::string& key, int value); | 68 void SetIntegerProperty(const std::string& key, int value); |
| 70 void SetDoubleProperty(const std::string& key, double value); | 69 void SetDoubleProperty(const std::string& key, double value); |
| 71 void SetBooleanProperty(const std::string& key, bool value); | 70 void SetBooleanProperty(const std::string& key, bool value); |
| 72 void SetTimeProperty(const std::string& key, base::TimeDelta value); | 71 void SetTimeProperty(const std::string& key, base::TimeDelta value); |
| 73 | 72 |
| 74 protected: | 73 protected: |
| 75 friend class base::RefCountedThreadSafe<MediaLog>; | 74 friend class base::RefCountedThreadSafe<MediaLog>; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 LogHelper((MediaLog::MEDIALOG_##level), (log_cb)).stream() | 106 LogHelper((MediaLog::MEDIALOG_##level), (log_cb)).stream() |
| 108 | 107 |
| 109 // Logs only while count < max. Increments count for each log. Use LAZY_STREAM | 108 // Logs only while count < max. Increments count for each log. Use LAZY_STREAM |
| 110 // to avoid wasteful evaluation of subsequent stream arguments. | 109 // to avoid wasteful evaluation of subsequent stream arguments. |
| 111 #define LIMITED_MEDIA_LOG(level, log_cb, count, max) \ | 110 #define LIMITED_MEDIA_LOG(level, log_cb, count, max) \ |
| 112 LAZY_STREAM(MEDIA_LOG(level, log_cb), (count) < (max) && ((count)++ || true)) | 111 LAZY_STREAM(MEDIA_LOG(level, log_cb), (count) < (max) && ((count)++ || true)) |
| 113 | 112 |
| 114 } // namespace media | 113 } // namespace media |
| 115 | 114 |
| 116 #endif // MEDIA_BASE_MEDIA_LOG_H_ | 115 #endif // MEDIA_BASE_MEDIA_LOG_H_ |
| OLD | NEW |