OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #ifndef WEBRTC_LOGGING_RTC_EVENT_LOG_RTC_EVENT_LOG_HELPER_THREAD_H_ | 11 #ifndef WEBRTC_LOGGING_RTC_EVENT_LOG_RTC_EVENT_LOG_HELPER_THREAD_H_ |
12 #define WEBRTC_LOGGING_RTC_EVENT_LOG_RTC_EVENT_LOG_HELPER_THREAD_H_ | 12 #define WEBRTC_LOGGING_RTC_EVENT_LOG_RTC_EVENT_LOG_HELPER_THREAD_H_ |
13 | 13 |
| 14 #include <deque> |
14 #include <limits> | 15 #include <limits> |
15 #include <memory> | 16 #include <memory> |
16 #include <utility> | 17 #include <utility> |
17 #include <vector> | 18 #include <vector> |
18 | 19 |
19 #include "webrtc/base/constructormagic.h" | 20 #include "webrtc/base/constructormagic.h" |
20 #include "webrtc/base/event.h" | 21 #include "webrtc/base/event.h" |
21 #include "webrtc/base/ignore_wundef.h" | 22 #include "webrtc/base/ignore_wundef.h" |
22 #include "webrtc/base/platform_thread.h" | 23 #include "webrtc/base/platform_thread.h" |
23 #include "webrtc/base/protobuf_utils.h" | 24 #include "webrtc/base/protobuf_utils.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 void StartLogFile(); | 89 void StartLogFile(); |
89 bool LogToFile(); | 90 bool LogToFile(); |
90 void StopLogFile(); | 91 void StopLogFile(); |
91 void ProcessEvents(); | 92 void ProcessEvents(); |
92 | 93 |
93 // Message queues for passing events to the logging thread. | 94 // Message queues for passing events to the logging thread. |
94 SwapQueue<ControlMessage>* message_queue_; | 95 SwapQueue<ControlMessage>* message_queue_; |
95 SwapQueue<std::unique_ptr<rtclog::Event>>* event_queue_; | 96 SwapQueue<std::unique_ptr<rtclog::Event>>* event_queue_; |
96 | 97 |
97 // History containing the most recent events (~ 10 s). | 98 // History containing the most recent events (~ 10 s). |
98 RingBuffer<std::unique_ptr<rtclog::Event>> history_; | 99 std::deque<std::unique_ptr<rtclog::Event>> history_; |
99 | 100 |
100 // History containing all past configuration events. | 101 // History containing all past configuration events. |
101 std::vector<std::unique_ptr<rtclog::Event>> config_history_; | 102 std::vector<std::unique_ptr<rtclog::Event>> config_history_; |
102 | 103 |
103 std::unique_ptr<FileWrapper> file_; | 104 std::unique_ptr<FileWrapper> file_; |
104 rtc::PlatformThread thread_; | 105 rtc::PlatformThread thread_; |
105 | 106 |
106 int64_t max_size_bytes_; | 107 int64_t max_size_bytes_; |
107 int64_t written_bytes_; | 108 int64_t written_bytes_; |
108 int64_t start_time_; | 109 int64_t start_time_; |
(...skipping 10 matching lines...) Expand all Loading... |
119 rtc::Event file_finished_; | 120 rtc::Event file_finished_; |
120 | 121 |
121 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RtcEventLogHelperThread); | 122 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RtcEventLogHelperThread); |
122 }; | 123 }; |
123 | 124 |
124 } // namespace webrtc | 125 } // namespace webrtc |
125 | 126 |
126 #endif // ENABLE_RTC_EVENT_LOG | 127 #endif // ENABLE_RTC_EVENT_LOG |
127 | 128 |
128 #endif // WEBRTC_LOGGING_RTC_EVENT_LOG_RTC_EVENT_LOG_HELPER_THREAD_H_ | 129 #endif // WEBRTC_LOGGING_RTC_EVENT_LOG_RTC_EVENT_LOG_HELPER_THREAD_H_ |
OLD | NEW |