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

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

Issue 7584013: Log PipelineImpl events to MediaLog. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | media/base/media_log.cc » ('j') | media/base/media_log_event.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #pragma once 7 #pragma once
8 8
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "media/base/media_log_event.h" 10 #include "media/base/media_log_event.h"
11 #include "media/base/pipeline_impl.h"
11 12
12 namespace media { 13 namespace media {
13 14
14 class MediaLog : public base::RefCountedThreadSafe<MediaLog> { 15 class MediaLog : public base::RefCountedThreadSafe<MediaLog> {
15 public: 16 public:
16 17
scherkus (not reviewing) 2011/08/08 23:14:15 nit: want to nuke this blank line?
Scott Franklin 2011/08/09 00:31:28 I thought the rule was blank line before //?
scherkus (not reviewing) 2011/08/09 00:58:07 Ah! I should clarify. Blank line before // UNLESS
17 // Return a string to represent an EventType. 18 // Convert various enums to strings.
18 static const char* EventTypeToString(MediaLogEvent::Type type); 19 static const char* EventTypeToString(MediaLogEvent::Type type);
20 static const char* PipelineStateToString(PipelineImpl::State);
19 21
20 MediaLog(); 22 MediaLog();
21 23
22 // Methods called by loggers when events occur. These generate appropriate 24 // Methods called by loggers when events occur. These generate appropriate
23 // event parameters so the caller need not worry about them. 25 // event parameters so the caller need not worry about them.
24 void Load(const std::string& url); 26 void Load(const std::string& url);
27 void Seek(float seconds);
28 void SetPipelineState(PipelineImpl::State state);
25 29
26 // Add an event to this log. Overriden by inheritors to actually do something 30 // Add an event to this log. Overriden by inheritors to actually do something
27 // with it. 31 // with it.
28 // Takes ownership of |event|. 32 // Takes ownership of |event|.
29 virtual void AddEvent(MediaLogEvent* event); 33 virtual void AddEvent(MediaLogEvent* event);
30 34
31 // Convenience method for adding an event with no parameters. 35 // Convenience method for adding an event with no parameters.
32 void AddEventOfType(MediaLogEvent::Type type); 36 void AddEventOfType(MediaLogEvent::Type type);
33 37
34 // Convenience method for filling in common fields of a new event. 38 // Convenience method for filling in common fields of a new event.
35 MediaLogEvent* CreateEvent(MediaLogEvent::Type type); 39 MediaLogEvent* CreateEvent(MediaLogEvent::Type type);
36 40
37 protected: 41 protected:
38 friend class base::RefCountedThreadSafe<MediaLog>; 42 friend class base::RefCountedThreadSafe<MediaLog>;
39 virtual ~MediaLog(); 43 virtual ~MediaLog();
40 44
41 private: 45 private:
42 // A unique (to this process) id for this MediaLog. 46 // A unique (to this process) id for this MediaLog.
43 int32 id_; 47 int32 id_;
44 48
45 DISALLOW_COPY_AND_ASSIGN(MediaLog); 49 DISALLOW_COPY_AND_ASSIGN(MediaLog);
46 }; 50 };
47 51
48 } // namespace media 52 } // namespace media
49 53
50 #endif // MEDIA_BASE_MEDIA_LOG_H_ 54 #endif // MEDIA_BASE_MEDIA_LOG_H_
OLDNEW
« no previous file with comments | « no previous file | media/base/media_log.cc » ('j') | media/base/media_log_event.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698