OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2011 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 // This file contains the helper classes for the DataLog APIs. See data_log.h | 11 // This file contains the helper classes for the DataLog APIs. See data_log.h |
12 // for the APIs. | 12 // for the APIs. |
13 // | 13 // |
14 // These classes are helper classes used for logging data for offline | 14 // These classes are helper classes used for logging data for offline |
15 // processing. Data logged with these classes can conveniently be parsed and | 15 // processing. Data logged with these classes can conveniently be parsed and |
16 // processed with e.g. Matlab. | 16 // processed with e.g. Matlab. |
17 #ifndef WEBRTC_SYSTEM_WRAPPERS_INCLUDE_DATA_LOG_IMPL_H_ | 17 #ifndef WEBRTC_SYSTEM_WRAPPERS_INCLUDE_DATA_LOG_IMPL_H_ |
18 #define WEBRTC_SYSTEM_WRAPPERS_INCLUDE_DATA_LOG_IMPL_H_ | 18 #define WEBRTC_SYSTEM_WRAPPERS_INCLUDE_DATA_LOG_IMPL_H_ |
19 | 19 |
20 #include <map> | 20 #include <map> |
| 21 #include <memory> |
21 #include <sstream> | 22 #include <sstream> |
22 #include <string> | 23 #include <string> |
23 #include <vector> | 24 #include <vector> |
24 | 25 |
25 #include "webrtc/base/platform_thread.h" | 26 #include "webrtc/base/platform_thread.h" |
26 #include "webrtc/base/scoped_ptr.h" | 27 #include "webrtc/base/scoped_ptr.h" |
27 #include "webrtc/typedefs.h" | 28 #include "webrtc/typedefs.h" |
28 | 29 |
29 namespace webrtc { | 30 namespace webrtc { |
30 | 31 |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 // This function writes data to file. Note, it blocks if there is no data | 133 // This function writes data to file. Note, it blocks if there is no data |
133 // that should be written to file availble. Flush is the non-blocking | 134 // that should be written to file availble. Flush is the non-blocking |
134 // version of this function. | 135 // version of this function. |
135 void Process(); | 136 void Process(); |
136 | 137 |
137 // Stops the continuous calling of Process(). | 138 // Stops the continuous calling of Process(). |
138 void StopThread(); | 139 void StopThread(); |
139 | 140 |
140 // Collection of tables indexed by the table name as std::string. | 141 // Collection of tables indexed by the table name as std::string. |
141 typedef std::map<std::string, LogTable*> TableMap; | 142 typedef std::map<std::string, LogTable*> TableMap; |
142 typedef rtc::scoped_ptr<CriticalSectionWrapper> CritSectScopedPtr; | 143 typedef std::unique_ptr<CriticalSectionWrapper> CritSectScopedPtr; |
143 | 144 |
144 static CritSectScopedPtr crit_sect_; | 145 static CritSectScopedPtr crit_sect_; |
145 static DataLogImpl* instance_; | 146 static DataLogImpl* instance_; |
146 int counter_; | 147 int counter_; |
147 TableMap tables_; | 148 TableMap tables_; |
148 EventWrapper* flush_event_; | 149 EventWrapper* flush_event_; |
149 // This is a scoped_ptr so that we don't have to create threads in the no-op | 150 // This is a unique_ptr so that we don't have to create threads in the no-op |
150 // impl. | 151 // impl. |
151 rtc::scoped_ptr<rtc::PlatformThread> file_writer_thread_; | 152 std::unique_ptr<rtc::PlatformThread> file_writer_thread_; |
152 RWLockWrapper* tables_lock_; | 153 RWLockWrapper* tables_lock_; |
153 }; | 154 }; |
154 | 155 |
155 } // namespace webrtc | 156 } // namespace webrtc |
156 | 157 |
157 #endif // WEBRTC_SYSTEM_WRAPPERS_INCLUDE_DATA_LOG_IMPL_H_ | 158 #endif // WEBRTC_SYSTEM_WRAPPERS_INCLUDE_DATA_LOG_IMPL_H_ |
OLD | NEW |