Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(70)

Side by Side Diff: media/base/media_log.h

Issue 1047313002: media-internals: Simplify the code path for creating a media log entry (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@MEDIA_LOG_INFO_ERROR_DEBUG
Patch Set: Fix compile on Android Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/renderer/media/android/media_source_delegate.cc ('k') | media/base/media_log.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 scoped_ptr<MediaLogEvent> CreateLogEvent(MediaLogLevel level, 63
64 const std::string& message); 64 // Report a log message at the specified log level.
65 void AddLogEvent(MediaLogLevel level, const std::string& message);
65 66
66 // Report a property change without an accompanying event. 67 // Report a property change without an accompanying event.
67 void SetStringProperty(const std::string& key, const std::string& value); 68 void SetStringProperty(const std::string& key, const std::string& value);
68 void SetIntegerProperty(const std::string& key, int value); 69 void SetIntegerProperty(const std::string& key, int value);
69 void SetDoubleProperty(const std::string& key, double value); 70 void SetDoubleProperty(const std::string& key, double value);
70 void SetBooleanProperty(const std::string& key, bool value); 71 void SetBooleanProperty(const std::string& key, bool value);
71 void SetTimeProperty(const std::string& key, base::TimeDelta value); 72 void SetTimeProperty(const std::string& key, base::TimeDelta value);
72 73
73 protected: 74 protected:
74 friend class base::RefCountedThreadSafe<MediaLog>; 75 friend class base::RefCountedThreadSafe<MediaLog>;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 LogHelper((MediaLog::MEDIALOG_##level), (log_cb)).stream() 107 LogHelper((MediaLog::MEDIALOG_##level), (log_cb)).stream()
107 108
108 // Logs only while count < max. Increments count for each log. Use LAZY_STREAM 109 // Logs only while count < max. Increments count for each log. Use LAZY_STREAM
109 // to avoid wasteful evaluation of subsequent stream arguments. 110 // to avoid wasteful evaluation of subsequent stream arguments.
110 #define LIMITED_MEDIA_LOG(level, log_cb, count, max) \ 111 #define LIMITED_MEDIA_LOG(level, log_cb, count, max) \
111 LAZY_STREAM(MEDIA_LOG(level, log_cb), (count) < (max) && ((count)++ || true)) 112 LAZY_STREAM(MEDIA_LOG(level, log_cb), (count) < (max) && ((count)++ || true))
112 113
113 } // namespace media 114 } // namespace media
114 115
115 #endif // MEDIA_BASE_MEDIA_LOG_H_ 116 #endif // MEDIA_BASE_MEDIA_LOG_H_
OLDNEW
« no previous file with comments | « content/renderer/media/android/media_source_delegate.cc ('k') | media/base/media_log.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698