| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 static std::string PipelineStatusToString(PipelineStatus status); | 37 static std::string PipelineStatusToString(PipelineStatus status); |
| 38 | 38 |
| 39 static std::string MediaEventToLogString(const MediaLogEvent& event); | 39 static std::string MediaEventToLogString(const MediaLogEvent& event); |
| 40 | 40 |
| 41 MediaLog(); | 41 MediaLog(); |
| 42 | 42 |
| 43 // Add an event to this log. Overriden by inheritors to actually do something | 43 // Add an event to this log. Overriden by inheritors to actually do something |
| 44 // with it. | 44 // with it. |
| 45 virtual void AddEvent(scoped_ptr<MediaLogEvent> event); | 45 virtual void AddEvent(scoped_ptr<MediaLogEvent> event); |
| 46 | 46 |
| 47 // Retrieve an error message, if any. |
| 48 virtual std::string GetLastErrorMessage(); |
| 49 |
| 47 // Helper methods to create events and their parameters. | 50 // Helper methods to create events and their parameters. |
| 48 scoped_ptr<MediaLogEvent> CreateEvent(MediaLogEvent::Type type); | 51 scoped_ptr<MediaLogEvent> CreateEvent(MediaLogEvent::Type type); |
| 49 scoped_ptr<MediaLogEvent> CreateBooleanEvent( | 52 scoped_ptr<MediaLogEvent> CreateBooleanEvent( |
| 50 MediaLogEvent::Type type, const std::string& property, bool value); | 53 MediaLogEvent::Type type, const std::string& property, bool value); |
| 51 scoped_ptr<MediaLogEvent> CreateStringEvent(MediaLogEvent::Type type, | 54 scoped_ptr<MediaLogEvent> CreateStringEvent(MediaLogEvent::Type type, |
| 52 const std::string& property, | 55 const std::string& property, |
| 53 const std::string& value); | 56 const std::string& value); |
| 54 scoped_ptr<MediaLogEvent> CreateTimeEvent(MediaLogEvent::Type type, | 57 scoped_ptr<MediaLogEvent> CreateTimeEvent(MediaLogEvent::Type type, |
| 55 const std::string& property, | 58 const std::string& property, |
| 56 base::TimeDelta value); | 59 base::TimeDelta value); |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 #define LIMITED_MEDIA_LOG(level, media_log, count, max) \ | 123 #define LIMITED_MEDIA_LOG(level, media_log, count, max) \ |
| 121 LAZY_STREAM(MEDIA_LOG(level, media_log), \ | 124 LAZY_STREAM(MEDIA_LOG(level, media_log), \ |
| 122 (count) < (max) && ((count)++ || true)) \ | 125 (count) < (max) && ((count)++ || true)) \ |
| 123 << (((count) == (max)) ? "(Log limit reached. Further similar entries " \ | 126 << (((count) == (max)) ? "(Log limit reached. Further similar entries " \ |
| 124 "may be suppressed): " \ | 127 "may be suppressed): " \ |
| 125 : "") | 128 : "") |
| 126 | 129 |
| 127 } // namespace media | 130 } // namespace media |
| 128 | 131 |
| 129 #endif // MEDIA_BASE_MEDIA_LOG_H_ | 132 #endif // MEDIA_BASE_MEDIA_LOG_H_ |
| OLD | NEW |