OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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 |
(...skipping 22 matching lines...) Expand all Loading... |
33 | 33 |
34 enum PacketDirection { kIncomingPacket = 0, kOutgoingPacket }; | 34 enum PacketDirection { kIncomingPacket = 0, kOutgoingPacket }; |
35 | 35 |
36 class RtcEventLog { | 36 class RtcEventLog { |
37 public: | 37 public: |
38 virtual ~RtcEventLog() {} | 38 virtual ~RtcEventLog() {} |
39 | 39 |
40 // Factory method to create an RtcEventLog object. | 40 // Factory method to create an RtcEventLog object. |
41 static std::unique_ptr<RtcEventLog> Create(const Clock* clock); | 41 static std::unique_ptr<RtcEventLog> Create(const Clock* clock); |
42 | 42 |
| 43 // Create an RtcEventLog object that does nothing. |
| 44 static std::unique_ptr<RtcEventLog> CreateNull(); |
| 45 |
43 // Starts logging a maximum of max_size_bytes bytes to the specified file. | 46 // Starts logging a maximum of max_size_bytes bytes to the specified file. |
44 // If the file already exists it will be overwritten. | 47 // If the file already exists it will be overwritten. |
45 // If max_size_bytes <= 0, logging will be active until StopLogging is called. | 48 // If max_size_bytes <= 0, logging will be active until StopLogging is called. |
46 // The function has no effect and returns false if we can't start a new log | 49 // The function has no effect and returns false if we can't start a new log |
47 // e.g. because we are already logging or the file cannot be opened. | 50 // e.g. because we are already logging or the file cannot be opened. |
48 virtual bool StartLogging(const std::string& file_name, | 51 virtual bool StartLogging(const std::string& file_name, |
49 int64_t max_size_bytes) = 0; | 52 int64_t max_size_bytes) = 0; |
50 | 53 |
51 // Same as above. The RtcEventLog takes ownership of the file if the call | 54 // Same as above. The RtcEventLog takes ownership of the file if the call |
52 // is successful, i.e. if it returns true. | 55 // is successful, i.e. if it returns true. |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 // configurations, then the remaining events in timestamp order and finally | 105 // configurations, then the remaining events in timestamp order and finally |
103 // a LOG_END event. However, this might change without further notice. | 106 // a LOG_END event. However, this might change without further notice. |
104 // TODO(terelius): Change result type to a vector? | 107 // TODO(terelius): Change result type to a vector? |
105 static bool ParseRtcEventLog(const std::string& file_name, | 108 static bool ParseRtcEventLog(const std::string& file_name, |
106 rtclog::EventStream* result); | 109 rtclog::EventStream* result); |
107 }; | 110 }; |
108 | 111 |
109 } // namespace webrtc | 112 } // namespace webrtc |
110 | 113 |
111 #endif // WEBRTC_CALL_RTC_EVENT_LOG_H_ | 114 #endif // WEBRTC_CALL_RTC_EVENT_LOG_H_ |
OLD | NEW |