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

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

Issue 697463005: Add PipelineStatus UMA logging to media_internals (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix CL comments Created 6 years, 1 month 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
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 22 matching lines...) Expand all
33 LogCB log_cb_; 33 LogCB log_cb_;
34 std::stringstream stream_; 34 std::stringstream stream_;
35 }; 35 };
36 36
37 #define MEDIA_LOG(log_cb) LogHelper(log_cb).stream() 37 #define MEDIA_LOG(log_cb) LogHelper(log_cb).stream()
38 38
39 class MEDIA_EXPORT MediaLog : public base::RefCountedThreadSafe<MediaLog> { 39 class MEDIA_EXPORT MediaLog : public base::RefCountedThreadSafe<MediaLog> {
40 public: 40 public:
41 // Convert various enums to strings. 41 // Convert various enums to strings.
42 static const char* EventTypeToString(MediaLogEvent::Type type); 42 static const char* EventTypeToString(MediaLogEvent::Type type);
43 static const char* PipelineStatusToString(PipelineStatus); 43 static const char* PipelineStatusToString(PipelineStatus status);
44 44
45 MediaLog(); 45 MediaLog();
46 46
47 // Add an event to this log. Overriden by inheritors to actually do something 47 // Add an event to this log. Overriden by inheritors to actually do something
48 // with it. 48 // with it.
49 virtual void AddEvent(scoped_ptr<MediaLogEvent> event); 49 virtual void AddEvent(scoped_ptr<MediaLogEvent> event);
50 50
51 // Helper methods to create events and their parameters. 51 // Helper methods to create events and their parameters.
52 scoped_ptr<MediaLogEvent> CreateEvent(MediaLogEvent::Type type); 52 scoped_ptr<MediaLogEvent> CreateEvent(MediaLogEvent::Type type);
53 scoped_ptr<MediaLogEvent> CreateBooleanEvent( 53 scoped_ptr<MediaLogEvent> CreateBooleanEvent(
(...skipping 28 matching lines...) Expand all
82 private: 82 private:
83 // A unique (to this process) id for this MediaLog. 83 // A unique (to this process) id for this MediaLog.
84 int32 id_; 84 int32 id_;
85 85
86 DISALLOW_COPY_AND_ASSIGN(MediaLog); 86 DISALLOW_COPY_AND_ASSIGN(MediaLog);
87 }; 87 };
88 88
89 } // namespace media 89 } // namespace media
90 90
91 #endif // MEDIA_BASE_MEDIA_LOG_H_ 91 #endif // MEDIA_BASE_MEDIA_LOG_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698