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_EVENT_H_ | 5 #ifndef MEDIA_BASE_MEDIA_LOG_EVENT_H_ |
6 #define MEDIA_BASE_MEDIA_LOG_EVENT_H_ | 6 #define MEDIA_BASE_MEDIA_LOG_EVENT_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <memory> |
9 | 10 |
10 #include "base/time/time.h" | 11 #include "base/time/time.h" |
11 #include "base/values.h" | 12 #include "base/values.h" |
12 | 13 |
13 namespace media { | 14 namespace media { |
14 | 15 |
15 struct MediaLogEvent { | 16 struct MediaLogEvent { |
16 MediaLogEvent() {} | 17 MediaLogEvent() {} |
17 | 18 |
18 MediaLogEvent(const MediaLogEvent& event) { | 19 MediaLogEvent(const MediaLogEvent& event) { |
19 *this = event; | 20 *this = event; |
20 } | 21 } |
21 | 22 |
22 MediaLogEvent& operator=(const MediaLogEvent& event) { | 23 MediaLogEvent& operator=(const MediaLogEvent& event) { |
23 id = event.id; | 24 id = event.id; |
24 type = event.type; | 25 type = event.type; |
25 scoped_ptr<base::DictionaryValue> event_copy(event.params.DeepCopy()); | 26 std::unique_ptr<base::DictionaryValue> event_copy(event.params.DeepCopy()); |
26 params.Swap(event_copy.get()); | 27 params.Swap(event_copy.get()); |
27 time = event.time; | 28 time = event.time; |
28 return *this; | 29 return *this; |
29 } | 30 } |
30 | 31 |
31 enum Type { | 32 enum Type { |
32 // A WebMediaPlayer is being created or destroyed. | 33 // A WebMediaPlayer is being created or destroyed. |
33 // params: none. | 34 // params: none. |
34 WEBMEDIAPLAYER_CREATED, | 35 WEBMEDIAPLAYER_CREATED, |
35 WEBMEDIAPLAYER_DESTROYED, | 36 WEBMEDIAPLAYER_DESTROYED, |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 | 100 |
100 int32_t id; | 101 int32_t id; |
101 Type type; | 102 Type type; |
102 base::DictionaryValue params; | 103 base::DictionaryValue params; |
103 base::TimeTicks time; | 104 base::TimeTicks time; |
104 }; | 105 }; |
105 | 106 |
106 } // namespace media | 107 } // namespace media |
107 | 108 |
108 #endif // MEDIA_BASE_MEDIA_LOG_EVENT_H_ | 109 #endif // MEDIA_BASE_MEDIA_LOG_EVENT_H_ |
OLD | NEW |