| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 int64_t end); | 76 int64_t end); |
| 77 | 77 |
| 78 // Report a log message at the specified log level. | 78 // Report a log message at the specified log level. |
| 79 void AddLogEvent(MediaLogLevel level, const std::string& message); | 79 void AddLogEvent(MediaLogLevel level, const std::string& message); |
| 80 | 80 |
| 81 // Report a property change without an accompanying event. | 81 // Report a property change without an accompanying event. |
| 82 void SetStringProperty(const std::string& key, const std::string& value); | 82 void SetStringProperty(const std::string& key, const std::string& value); |
| 83 void SetDoubleProperty(const std::string& key, double value); | 83 void SetDoubleProperty(const std::string& key, double value); |
| 84 void SetBooleanProperty(const std::string& key, bool value); | 84 void SetBooleanProperty(const std::string& key, bool value); |
| 85 | 85 |
| 86 // Histogram names used for reporting; also double as MediaLog key names. |
| 87 static const char kWatchTimeAudioVideoAll[]; |
| 88 static const char kWatchTimeAudioVideoMse[]; |
| 89 static const char kWatchTimeAudioVideoEme[]; |
| 90 static const char kWatchTimeAudioVideoSrc[]; |
| 91 static const char kWatchTimeAudioVideoBattery[]; |
| 92 static const char kWatchTimeAudioVideoAc[]; |
| 93 |
| 94 // Markers which signify the watch time should be finalized immediately. |
| 95 static const char kWatchTimeFinalize[]; |
| 96 static const char kWatchTimeFinalizePower[]; |
| 97 |
| 86 protected: | 98 protected: |
| 87 friend class base::RefCountedThreadSafe<MediaLog>; | 99 friend class base::RefCountedThreadSafe<MediaLog>; |
| 88 virtual ~MediaLog(); | 100 virtual ~MediaLog(); |
| 89 | 101 |
| 90 private: | 102 private: |
| 91 // A unique (to this process) id for this MediaLog. | 103 // A unique (to this process) id for this MediaLog. |
| 92 int32_t id_; | 104 int32_t id_; |
| 93 | 105 |
| 94 DISALLOW_COPY_AND_ASSIGN(MediaLog); | 106 DISALLOW_COPY_AND_ASSIGN(MediaLog); |
| 95 }; | 107 }; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 #define LIMITED_MEDIA_LOG(level, media_log, count, max) \ | 142 #define LIMITED_MEDIA_LOG(level, media_log, count, max) \ |
| 131 LAZY_STREAM(MEDIA_LOG(level, media_log), \ | 143 LAZY_STREAM(MEDIA_LOG(level, media_log), \ |
| 132 (count) < (max) && ((count)++ || true)) \ | 144 (count) < (max) && ((count)++ || true)) \ |
| 133 << (((count) == (max)) ? "(Log limit reached. Further similar entries " \ | 145 << (((count) == (max)) ? "(Log limit reached. Further similar entries " \ |
| 134 "may be suppressed): " \ | 146 "may be suppressed): " \ |
| 135 : "") | 147 : "") |
| 136 | 148 |
| 137 } // namespace media | 149 } // namespace media |
| 138 | 150 |
| 139 #endif // MEDIA_BASE_MEDIA_LOG_H_ | 151 #endif // MEDIA_BASE_MEDIA_LOG_H_ |
| OLD | NEW |