| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 size_t width, size_t height); | 63 size_t width, size_t height); |
| 64 scoped_ptr<MediaLogEvent> CreateBufferedExtentsChangedEvent(int64_t start, | 64 scoped_ptr<MediaLogEvent> CreateBufferedExtentsChangedEvent(int64_t start, |
| 65 int64_t current, | 65 int64_t current, |
| 66 int64_t end); | 66 int64_t end); |
| 67 | 67 |
| 68 // Report a log message at the specified log level. | 68 // Report a log message at the specified log level. |
| 69 void AddLogEvent(MediaLogLevel level, const std::string& message); | 69 void AddLogEvent(MediaLogLevel level, const std::string& message); |
| 70 | 70 |
| 71 // Report a property change without an accompanying event. | 71 // Report a property change without an accompanying event. |
| 72 void SetStringProperty(const std::string& key, const std::string& value); | 72 void SetStringProperty(const std::string& key, const std::string& value); |
| 73 void SetIntegerProperty(const std::string& key, int value); | |
| 74 void SetDoubleProperty(const std::string& key, double value); | 73 void SetDoubleProperty(const std::string& key, double value); |
| 75 void SetBooleanProperty(const std::string& key, bool value); | 74 void SetBooleanProperty(const std::string& key, bool value); |
| 76 void SetTimeProperty(const std::string& key, base::TimeDelta value); | |
| 77 | 75 |
| 78 protected: | 76 protected: |
| 79 friend class base::RefCountedThreadSafe<MediaLog>; | 77 friend class base::RefCountedThreadSafe<MediaLog>; |
| 80 virtual ~MediaLog(); | 78 virtual ~MediaLog(); |
| 81 | 79 |
| 82 private: | 80 private: |
| 83 // A unique (to this process) id for this MediaLog. | 81 // A unique (to this process) id for this MediaLog. |
| 84 int32_t id_; | 82 int32_t id_; |
| 85 | 83 |
| 86 DISALLOW_COPY_AND_ASSIGN(MediaLog); | 84 DISALLOW_COPY_AND_ASSIGN(MediaLog); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 #define LIMITED_MEDIA_LOG(level, media_log, count, max) \ | 120 #define LIMITED_MEDIA_LOG(level, media_log, count, max) \ |
| 123 LAZY_STREAM(MEDIA_LOG(level, media_log), \ | 121 LAZY_STREAM(MEDIA_LOG(level, media_log), \ |
| 124 (count) < (max) && ((count)++ || true)) \ | 122 (count) < (max) && ((count)++ || true)) \ |
| 125 << (((count) == (max)) ? "(Log limit reached. Further similar entries " \ | 123 << (((count) == (max)) ? "(Log limit reached. Further similar entries " \ |
| 126 "may be suppressed): " \ | 124 "may be suppressed): " \ |
| 127 : "") | 125 : "") |
| 128 | 126 |
| 129 } // namespace media | 127 } // namespace media |
| 130 | 128 |
| 131 #endif // MEDIA_BASE_MEDIA_LOG_H_ | 129 #endif // MEDIA_BASE_MEDIA_LOG_H_ |
| OLD | NEW |