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 "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "media/base/media_export.h" | 10 #include "media/base/media_export.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 MediaLog(); | 24 MediaLog(); |
25 | 25 |
26 // Add an event to this log. Overriden by inheritors to actually do something | 26 // Add an event to this log. Overriden by inheritors to actually do something |
27 // with it. | 27 // with it. |
28 virtual void AddEvent(scoped_ptr<MediaLogEvent> event); | 28 virtual void AddEvent(scoped_ptr<MediaLogEvent> event); |
29 | 29 |
30 // Helper methods to create events and their parameters. | 30 // Helper methods to create events and their parameters. |
31 scoped_ptr<MediaLogEvent> CreateEvent(MediaLogEvent::Type type); | 31 scoped_ptr<MediaLogEvent> CreateEvent(MediaLogEvent::Type type); |
32 scoped_ptr<MediaLogEvent> CreateBooleanEvent( | 32 scoped_ptr<MediaLogEvent> CreateBooleanEvent( |
33 MediaLogEvent::Type type, const char* property, bool value); | 33 MediaLogEvent::Type type, const char* property, bool value); |
34 scoped_ptr<MediaLogEvent> CreateIntegerEvent( | 34 scoped_ptr<MediaLogEvent> CreateStringEvent( |
35 MediaLogEvent::Type type, const char* property, int64 value); | 35 MediaLogEvent::Type type, const char* property, const std::string& value); |
36 scoped_ptr<MediaLogEvent> CreateTimeEvent( | 36 scoped_ptr<MediaLogEvent> CreateTimeEvent( |
37 MediaLogEvent::Type type, const char* property, base::TimeDelta value); | 37 MediaLogEvent::Type type, const char* property, base::TimeDelta value); |
38 scoped_ptr<MediaLogEvent> CreateLoadEvent(const std::string& url); | 38 scoped_ptr<MediaLogEvent> CreateLoadEvent(const std::string& url); |
39 scoped_ptr<MediaLogEvent> CreateSeekEvent(float seconds); | 39 scoped_ptr<MediaLogEvent> CreateSeekEvent(float seconds); |
40 scoped_ptr<MediaLogEvent> CreatePipelineStateChangedEvent( | 40 scoped_ptr<MediaLogEvent> CreatePipelineStateChangedEvent( |
41 Pipeline::State state); | 41 Pipeline::State state); |
42 scoped_ptr<MediaLogEvent> CreatePipelineErrorEvent(PipelineStatus error); | 42 scoped_ptr<MediaLogEvent> CreatePipelineErrorEvent(PipelineStatus error); |
43 scoped_ptr<MediaLogEvent> CreateVideoSizeSetEvent( | 43 scoped_ptr<MediaLogEvent> CreateVideoSizeSetEvent( |
44 size_t width, size_t height); | 44 size_t width, size_t height); |
45 scoped_ptr<MediaLogEvent> CreateBufferedExtentsChangedEvent( | 45 scoped_ptr<MediaLogEvent> CreateBufferedExtentsChangedEvent( |
46 size_t start, size_t current, size_t end); | 46 size_t start, size_t current, size_t end); |
47 | 47 |
48 protected: | 48 protected: |
49 friend class base::RefCountedThreadSafe<MediaLog>; | 49 friend class base::RefCountedThreadSafe<MediaLog>; |
50 virtual ~MediaLog(); | 50 virtual ~MediaLog(); |
51 | 51 |
52 private: | 52 private: |
53 // A unique (to this process) id for this MediaLog. | 53 // A unique (to this process) id for this MediaLog. |
54 int32 id_; | 54 int32 id_; |
55 | 55 |
56 DISALLOW_COPY_AND_ASSIGN(MediaLog); | 56 DISALLOW_COPY_AND_ASSIGN(MediaLog); |
57 }; | 57 }; |
58 | 58 |
59 } // namespace media | 59 } // namespace media |
60 | 60 |
61 #endif // MEDIA_BASE_MEDIA_LOG_H_ | 61 #endif // MEDIA_BASE_MEDIA_LOG_H_ |
OLD | NEW |